AI 3
AI 3
3. Explain informed and uninformed search methods also Give difference between
Informed Search and Uninformed search Algorithms.
Ans: In Artificial Intelligence, search algorithms are used to find solutions or paths from a
start state to a goal state. These algorithms are broadly classified into Uninformed (Blind)
Search and Informed (Heuristic) Search based on the information they use during the search
process.
How It Works:
The agent observes the current state.
Takes an action based on the policy.
Receives a reward and the next state from the environment.
Updates its policy to improve future rewards.
Example:
In a game, the AI (agent) learns to play by receiving positive rewards for winning and
negative rewards for losing. Over time, it learns which moves lead to better outcomes.\
Real-World Applications:
Game playing (e.g., AlphaGo, Chess)
Robotics (autonomous walking or gripping)
Self-driving cars
Recommendation systems
Stock trading
6. Explain Hill Climbing Algorithm and problems that occurs in hill climbing algorithm?
Ans: Hill Climbing is a local search algorithm used in Artificial Intelligence to solve
optimization problems. It starts with an arbitrary solution and iteratively moves to a better
neighboring state based on a given evaluation function until no further improvements can
be found.
It is called "hill climbing" because the algorithm attempts to reach the peak (maximum) of
a solution landscape by moving step-by-step towards better solutions.
Steps of the Algorithm:
Start with an initial solution (state).
Evaluate all neighboring states.
Move to the neighbor with the highest value (i.e., better than the current).
Repeat steps 2–3 until no better neighbor is found.
Plateau:
A flat area where neighboring states have equal values.
The algorithm may wander or stop due to lack of improvement.
Ridges:
Narrow paths with higher values not directly accessible from current state.
Hill climbing may fail because it only moves in one direction at a time.
Greedy Nature:
The algorithm only considers immediate gains, not long-term benefits.
It doesn’t backtrack or explore enough to escape poor areas.
7. Applications of AI in Robotics
Ans:
Autonomous Navigation:
AI enables robots to move and navigate without human intervention using sensors, GPS,
and SLAM (Simultaneous Localization and Mapping).
Used in self-driving cars, delivery robots, and drones.
Path Planning:
AI helps robots plan optimal paths by avoiding obstacles and choosing efficient routes.
Used in warehouse robots and robotic vacuum cleaners.
Key Characteristics:
Start with an initial solution (state).
Move to a neighbor state based on a defined rule or evaluation.
Continue until a solution is found or a stopping condition is met.
Example:
Suppose a card is drawn from a deck.
Let:
A = Event that the card is a king
B = Event that the card is a face card (Jack, Queen, King)
There are 12 face cards and 4 kings in a deck.
So,
This means: If a face card is drawn, the probability it is a king is 1/3
1. Supervised Learning:
Definition:
Supervised learning is a type of machine learning where the model is trained on a labeled
dataset, meaning each input has a corresponding correct output.
How it works:
The algorithm learns from input-output pairs.
It maps input data (X) to the correct output (Y).
It uses this training data to predict outputs for new, unseen inputs.
Examples:
Spam detection (email → spam or not spam)
House price prediction
Image classification (e.g., cat vs. dog)
Algorithms Used:
Linear Regression
Decision Trees
Support Vector Machines
Neural Networks
2. Unsupervised Learning:
Definition:
Unsupervised learning is a type of machine learning where the model is trained on
unlabeled data. It tries to find hidden patterns or structures in the input data.
How it works:
There are no output labels.
The algorithm groups or organizes data based on similarity or structure.
Examples:
Customer segmentation
Market basket analysis
Document or image clustering
Algorithms Used:
K-Means Clustering
Hierarchical Clustering
Principal Component Analysis (PCA)
11. Generate parse tree for “The cat ate the fish”
Ans: A parse tree (or syntax tree) is a tree representation that shows the syntactic structure
of a sentence according to a given grammar, usually a Context-Free Grammar (CFG).
The sentence:
“The cat ate the fish”
is a simple declarative sentence following the Subject-Verb-Object (SVO) pattern.
Step-by-Step Structure:
S → Sentence
NP → Noun Phrase (The cat)
VP → Verb Phrase (ate the fish)
Det → Determiner
N → Noun
V → Verb
Parse Tree:
Explanation:
The sentence starts with S (Sentence).
The Noun Phrase (NP) is "The cat":
Det: The
N: cat
The Verb Phrase (VP) is "ate the fish":
V: ate
NP: "the fish"
Det: the
N: fish
12. What is Game Playing Algorithm? Draw a game tree for Tic-Tac-Toe problem
Ans: A Game Playing Algorithm in Artificial Intelligence refers to a method used by
computers to make optimal decisions in strategic situations, particularly in two-player
games such as chess, tic-tac-toe, or checkers. These algorithms enable machines to simulate
possible moves and determine the best course of action to win or avoid losing the game.
Key Features:
Adversarial Search – Involves two opponents; one tries to maximize score, the other to
minimize it.
Game Tree – Represents all possible moves as a tree of game states.
Minimax Algorithm – Chooses the move that maximizes the player's minimum gain.
Alpha-Beta Pruning – Optimizes Minimax by cutting off unneeded branches.
Evaluation Function – Estimates the value of non-terminal states using heuristics.
Example:
In tic-tac-toe, the algorithm evaluates each possible move and predicts the outcome. If it
detects that a move leads to a win or blocks the opponent from winning, it selects that move.
Applications:
Board games (e.g., Chess, Go, Checkers)
Strategy-based video games
AI bots in gaming applications