Unit 1 Correct
Unit 1 Correct
Intelligence?
Analyze information and draw Acquire new knowledge and skills Identify and solve problems in a
logical conclusions. from data. goal-oriented way.
The fundamental aim of artificial intelligence is to emulate human intelligence in machines, enabling them to
perform tasks like reasoning, learning, and problem-solving more efficiently and effectively.
How Does AI Work?
1 Input
Data is collected from various sources and sorted into categories.
2 Processing
The AI system sorts and deciphers the data using programmed
patterns until it recognizes similar patterns.
3 Outcomes
The AI can then use those patterns to predict outcomes.
AI works through a cyclical process of data input, processing, outcome prediction, and
self-adjustment, enabling the system to continuously learn and improve its
performance.
Types of AI
1 Narrow AI 2 General AI
S pecialized for specific tasks, like speech Aims to exhibit human-like intelligence across a
recognition or image classification. wide range of tasks.
Finance
AI helps in credit scoring by analyzing financial data to predict creditworthiness.
Retail
AI is used for product recommendations based on customer browsing and purchase history.
Manufacturing
AI helps in quality control by inspecting products for defects.
Artificial Intelligence has a wide range of practical applications across industries, from healthcare and
finance to retail and manufacturing, revolutionizing how we approach problem-solving and decision-
making.
The Need for AI
Increas ed Efficiency
AI automates repetitive tasks, freeing up human time and resources.
Computer Vision
Deals with the processing and analysis of visual information using computer
algorithms.
• Search is the systemstic examination of states to find path from the start or root node to
the goal state.
• For complex problems, the traditional alhgorithms are unable to find the solution within
some practical time and space limits.
1
Requirements of search algorithms
whenever we apply an algorithm we should able to move from one state to another
state.
It should have step by step approach so that we can move from source state to goal
state.
2
Types of searching algorithms
3
Uninformed Search
4
Informed Search
• Informed search strategies can find a solution more efficiient than an uninformed search
strategy.
• Might not always be guaranteed to the best solution but guaranteed to fnd a good solution
in reasonable time.
5
Informed Search
6
Breadth First Search Algorithm
a) Remove the first element from NODE-LIST and call it E. If NODE-LIST was
empty, then quit.
ii. if the new state is a goal state. quit and return this state
7
Breadth First Search Example
Step 1: Initially NODE-LIST contains only one node corresponding to the source state A.
NODE-LIST: A
8
Breadth First Search Example
Step 2: A is removed from NODE-LIST. The node is expanded, and its children B and C
are generated. They are placed at the back of NODE-LIST.
NODE-LIST: B C
9
Breadth First Search Example
Step 2: A is removed from NODE-LIST. The node is expanded, and its children B and C
are generated. They are placed at the back of NODE-LIST.
NODE-LIST: B C
10
Breadth First Search Example
Step 3: Node B is removed from NODE-LIST. The node is expanded, and its children D
and E are generated. They are placed at the back of NODE-LIST.
NODE-LIST: C D E
11
Breadth First Search Example
Step 4: Node C is removed from NODE-LIST. The node is expanded, and its children D
and G are added to the back of NODE-LIST.
NODE-LIST: D E D G
12
Breadth First Search Example
Step 5: Node D is removed from NODE-LIST. Its children C and F are generated and
added to the back of NODE-LIST.
NODE-LIST: E D G C F
13
Breadth First Search Example
NODE-LIST: D G C F
14
Breadth First Search Example
NODE-LIST: G C F B F
15
Breadth First Search Example
Step 8: G is selected for expansion. It is found to be a goal node. Hence the algorithm
returns the path A- C- G by the following parent pointers of the node corresponding to G.
16
Breadth First Search Example
Advantages:
Disadvantages:
• The breadth first search algorithm cannot be effectively used unless the
search spae is quite small.
17
S earch Problem
• DFS starts at the root node and explores the first child node
until it reaches a dead-end or the goal node.
• It then backtracks to the most recent node with unexplored
children and continues the search.
DFS is often implemented using a stack data structure, making
it efficient for deep, narrow search spaces.
• DFS can be useful for problems like maze solving, where
the goal is to find a path from the start to the end.
The Essence of Search Strategies
Search strategies are the driving force behind AI systems. They enable AI to navigate through many possible solutions
and find the most optimal one.
AI has a variety of search methods, from simple ones like Breadth-First Search and Depth-First Search to more
advanced techniques like Greedy Search and A* Algorithm. Each approach has its own strengths and weaknesses,
allowing AI systems to adapt and perform efficiently for different problems.
The choice of search strategy depends on the specific problem at hand. This diversity of search strategies is what
makes AI systems so powerful and versatile.
Types of S earch S trategies
Uninformed S earch S trategies Heuris tic Search Strategies
Depth-First Search and Breadth-First Search explore Hill Climbing and A* Search use educated guesses
the search space without any additional information, about the promising directions to explore, allowing
systematically visiting all possible solutions. them to find solutions more efficiently.
Breadth-First Search
Breadth-First Search (BFS) is a fundamental uninformed search
strategy that explores the search space level by level. It starts at
the root node, visiting all neighboring nodes before moving to the
next depth level.
The key steps are: 1) Initialize a queue and add the root. 2)
Dequeue a node. 3) Enqueue all its unvisited neighbors. 4) Repeat
until the queue is empty or the goal is found.
Versatility
Search strategies are the foundation of many AI-driven applications, showcasing their versatility and
adaptability to a wide range of problem domains.
Optimization
By continuously refining and improving search algorithms, AI systems can achieve greater efficiency
and find more optimal solutions to complex problems.
Innovation
As the field of AI continues to evolve, the advancement of search strategies will play a crucial role in
driving innovation and unlocking new possibilities for intelligent systems.
DFS Algorithm
function findPath(robot, start, goal):
stack ← empty stack
visited ← empty set
stack.push(start)
visited.add(current)
neighbors ← robot.getNeighbors(current)
• Step 1: Evaluate the initial state, if it is goal state then return success and
stop, else make current state as initial state.
• Step 2: Loop until a solution is found or the current state does not
change.
– Let SUCC be a state such that any successor of the current state will be
better than it.
– For each operator that applies to the current state:
• Apply the new operator and generate a new state.
• Evaluate the new state.
• If it is goal state, then return it and quit, else compare it to the SUCC.
• If it is better than SUCC, then set new state as SUCC.
• If the SUCC is better than the current state, then set current state to
SUCC.
• Step 5: Exit.
Steepest-Ascent hill climbing
• 1. Local Maximum:
– A local maximum is a peak state in the landscape
which is better than each of its neighboring
states, but there is another state also present
which is higher than the local maximum.
– Solution: Backtracking technique can be a
solution of the local maximum in state space
landscape. Create a list of the promising path so
that the algorithm can backtrack the search
space and explore other paths as well.
Problems in Hill Climbing Algorithm
Problems in Hill Climbing Algorithm