Aiml Assignment
Aiml Assignment
VISHWAVIDALAYA
ARTIFICIAL INTELLIGENCE AND MACHIENE LEARNING
Question:-1. Describe the four categories under which AI
is classified with examples.
Answer:- Artificial Intelligence can be divided in various types, there are mainly two types
of main categorization which are based on capabilities and based on functionally of AI.
Following is flow diagram which explain the types of AI.
2. General AI:
o General AI is a type of intelligence which could perform any intellectual task with efficiency
like a human.
o The idea behind the general AI to make such a system which could be smarter and think like
a human by its own.
o Currently, there is no such system exist which could come under general AI and can perform
any task as perfect as a human.
o The worldwide researchers are now focused on developing machines with General AI.
o As systems with general AI are still under research, and it will take lots of efforts and time to
develop such systems.
3. Super AI:
o Super AI is a level of Intelligence of Systems at which machines could surpass human
intelligence, and can perform any task better than human with cognitive properties. It is an
outcome of general AI.
o Some key characteristics of strong AI include capability include the ability to think, to
reason,solve the puzzle, make judgments, plan, learn, and communicate by its own.
o Super AI is still a hypothetical concept of Artificial Intelligence. Development of such systems
in real is still world changing task.
2. Limited Memory
o Limited memory machines can store past experiences or some data for a short period of
time.
o These machines can use stored data for a limited time period only.
o Self-driving cars are one of the best examples of Limited Memory systems. These cars can
store recent speed of nearby cars, the distance of other cars, speed limit, and other
information to navigate the road.
3. Theory of Mind
o Theory of Mind AI should understand the human emotions, people, beliefs, and be able to
interact socially like humans.
o This type of AI machines are still not developed, but researchers are making lots of efforts
and improvement for developing such AI machines.
4. Self-Awareness
o Self-awareness AI is the future of Artificial Intelligence. These machines will be super
intelligent, and will have their own consciousness, sentiments, and self-awareness.
o These machines will be smarter than human mind.
o Self-Awareness AI does not exist in reality still and it is a hypothetical concept.
1. A Global Database
3. A control System
The Global Database is the central data structure used by the production system. The rules in the
Each rule has a pre-condition. The rules for which database satisfies the pre-condition
Out of all the applicable rules, the Control system chooses which rule to apply.
1. Simplicity: Each sentence in a production system has a if-then architecture that provides
3. Modifiability: This feature allows us to form production rule in skeleton form first and
programming. It is written in pure English. The problem of semantics is solved by their structure of
representation.
Each rule can be added, removed or modified independently, which makes the system
highly modular.
Language independent
This technique doesn’t generally ensure to locate an ideal or the best arrangement, however,
it may rather locate a decent or worthy arrangement inside a sensible measure of time and
memory space. This is a sort of an alternate route as we regularly exchange one of
optimality, culmination, exactness, or accuracy for speed.
Heuristic Search let us decrease this to a somewhat polynomial number. We utilize this in AI
since we can place it to use in circumstances where we can’t discover known calculations.
Informed Search Algorithms have information on the target state which helps in logically
capable-looking. This information gathered as a limit that measures how close a state is to
the goal state.
Its significant bit of leeway is that it is proficiency is high and is equipped for discovering
arrangements in a shorter span than ignorant Search.
It contains an array of knowledge like how far we are from the goal, path cost, how to reach
the goal node, etc. This data help agents to explore less to the search space and find more
efficiently the goal node.
It is likewise nearly more affordable than an educated pursuit. It’s models incorporate-
a. A*Search
A* search is the most consistently known kind of best-first interest. It uses heuristic limit
h(n), and cost to show up at the center point n from the earliest starting point state g(n). It
has solidified features of UCS and insatiable best-first request, by which it deal with the
issue capably.
A* search computation finds the briefest path through the chase space using the heuristic
limit. This chase count expands less interest trees and gives a perfect result snappier.
A* count resembles UCS beside that it uses g(n)+h(n) instead of g(n). It is formulated with
weighted graphs, which suggests it can find the simplest path involving the littlest cost in
terms of distance and time.
This makes A* algorithm in AI an informed search algorithm for best-first search.
b. Greedy Best First Search
Greedy best-first search algorithm always selects the trail which appears best at that
moment. Within the best first search algorithm, we expand the node which is closest to the
goal node and therefore the closest cost is estimated by heuristic function.
This sort of search reliably picks the way which appears best by then. It is the blend
of BFS and DFS. It uses heuristic limit and searches. The BFS grants us to take the
advantages of the two estimations.
2. Weak Heuristic Search (Uninformed Search)
Uninformed Search Algorithms have no additional information on the target center point
other than the one gave in the troublesome definition, so it’s also called blind search.
The plans to show up at the target state from the earliest starting point state differentiate just
by the solicitation and length of exercises.
The uninformed search may be a class of general-purpose search algorithms which operates
in brute force-way. It is more unpredictable to actualize than an educated pursuit as there is
no usage of information in the ignorant inquiry. Instances of Uninformed Search are-
a. Breadth-First Search
BFS is an approach in Heuristic Search that is used to diagram data or glancing through the
tree or intersection structures. The estimation profitably visits and means all the key centers
in a graph in an exact breadthwise structure.
This count picks a singular center point (beginning or source point) in a diagram and a while
later visits all the centers neighboring the picked center.
At the point when the computation visits and means the starting center point, by then it moves
towards the nearest unvisited center points and assessments them. Once visited, all center
points are stepped. These accentuations continue until all the center points of the graph have
been viably visited and checked.
Some of the cons of Breadth-First Search include :
It eats up a lot of memory space. As every level of center points is saved for making the
following one.
Its flightiness depends upon the number of center points. It can check duplicate center
points.
b. Uniform Cost Search
Basically, it performs masterminding in growing the expense of the path to a center point.
Furthermore, it reliably develops the least cost center point.
Uniform-cost search expands nodes consistent with their path costs form the basis node. It is
often used to solve any graph/tree where the optimal cost is in demand.
In spite of the way that it is vague from Breadth-First chase if each progress has
a comparative cost. It researches courses in the extending solicitation of cost.
c. Depth First Search
It relies upon the possibility of LIFO. As it speaks to Last In First Out. In like manner,
completed in recursion with LIFO stack data structure. Along these lines, It used to make a
vague course of action of centers from the Breadth-First procedure, just in the differing
demand.
As the way is been taken care of in each accentuation from root to leaf center point.
Subsequently, store centers are immediate with space requirements. With extending factor b
and significance as m, the additional room is bm.
Iterative Deepening Depth First Search (IDDFS) is a strategy wherein cycles of DFS are
run persistently with growing cutoff points until we locate the target. IDDFS is perfect like
BFS, yet uses generously less memory.
At each accentuation, it visits the centers in the request tree in a comparable solicitation as
significance first chase, be that as it may, the total solicitation wherein center points are first
visited is enough breadth first.
e. Bidirectional Search
This as the name recommends, runs two different ways. It works with two who glance
through that run at the same time, beginning one from source excessively objective and the
other one from goal to source a retrogressive way.
The two inquiries should bargain the data structure. It depends on a guided outline to find
the most restricted route between the source(initial center) to the goal center point.
The two missions will start from their individual spots and the estimation stops when the two
requests meet at a center. It is a speedier method and improves the proportion of time
required for exploring the graph.
This strategy is capable in the circumstance when the starting center point and target center
are stand-out and portrayed. Spreading factor is the equivalent for the two.
Hill Climbing in AI
Hill Climbing is a kind of heuristic quest for logical progression issues in the field of
Artificial Intelligence. Given a set of data sources and a better than average heuristic limit, it
endeavors to find an adequate enough response for the issue. This course of action may not
be the overall perfect most noteworthy.
In the above definition, logical headway issues surmise that incline climbing handles the
issues where we need to grow or confine a given authentic limit by picking regards from the
given information sources.
For example, Model Travelling salesman issue where we need to constrain the division
passed by the salesperson.
‘Heuristic search‘ infers that this interest estimation may not find the perfect response to the
issue. In any case, it will give a not too bad game plan in a reasonable time.
A heuristic limit is a limit that will rank all the potential decisions at any growing advance in
search of figuring subject to the available information. It makes the estimation pick the best
course out of courses.
Produce and Test variation: Hill Climbing is the variation of the Generate and Test
strategy. The Generate and Test technique produce input which assists with choosing
which bearing to move in the inquiry space.
Use of Greedy Approach: Hill-climbing calculation search moves toward the path which
improves the expense.
No backtracking: It doesn’t backtrack the pursuit space, as it doesn’t recall the past
states.
Types of Hill Climbing in AI
Simple Hill climbing is the least difficult approach to execute a slope climbing calculation. It
just assesses the neighbor hub state at once and chooses the first which enhances current
expense and sets it as a present state.
It just checks it’s one replacement state, and on the off chance that it discovers superior to
the present state, at that point move else be in a similar state.
Its features include:
Less tedious
Less ideal arrangement that isn’t ensured
b. Steepest Ascent Hill Climbing
Stochastic slope climbing doesn’t analyze for all its neighbors before moving. It makes use of
randomness as a part of the search process. It is also an area search algorithm, meaning that
it modifies one solution and searches the relatively local area of the search space until the
local optima is found .
This suggests that it’s appropriate on unimodal optimization problems or to be used after the
appliance of a worldwide optimization algorithm.
This calculation chooses one neighbor hub aimlessly and concludes whether to pick it as a
present state or analyze another state.
CSP or Constraint Satisfaction Problem is a set of questions that requires its answer inside
certain confinements/conditions otherwise called limitations. It comprises of :
Limited arrangement of factors which stores the arrangement. (V = {V1, V2, V3,…..,
Vn} )
Lot of discrete qualities from which the arrangement is picked. (D = {D1, D2, D3,…..,Dn} )
Limited arrangement of limitations. (C = {C1, C2, C3,……, Cn} )
In the case of AI, we most of the time, deal with discrete quantities.
The common problems which can be solved using a CSP are Sudoku problems,
Cryptarithmetic, Crossword, etc.
Simulated Annealing is an algorithm that never makes a move towards lower esteem destined
to be incomplete that it can stall out on a nearby extreme.
Also, on the off chance that calculation applies an irregular stroll, by moving a replacement,
at that point, it might finish yet not proficient.
In the event that the irregular move improves the state, at that point, it follows a similar way.
Something else, the calculation follows the way which has a likelihood of under 1 or it moves
downhill and picks another way.
As there are many different types of AI, it can be classified into 3 main categories.
Also known as Weak AI, it is developed and designated for a particular task. The single task
it performs is within a limited context, being excellent at routine jobs, be it physical or
cognitive.
Also known as AGI, it has generalized cognitive ability to analyse and decide, in which the
AI provides solutions for an unfamiliar task it encounters. It can applies understanding and
reasoning like how a normal human would in the specific environment.
Also known as ASI, it exceed human abilities, being be able to mimic human thoughts and
achieve an accuracy higher than normal humans. ASI proves superior to humans in terms
cognitive ability.
Now, AI is dependent on the tasks they carry out. It can range from simple task, to complex
analytics. There are a few domains on how AI carry out their functions.
Mundane tasks- Routine everyday tasks that requires common sense reasoning
Expert tasks- Tasks which requires high analytical and thinking skills, a job only a
professionals can do
(For eg. Financial analysis, medical diagnostics, engineering, scientific analysis, consulting)
So having these types of domains, there are different types of works and information AI can
interpret. Usually an AI can approach them in the following ways.
Statistical approach is how AI solve specific problems using mathematics as tools. The AI
will gather, organize, analyze, synthesize and interpret numerical information from data and
deliver measurable forumlative results. This helps retrieve important data and trends which
are vital and necessary.
LISP became a common language for artificial intelligence (AI) programming, partly owing to
the confluence of LISP and AI work at MIT and partly because AI programs capable of “learning”
could be written in LISP as self-modifying programs. LISP has evolved through numerous dialects,
such as Scheme and Common LISP.
What is Prolog?
In the above table, the statement 'Dog is barking' is a fact, while the statement 'Jaya likes food if it
is delicious' is called rule. In this statement, variable like 'Food' has a first letter in capital, because
its value came from previous fact. The symbol ':-' is used to denote that “Jaya likes delicious food”.
6 -X Negation of 'X'
Operator precedence
If there is more than one operator in the arithmetic expression such as A-B*C+D, then the
prolog decides an order in which the operator should be applied.
Prolog gives numerical value for each operator, operators with high precedence
like '*' and '/' are applied before operators with relatively low precedence values
like '+' and '-'.
Operator with same precedence value ('*' or '/') and ('+' or '-') should be applied from left to
right.
So, the expression A-B*C+D can be written as A-(B*C)+D
Matching and Unification in Prolog
Definition: The two terms are said to be matched, if they are equal or if they consist of variables
representing the resulting equal terms.
Prolog matches expressions in structural way. So,
?- 3 + 2= 5
no
Note: In prolog '=' means matches with.
But the following expressions will match because they have same structure.
Expression 1:
?- X + Y = 2 + 3
X=2
Y=3
Expression 2:
?- 2 + Y = X + 3
X=2
Y=3
Prolog Lists:
Lists are the finite sequence of elements.
Prolog uses […] to build a list.
The notation [X|Y] represents that the first element is X and second element is Y (X is head
and Y is tail).
Prolog has some special notation for lists:
I) [a] [honda, maruti, renault]
ii) [a,b,c) [pen, pencil, notebook]
iii) [] represents the empty list.
Example 1: Pattern Matching in Lists
?- [a,b] = [a,X]
X=b
but:
?- [a,b] = [X]
no
Question:-8. Differentiate informed and uniformed search.
Give example.
Answer:- Informed Search
They contain information on goal state.
It helps search efficiently.
The information is obtained by a function that helps estimate how close a current
state is, to the goal state.
Examples of informed search include greedy search and graph search.
It uses the knowledge in the process of searching.
It helps find the solution quickly.
It may or may not be complete.
It is inexpensive.
It consumes less time.
It gives the direction about the solution.
It is less lengthy to implement.
Uninformed Search
They don’t have any additional information.
The information is only provided in the problem definition.
The goal state can be reached using different order and length of actions.
Examples of uninformed search include depth first search (DFS) and breadth first
search (BFS).
It doesn’t use the knowledge in the process of searching.
It takes more time to show the solution.
It is always complete.
It is expensive.
It consumes moderate time.
There is no suggestion regarding finding the solution.
It is lengthy to implement.
Problems are often modelled as a state space, a set of states that a problem can be in. The set of
states forms a graph where two states are connected if there is an operation that can be performed
to transform the first state into the second.
State space search often differs from traditional computer science search methods because the state
space is implicit: the typical state space graph is much too large to generate and store in memory.
Instead, nodes are generated as they are explored, and typically discarded thereafter. A solution to
a combinatorial search instance may consist of the goal state itself, or of a path from some initial
state to the goal state.
Question:-10. List the fields that form the basis for AI.
Answer:-Artificial intelligence is applied in fields such as
· Intelligent Robots
· Remote sensing
· Law-enforcement
· Scientific discovery
· Gaming
· Toys
· Handwriting Recognition
· Machine Vision
· Computer Vision
· Expert Systems
· Medical diagnosis
· Stock trading