AI MId-1
AI MId-1
1. Healthcare:
2. Finance:
AI MId-1 1
4. Transportation:
5. Education:
6. Entertainment:
7. Manufacturing:
8. Agriculture:
AI MId-1 2
Automated Machinery: AI controls farming equipment, increasing
productivity.
9. Environmental Monitoring:
AI's ability to efficiently handle complex tasks makes it a valuable tool in many
areas, leading to innovation and increased efficiency.
Advantages:
AI MId-1 3
Reduces human error in repetitive or data-intensive tasks.
Disadvantages:
Advantages:
Disadvantages:
Advantages:
AI MId-1 4
Capable of solving complex global issues, such as climate change and
disease eradication.
Disadvantages:
4. Reactive Machines:
Advantages:
Disadvantages:
Examples: Self-driving cars that use data from recent trips to make
driving decisions.
Advantages:
AI MId-1 5
Suitable for tasks that require short-term learning.
Disadvantages:
Algorithm Steps:
1. Initialize: Start with a list called NODE-LIST containing the initial state.
2. Loop:
a. Remove the first state from NODE-LIST and call it E.
b. If NODE-LIST is empty, stop the process.
c. For each possible move from state E:
i. Apply the move to generate a new state.
ii. If this new state is the goal, stop and return the state.
iii. If not, add the new state to the end of NODE-LIST.
BFS Illustration:
1. Initial State:
AI MId-1 6
FRINGE: [A]
2. Expand Node A:
FRINGE: [B, C]
3. Expand Node B:
FRINGE: [C, D, E]
AI MId-1 7
4. Expand Node C:
FRINGE: [D, E, D, G]
5. Expand Node D:
FRINGE: [E, D, G, C, F]
AI MId-1 8
6. Expand Node E:
FRINGE: [D, G, C, F]
1. Expand Node D:
FRINGE: [G, C, F, B, F]
AI MId-1 9
1. Expand Node G:
Optimality: BFS finds the shortest path to the goal if all moves cost the
same.
AI MId-1 10
Time Complexity: O(b^d), where b is the branching factor (maximum
number of children per node) and d is the depth of the shallowest goal.
Advantages:
Shortest Path: BFS finds the shortest path to the goal.
Disadvantages:
Memory Usage: BFS requires a lot of memory as it needs to store all nodes
at the current depth, making it impractical for large search spaces.
Exponential Growth: The size of the tree grows exponentially with the
depth, making it infeasible for deep or large search spaces.
In summary, BFS is a reliable method for finding the shortest path in small
search spaces, but its high memory requirements limit its use in larger or
deeper search spaces.
DFS Algorithm
1. Initialize:
2. Loop:
AI MId-1 11
ii. If the new state is a goal state, quit and return this state.
iii. Otherwise, add the new state to the front of NODE-LIST.
DFS Example
Consider a tree where we need to find a goal node G starting from node A.
Here's how DFS would work:
AI MId-1 12
AI MId-1 13
4 Give an overview of different kinds of
agent programs.
Agent
An agent is something that can sense its environment and take actions based
on that information.
A human agent uses eyes, ears, and other organs to sense the environment
and hands, legs, mouth, and other body parts to act upon it.
A robotic agent might use cameras and infrared range finders to sense the
environment and motors to perform actions.
A software agent can receive inputs such as keystrokes, file contents, and
network packets and act on the environment by displaying information on
the screen, writing files, or sending network packets.
AI MId-1 14
How It Works: They use condition-action rules (if-then statements) to
determine actions. For instance, "if the sensor detects an obstacle, then
turn left."
How It Works: They use a model of the world to update their internal
state and use it, along with the current percept, to make decisions.
3. Goal-Based Agents:
4. Utility-Based Agents:
How It Works: They evaluate and compare the utility of different states
resulting from various actions, selecting the one that maximizes the
utility.
5. Learning Agents:
AI MId-1 15
Summary of Agent Types:
Simple Reflex Agents: Quick decisions based on current percepts; limited
to simple, static environments.
AI MId-1 16
Example: 8-queens problem
AI MId-1 17
4. Path cost: not applicable or Zero (because only the final state counts,
search cost might
be of interest).
Characteristics of AI Problems:
1. Clear Problem Definition:
State Space: All possible situations you can be in while solving the
problem.
Operators: Actions you can take to move from one state to another.
2. Solvability:
3. Complexity:
4. Optimality:
The solution should not just be any solution but the best one in terms of
cost, time, or resources used.
5. Uncertainty:
AI MId-1 18
results.
6. Partial Observability:
The agent might not have complete information about the current
situation or state, making it harder to make decisions.
7. Dynamic Environment:
The environment might change on its own, so the agent needs to adapt
to new information or situations.
The Towers of Hanoi problem involves moving a set of disks from one peg to
another, following specific rules.
Goal State: All disks are moved to the third peg in the same order.
2. Solvability:
AI MId-1 19
The problem is always solvable, as there is a known method to move
the disks correctly.
3. Complexity:
4. Optimality:
The best solution uses the minimum number of moves, which is \(2^n -
1\) for \(n\) disks.
5. Uncertainty:
6. Partial Observability:
The agent has complete information about the current state of the pegs
and disks at all times.
7. Dynamic Environment:
The environment does not change on its own; it only changes when the
agent makes a move.
Conclusion
The Towers of Hanoi problem can be considered an AI problem because it
involves a clear initial state, goal state, and operators, and it requires
systematic exploration and optimization to solve. It does not involve uncertainty
or partial observability, making it a straightforward example of an AI problem
that focuses on search and optimization.
AI MId-1 20
A* Algorithm is one of the best and popular techniques used for path
finding and graph traversals.
A lot of games and web-based maps use this algorithm for finding the
shortest path efficiently.
Working-
A* Algorithm works as-
g(n) is the cost of the path from start node to node ‘n’
h(n) is a heuristic function that estimates cost of the cheapest path from
node ‘n’ to the goal node
Algorithm-
The implementation of A* Algorithm involves maintaining two lists- OPEN
and CLOSED.
OPEN contains those nodes that have been evaluated by the heuristic
function but have not been expanded into successors yet.
example problem
Consider the following graph-
AI MId-1 21
The numbers written on edges represent the distance between the nodes.
The numbers written on nodes represent the heuristic value.
Find the most cost-effective path to reach from start state A to final state J
using A* Algorithm
Solution-
Step-01:
We start with node A.
f(B) = 6 + 8 = 14
f(F) = 3 + 6 = 9
AI MId-1 22
Step-02:
Node G and Node H can be reached from node F.
A* Algorithm calculates f(G) and f(H).
f(G) = (3+1) + 5 = 9
f(H) = (3+7) + 3 = 13
Path- A → F → G
Step-03:
Node I can be reached from node G.
Step-04:
Node E, Node H and Node J can be reached from node I.
A* Algorithm calculates f(E), f(H) and f(J).
f(E) = (3+1+3+5) + 3 = 15
f(H) = (3+1+3+2) + 3 = 12
f(J) = (3+1+3+3) + 0 = 10
AI MId-1 23
Important Note-
It is important to note that-
AI MId-1 24