Same as humanwe want to solve machine.
In 1960 , most of research is done for problem solving through Machine or
say Agent ,like , Tic tac toe , Water jug problem , chess , etc.
Machine or Agent , we are giving rules , same as we explain to friend.
Precise
Analyze
🧠 What does it mean to define an AI problem?
3.
A problem inAI is a task or situation where a computer or machine needs to
think, decide, or learn in order to solve something intelligently.
💡 Definition:
> A problem in AI is defined by:
> Inputs, 🎯 a goal, and 🧠 a way to reach that goal using logic, rules, or
👉
learning.
🧠An AI problem?
4.
🤖 Example ofa Problem in AI:
🎯 Problem: A self-driving car reaching a destination safely.
💡 Definition in action:
> Inputs:
👉
🚗 Current location
️🗺️Map data
🚦 Traffic signals
🚗 Nearby vehicles
☁️Weather conditions
🧠An AI problem?
5.
> 🎯 Goal:
Reachthe destination safely, quickly, and without breaking any traffic rules.
> 🧠 Way to reach the goal:
Use AI to analyze surroundings, make decisions (like when to stop or turn),
and learn from past drives to improve navigation.
🧠An AI problem?
6.
1. 🟢 InitialState – Starting point
2. 🎯 Goal State – What we want to achieve
3. 🚶 Actions – What can be done
4. 🔄 Transition Model – What happens when actions are taken
5. Path Cost (optional) – How much each step costs (used in optimization)
💰
🧩 AI Problem Components
7.
🏥 Diagnosing diseasesfrom symptoms
🌐 Translating languages (e.g., Google Translate)
🎬 Recommending movies (e.g., Netflix)
💳 Detecting banking fraud
🌍 Real-Life AI Problems
In Artificial Intelligence🤖, before solving a problem, we need to clearly define
it — just like we need to understand the rules before playing a game 🎲.
We define:
📍 Where we are (Initial State)
🎯 Where we want to go (Goal State)
⚙️What we can do (Possible Actions / Rules)
🧠 What does it mean to define an AI problem?
10.
🚖 Example 1:Taxi Booking App (AI finding the best route) 🚕
📍 Initial State: Your current location
🎯 Goal State: Your destination
⚙️Actions: Choose among different routes, avoid traffic, follow navigation rules
️🍽️Example 2: Cooking Assistant AI 🍳
📍 Initial State: Ingredients you have
🎯 Goal State: Desired dish (e.g., pasta)
⚙️Actions: Mix, boil, chop – in correct sequence
Defining AI Problems
11.
🧺 Example 3:Washing Clothes with AI Washing Machine 🧼
📍 Initial State: Dirty clothes in the basket
🎯 Goal State: Clean, dry clothes
⚙️Actions: Fill water, add detergent, wash, rinse, dry
Defining AI Problems
In AI, beforesolving any problem, we must clearly define what the problem is
and how to approach it — that’s where problem space and state space come
in.
Problem space and state space help AI understand:
"Where can I go, what can I do, and how do I get to my goal efficiently?"
🤔 Problem Space and State Space in AI?
14.
State Space =All possible situations (states) the system can be in while solving
the problem.
It includes:
The initial state
The goal state
All intermediate states you can reach by applying different actions
🧠 What is State Space?
15.
Problem Space =The combination of:
State Space +
All possible actions (rules or moves that change one state to another)
🎯 It defines the entire environment in which the AI must operate to reach a
goal.
🌐 What is Problem Space?
16.
Problem Space &State-Space Representation
📌 State-Space:
Representation of all states and paths
Like a map showing every possible move from start to goal
📌 Problem Space:
The complete set of possible situations (states)
Includes initial state, goal state, and all valid transitions
🤔 Problem Space and State Space in AI?
17.
You are helpingChintu the monkey find his way to a yummy Apple
🐵 🍎.
inside a tricky maze 🌀.
Example# 🎮 Imagine This Game
18.
You are helpingChintu the monkey find his way to a yummy Apple
🐵 🍎.
inside a tricky maze 🌀.
Example# 🎮 Imagine This Game
19.
You are helpingChintu the monkey find his way to a yummy Apple
🐵 🍎.
inside a tricky maze 🌀.
Example# 🎮 Imagine This Game
20.
🗺️1. State Space– Every Possible Place Chintu Can Be
📌 Definition:
It’s like the map of all paths, including correct and wrong ones.
State Space is the set of all possible "positions" or "situations" Chintu can be
in inside the maze.
👉 Every square (or cell) in the maze is a different “state”.
Example# 🎮 Imagine This Game
21.
🗺️1. State Space– Every Possible Place Chintu Can Be
🧩 In the Example:
(0,0) = Chintu's starting position
(1,0), (1,1), (2,1) = All different possible states
After each move, wherever Chintu can reach = included in the State Space
📌 Even wrong positions, dead ends, or loops — all of them are part of the
State Space
Example# 🎮 Imagine This Game
22.
🌍 2. ProblemSpace – The entire game
🧠 Problem Space = All rules + All possible moves + Goal + What happens at
each step
Problem Space is the entire world of the problem — where Chintu starts, the
directions he can move in, where the apple is placed, what the rules are, all
possible paths and decisions Chintu can make — all of this together is called
the Problem Space.
Example# 🎮 Imagine This Game
23.
🌍 2. ProblemSpace – The entire game
🎯 In the Example:
➡️Chintu the monkey is inside a maze 🌀
➡️He needs to reach the apple 🍎
➡️He can move Up , Down , Left , or Right
◀ ️ ▶ ️
➡️Sometimes he may take a wrong turn ❌
➡️There are also rules like: he can’t walk through walls
Example# 🎮 Imagine This Game
24.
📌 Problem Space
Fullmaze with all places and all possible paths Chintu can take 🐵
🗺️State-Space
A diagram or map showing each move and direction 🔄
🤔 Problem Space and State Space in AI?
25.
Imagine you're teachinga robot (AI) how to make a burger.
Problem space = Every action AI can take
State space = Every stage in burger-making
Goal = Perfect burger 🍔
🍔 Example: Making a Burger (AI as a cooking
assistant)
➡️These are allthe possible ways/actions the AI can take to move from one state to another.
Examples of actions:
🍖 Add patty
🧀 Add cheese
🍞 Toast the bun
🍅 Add sauce
️
🍽️Serve burger
So, problem space = all possible steps AI can use to reach the goal (a yummy burger! )
😋
🔸Problem Space 🍔🤖
28.
➡️These are allthe possible conditions or situations while making the burger. Think
of each stage of the burger as a different state.
🧱 Examples of States (Burger stages):
Just bun 🍞
Bun + patty 🍞🍖
Bun + patty + cheese 🍞🍖🧀
Bun + patty + cheese + sauce 🍞🍖🧀🍅
Final burger served 🍔
➡️These are different points in the process — each is a state.
So, the state space is the collection of all these possible burger stages.
🔸State Space
29.
If the robotchef doesn’t know:
🔁 All the steps (problem space), or
⏳ The current step it's on (state space),
… it may add cheese before the patty or serve a half-made burger! 😅
😅
State space = Every stage in burger-making
Problem space = Every action AI can take
Goal = Perfect burger 🍔
🧠 Why is it important in AI?
Search strategies helpan AI find the path from the starting point to the goal,
especially when the AI has many choices to make.
Imagine AI is playing a maze game 🧩, and it needs to find the quickest way
out.
Search strategies guide how it explores the maze.
🔍 What are Search Strategies?
32.
🧠 Two MainTypes of Search Strategies:
🔍 What are Search Strategies?
Uninformed Search (a.k.a. Blind Search)
Informed Search
> Given alist of cities and the distances between each pair, what is the
shortest possible route that:
️🏙️Visits each city exactly once, and
🔁 Returns to the starting city?
Travelling Salesman Problem (TSP)
35.
📍 Example:
A salesmanneeds to visit 5 cities:
Surat → Mumbai → Pune → Nashik → Ahmedabad → back to Surat
❓ The Goal:
✅ Visit each city once
🚗 Travel the least distance (or time/cost)
🏠 Return to the starting city
Travelling Salesman Problem (TSP)
36.
🧱 Uninformed Search(Brute Force)
Tries every possible route
For n cities, number of possible paths = (n − 1)!
👉 For 5 cities:
(5 − 1)! = 24 possible paths
✅ Guaranteed to find optimal solution
❌ But not scalable — what if 99 cities?
(99 − 1)! ≈ 9.33 × 10¹⁵⁵ 😵
(impossible to compute in reasonable time)
Travelling Salesman Problem (TSP)
37.
🎯 Informed Search(Heuristics)
Uses smart logic or heuristics
🔍 Doesn’t check every path
🚀 Much faster and more efficient
Example#
Nearest Neighbor
A* Search
Genetic Algorithms
Ant Colony Optimization 🐜
Travelling Salesman Problem (TSP)
38.
> AI hasno information about where the goal is.
> It just explores step by step — like searching in the dark 🔦.
📌 Features:
AI doesn’t know which direction is better
No Guidance
It just tries all possibilities
Slower, but still finds a solution (if one exists)
Uninformed Search (a.k.a. Blind Search)
39.
🎲 Examples:
✅ Breadth-FirstSearch (BFS)
🔁 Checks all paths level by level
➡️Good for finding the shortest path, but uses more memory
✅ Depth-First Search (DFS)
📦 Goes deep down one path until it hits a dead end
➡️Uses less memory but may get stuck in long or wrong paths
Uninformed Search (a.k.a. Blind Search)
40.
AI uses extrainformation or hints to guess which path is better ✨
It’s like AI is wearing glasses that highlight better paths.
👓
📌 Features:
Uses a heuristic (smart guess or estimate or “Anuman”) to guide the search
Usually faster and more efficient
Not guaranteed to be perfect — depends on how "smart" the heuristic is
Informed Search (a.k.a. Heuristic Search)
41.
🧠 Examples:
✅ GreedyBest-First Search
➡️Always picks the path that looks closest to the goal
🚀 Fast but not always correct
✅ A Search (A Star)
⭐ Combines:
Distance already traveled
Estimated distance to the goal
✅ Smart and usually finds the best path
Informed Search (a.k.a. Heuristic Search)
🧠 How BFSWorks:
1. Start from the root/start node
2. Visit all its immediate neighbours
3. Then go to next level of their neighbours
4. Keep repeating until goal is found or all nodes are visited
BFS
48.
🎯 Real-Life Example:
1.WhatsApp Forward Message 📲
You send a message → it goes to your friends → then to their friends → and
so on…
This is how BFS spreads! 🌍
BFS
49.
2. Social MediaFriend Suggestions
Starting from you, BFS checks all your direct friends (level 1)
Then their friends (level 2), and so on
✅ Helps Facebook, Instagram find "People You May Know"
3.. Google Maps – Shortest Route in Cities
If all roads have same weight (unweighted), BFS finds shortest path
✅ Best for simple traffic-free routing
🎯 Level-by-level road checks from starting point
BFS
50.
4. Web Crawlers
Searchengines like Google crawl the web page level by level
First links on page → then links inside those links
✅ Ensures complete and balanced search
BFS
51.
🧾 Key Features:
✅Guarantees shortest path in unweighted graphs
✅ Completeness: Will find solution if one exists
✅ Used in both trees and graphs
BFS
52.
💡 BFS UseCases:
📍 Shortest path in maps (like Google Maps 🚗)
🧩 Puzzle solvers (like 8-puzzle, word ladder)
🌐 Web Crawling
📊 Social networks – friend suggestion
BFS
🎨 Simple DFSTree Example:
A
/
B C
/ /
D E F G
DFS Order (one path): A → B → D → E → C → F → G
DFS
56.
`A → B→ C → D → E → F → G → H → I → J → K → L → M → N → O → P`
DFS
57.
🏠 Home (A)
│
──🚉
├ Station B
│ ──
├ ☕ Cafe D
│ │ ── 🧃
├ Juice H
│ │ │ └── 🧾 Bill N
│ │ └── 🧁 Bakery I
│ └── 🏪 Shop E
│ └── 🧸 Toy J
│ └── 🎁 Gift O
│
└── 🏢 Office C
── 🏥
├ Clinic F
│ └── 💊 Pharmacy K
└── 🎬 Theater G
── 🍿
├ Popcorn L
└── 🎮 Game M
└── 👓 VR Zone P
DFS
58.
A → B→ D → H → N → I → E → J → O → C → F → K → G → L → M → P
DFS
59.
🔍 Depth-First Search
🔁Strategy: Explore deep into one branch first, then backtrack
📦 Data Structure Used: `Stack (LIFO)` or Recursion
DFS
60.
🧠 How DFSWorks:
1. Start from the root/start node
2. Visit one child node deeply until no further move
3. Then backtrack and explore other branches
4. Continue until goal is found or all paths are explored
DFS
61.
🧾 Key Features:
✅Good for deep exploration
✅ Uses less memory than BFS
✅ Works on both trees and graphs
DFS
62.
⚠️Disadvantages:
❌ May notgive shortest path
❌ Can get stuck in infinite path (especially in cyclic graphs)
❌ Needs visited list to avoid revisiting
DFS
63.
🎯 Real-Life Example:
1.Maze Solver Game 🧩
You're inside a maze. You pick one path and go as far as possible.
If stuck, you come back and try another route.
DFS
64.
2. Maze Solving
Likea person in a maze goes deep in one direction
If dead-end, turns back and tries another path
✅ DFS explores deep possible path first
3. File System Traversal
Opening folders inside folders (deep nesting)
DFS goes till the last subfolder, then comes back
✅ Used in file explorers (Windows, Mac, Linux)
DFS
65.
4. Puzzle Solving(Sudoku, 8-Puzzle, etc.)
DFS explores one possible solution path fully
If it doesn’t work, it backtracks
✅ Useful in game trees or AI bots solving puzzles
DFS
66.
💡 DFS UseCases:
🧮 Topological Sorting
🔁 Cycle detection in graphs
🔐 Solving puzzles and mazes
🔍 Searching deep decision trees
DFS
🔍 Type: InformedSearch (Greedy)
🎯 Goal: Reach the peak (best solution) by always moving to a better state
📦 Strategy: Move in the direction where value keeps increasing
Hill Climbing Algorithm
71.
> Imagine you'replaying a game where you have to climb a hill in thick fog
️ 🌫️
> You can't see the whole hill — you can only see a few steps ahead of you.
🎯 Your goal: Keep climbing higher and higher until you can’t go up anymore!
♀️
️
♀️
♀️
♀️
♀️
♀️
♀️
♀️
♀️
♀️
♀️
♀️
♀️
♀️What is Hill Climbing Algorithm?
72.
1. You startsomewhere on the hill
️ 🏞️
2. You look at the paths right in front of you 👀
3. You always take the steepest upward step
4. If all steps go down or are flat you stop!
➡️
No turning back! No running around to find a better way. You just go up — if
possible.
🪜 How the Game Works:
73.
🧠 How HillClimbing Works:
1. Start from an initial state
2. Look at neighbouring states
3. Move to the one with higher (better) value
4. Repeat until no better neighbour found
⛔ No backtracking! It never looks back or tries multiple paths.
Hill Climbing Algorithm
74.
🧾 Key Features:
✅Simple and fast
✅ Requires less memory
✅ Works well with good heuristics
Hill Climbing Algorithm
75.
❌ Can getstuck at:
🧱 Local Maxima – a high point, but not the highest
➖ Plateau – flat region where all neighbours are same
🧩 Ridges – hard-to-reach higher points
⚠️Disadvantages:
76.
1. Local Maximum– “The Short Hill”
Example#
You climb a small hill and say, “Yay! I’m at the top!” 🥳
But actually, there's a much taller mountain behind you, which you can't see!
Why?
You didn’t look around far enough. You stopped too early.
📌 You found a "local maximum" – not the best top, just the closest one.
🌟 Real-Life Examples & Problems
77.
2. Plateau (FlatMaximum) – “The Flat Hilltop”
Example#
You reach a flat area where every direction is the same height 🤷
You keep walking but nothing goes up. You’re confused.
You might say:
> “I guess I’m at the top?” 🤔
📌 This is called a "plateau" — the algorithm gets stuck because everything
looks the same.
🌟 Real-Life Examples & Problems
78.
3. Ridge –“The Skinny Climb”
Example#
You’re on a narrow path that zigzags up the mountain 🌄
To keep going up, you may need to first go a little sideways.
But the algorithm only wants to go straight up it gets confused and misses
➡️
the right path.
📌 That’s the “ridge” problem — going straight doesn't always work, but the
algorithm doesn’t know better.
🌟 Real-Life Examples & Problems
79.
🎲 Why It’sNot Always Smart:
Hill climbing is greedy — it grabs the best step right now, without thinking
about the future.
✅ Good for quick decisions
❌ Not good for finding the best possible solution
🌟 Real-Life Examples & Problems
80.
🎯 Use Cases:
🤖AI Game Agents (e.g., Tic Tac Toe)
📈 Optimization Problems
🔍 Finding maximum value in functions
Hill Climbing Algorithm
81.
> Hill Climbingis like climbing with a flashlight 🔦 in fog.
> You only go up, but you can’t turn back or see far.
Hill Climbing Algorithm : 🧠 Trick to Remember
🔍 Type: InformedSearch
🧠 Heuristic = An educated guess to reach the goal faster
💡 Uses domain knowledge to guide the search path smartly!
Heuristic Search
84.
Imagine you're playinga treasure hunt game , and someone gives you hints
️ 🗺️
("Go where it feels warmer! 🔥" or "You're getting closer! 🧭").
These hints help you guess which path to try first — without checking every
single path.
A rule of thumb or shortcut
Helps avoid wasting time on bad paths
It doesn’t always guarantee the perfect solution, but it's often faster and good
enough!
🧠What is Heuristic Search
85.
🔁 How HeuristicSearch Works:
1. Start from the initial node
2. Use a function to evaluate which path seems closer to goal
3. Always pick the node that looks more promising
4. Continue until the goal is reached
Heuristic Search
86.
🔍 "Finding Candyin the House"
You want to find candy at home 🍬, but you're not sure where it is.
Now:
You don’t check every single place (like drawers, fridge, shoe rack, washing machine...)
Instead, you guess:
“Maybe it’s in the fridge?” ❄️
“Or the kitchen shelf?”
️ 🍽️
“Under the bed? Hmm, less likely…”
You’re using a heuristic — your experience and guesswork — to find the candy faster!
📦 Real life Analogy: Heuristic Search
87.
📊 Real-Life Example(Google Maps):
📍 You are in Srinagar, going to Pehlgam.
Google suggests the route via Expressway, not just by distance, but by
estimated time ️
⏱️
➡️That "fastest route suggestion" = Heuristic being used!
Heuristic Search
🧾 Key Features:
✅Much faster than uninformed search (like BFS/DFS)
✅ Can skip bad branches
✅ Uses less memory & time with right heuristics
Heuristic Search
90.
⚠️Disadvantages:
❌ Heuristic mustbe accurate and admissible
❌ Poor heuristics = misleading path or wrong answer
❌ Hard to design heuristics for all problems
Heuristic Search
91.
🎯 Use Cases:
🗺️Navigationapps (Google Maps, Uber routes)
♟️Game AI (Chess, Tic Tac Toe)
🧩 Puzzle solving (8-puzzle, Sudoku)
🧠 Decision-making in smart bots
Heuristic Search