AI Unit-1
AI Unit-1
AI Unit-1
(5A24ARI)
Presented By
Prof. Aakansha Saxena
Assistant Professor
Rashtriya Raksha University
Artificial Intelligence
Artificial Intelligence
AI
AI technique
• Artificial intelligence problems span a very broad spectrum.
• They appear to have very little in common except that they are
hard.
• AI Research of earlier decades results into the fact that
intelligence requires knowledge.
• AI technique is a method that exploits knowledge that should
be represented in such a way that:
AI technique
• Knowledge possess following properties:
• It is voluminous.
• It is not well-organized or well-formatted.
• It is constantly changing.
• It differs from data. And it is organized in a way that
corresponds to its usage.
AI technique
• AI technique is a method to organize and use the knowledge
efficiently in such a way that −
• The strong AI is very much promising about the fact that the
machine is almost capable of solve a complex problem like an
intelligent man.
• They claim that a computer is much more efficient to solve the
problems than some of the human experts.
• According to strong AI, the computer is not merely a tool in
the study of mind, rather the appropriately programmed
computer is really a mind. Strong AI is the supposition that
some forms of artificial intelligence can truly reason and solve
problems
AI Classification
Weak AI or Narrow AI:
• Some thinking like features can be added to computers to
make them more useful tools. It says that computers cannot be
made intelligent equal to human being, unless constructed
significantly differently.
• They claim that computers may be similar to human experts
but not equal in any cases. Generally weak AI refers to the use
of software to study or accomplish specific
• problem solving that do not encompass the full range of
human cognitive abilities.
• i.e,playing chess, purchasing suggestions on e-commerce site,
self-driving cars,
• Weak AI programs cannot be called “intelligent” because they
cannot really think.
Subsets of AI
AI Applications
• Gaming
• Natural Language Processing
• Web Search Engine
• Recommendation System(Youtube, Netflix)
• Vision Systems
• Speech Recognition
• Handwriting Recognition
• Self Driving Cars
• Alexa, Siri
• Intelligent Robots and many more
Advantages
1. Define a state space that contains all the possible configurations of relevant
objects.
2. Specify one or more states within that space that describe possible situations
from which the problem solving process may start. These states are called
initial states.
3. Specify one or more states that would be acceptable as solutions to the
problem. These states are called goal states.
4. Specify a set of rules that describe the actions available
• The problem can then be solved by using the rules, in combination with an
appropriate control strategy, to move through the problem space until a path
from an initial state to a goal state is found.
21
State Space Search: Playing Chess
• Each position can be described by an 8-by-8 array.
• Initial position is the game opening position.
• Goal position is any position in which the opponent
does not have a legal move and his or her king is
under attack.
• Legal moves can be described by a set of rules:
− Left sides are matched against the current state.
− Right sides describe the new resulting state.
22
State Space Search: Playing Chess
23
State Space Search: Water Jug Problem
“You are given two jugs, a 4-litre one and a 3-litre one.
Neither has any measuring markers on it. There is a
pump that can be used to fill the jugs with water. How
can you get exactly 2 litres of water into 4-litre jug.”
24
State Space Search: Water Jug Problem
• State Space Representation: State of the problem
will be represented as a tuple (x, y) ,where
x = Amount of water in the 4-gallon jug ,0 ≤ x ≤ 4,
y= Amount of water in the 3-gallon jug, 0 ≤ y ≤ 3
• Start state: (0, 0).
• Goal state: (2, n) for any n.
• Attempting to end up in a goal state.
25
State Space Search: Water Jug Problem
To solve this problem,we make some assumptions and
also use some information available,
27
Solution of water jug problem according to the
production rules
28
State Space Search: Water Jug Problem
1. current state = (0, 0)
2. Loop until reaching the goal state (2, 0)
− Apply a rule whose left side matches the current state
− Set the new current state to be the resulting state
(0, 0)
(0, 3)
(3, 0)
(3, 3)
(4, 2)
(0, 2)
(2, 0)
29
State Space Search: Summary
30
Search Strategies
2. It is systematic
Otherwise, it may use more steps than necessary.
3. It is efficient
Find a good, but not necessarily the best, answer.
31
Production System
• AI programs structure should describe and perform search
Process in efficient way.
• Production system provides such structure which have,
Heuristics are strategies that are derived from past experience with
similar problems.
Hill Climbing,
A*,
Simulated Annealing,
Branch and Bound,
Nearest Neighbour,
Blind Search Techniques: DFS, BFS,
Best First Search
Generate and Test
Hill Climbing
Flat local maximum: It is a flat space in the landscape where all the
neighbor states of current states have the same value.
2. Plateau: A plateau is the flat area of the search space in which all the neighbour
states of the current state contains the same value, because of this algorithm does
not find any best direction to move. A hill-climbing search might be lost in the
plateau area.
Solution: The solution for the plateau is to take big steps while searching, to
solve the problem. Randomly select a state which is far away from the current
state so it is possible that the algorithm could find non-plateau region.
Problems in Hill Climbing Algorithm:
3. Ridges: A ridge is a special form of the local maximum. It has an area which is
higher than its surrounding areas, but itself has a slope, and cannot be reached
in a single move.
This algorithm always chooses the path which appears best at that
moment. It is the combination of depth-first search and breadth-first
search algorithms. It lets us to take the benefit of both algorithms. It uses
the heuristic function and search. With the help of the best-first search,
at each step, we can choose the most promising node.
Step 2: If the OPEN list is empty, Stop and return failure.
Step 3: Remove the node n from the OPEN list, which has the lowest
value of h(n), and places it in the CLOSED list.
Step 4: Expand the node n, and generate the successors of node n.
Step 5: Check each successor of node n, and find whether any node is a
goal node or not. If any successor node is the goal node, then return
success and stop the search, else continue to next step.
Step 6: For each successor node, the algorithm checks for evaluation
function f(n) and then check if the node has been in either OPEN or
CLOSED list. If the node has not been in both lists, then add it to the
OPEN list.
It finds the shortest path through the search space using the heuristic
function. This search algorithm expands fewer search tree and gives
optimal results faster
.
Algorithm of A* search:
Step 2: Check if the OPEN list is empty or not. If the list is empty, then
return failure and stops.
Step 3: Select the node from the OPEN list which has the smallest
value of the evaluation function (g+h). If node n is the goal node,
then return success and stop, otherwise.
Step 4: Expand node n and generate all of its successors, and put n
into the closed list. For each successor n', check whether n' is
already in the OPEN or CLOSED list. If not, then compute the
evaluation function for n' and place it into the Open list.