Artificial Intelligence Third Semester University Exam Paper Solution
Artificial Intelligence Third Semester University Exam Paper Solution
Chess:
PEAS Examples:
Plan Automation: AI agents follow structured plans based on predefined rules or adaptive
learning to handle tasks dynamically in complex environments.
2. (a) Define artificial intelligence. Mention its areas of application. Compare
between human and computer intelligence.
Areas of Application:
(b) Discuss the primary steps in problem solving with Al. Elaborate with an example.
Example:
In a maze-solving robot:
Turing Test:
Proposed by Alan Turing in 1950, the Turing Test evaluates a machine's ability to exhibit
human-like intelligence. A human evaluator interacts with a machine and a human through
text-based communication. If the evaluator cannot reliably distinguish between the two, the
machine is said to have passed the test.
(b) Define the following Agent, Agent function, Agent program rationality and Reflex
agent.
Agent: An agent is an entity that perceives its environment through sensors and acts upon it
using actuators to achieve a goal.
Agent Function: It maps percept sequences (inputs from sensors) to actions, defining the
behavior of the agent in response to its environment.
Agent Program: The implementation of the agent function as code or algorithms that dictate
how an agent processes inputs and determines actions.
Rationality: A rational agent performs actions that maximize its performance measure based
on its knowledge and percept history.
Reflex Agent: A simple agent that selects actions solely based on the current percept, without
considering history or future implications.
4. (a) Compare and contrast breadth first search strategy with depth first search
strategy. Suggest some applications to which each is best suited.
Comparison:
Applications:
Algorithm:
Challenges:
1. Local Maximum: A peak lower than the global maximum. The algorithm stops
prematurely.
2. Plateau: A flat region where all neighbors have equal value, causing stagnation.
3. Ridges: Narrow pathways to higher peaks that require multiple steps in a specific
direction, which hill climbing cannot handle efficiently.
Advantages:
Overcoming Challenges:
Random Restarts: Restart the algorithm from random points to escape local maxima.
Simulated Annealing: Allow occasional moves to worse states to explore a broader
search space.
Stochastic Hill Climbing: Randomly choose among uphill moves instead of the
steepest one.
Applications:
Hill climbing is effective in optimization problems like job scheduling, route planning, and
function optimization where global search techniques are infeasible.
By refining its implementation and combining it with other methods, the limitations can be
mitigated, making it a practical approach for various scenarios.
6. (a) What is passing? Explain the various parsing techniques in brief?
Passing refers to the process of analyzing a string of symbols (typically source code) to
determine its grammatical structure according to a formal grammar. Parsing is essential in
compilers and interpreters to understand code syntax.
Parsing techniques:
1. Top-down Parsing: Starts from the root and tries to derive the string. Examples:
Recursive descent, LL parsing.
2. Bottom-up Parsing: Begins from the leaves (input symbols) and reduces them to the
start symbol. Examples: LR parsing, SLR.
3. LL Parsing: Left-to-right scan, left-most derivation.
4. LR Parsing: Left-to-right scan, right-most derivation.
Write the basic syntac c elements used in first order logic. Explain the quan fiers
used in first order logic by giving example explain nested quan fiers.
Differen ate between proposi onal logic and predicate logic. Represent the
following statements in logic:
First-order Predicate Logic (FOL) is an extension of propositional logic that allows for
more expressive reasoning about objects and their relationships. It deals with predicates,
quantifiers, and variables to express complex statements about individuals and their
properties. FOL is foundational for computer science, artificial intelligence, and formal
reasoning systems. It can represent statements like "All humans are mortal" or "There exists a
person who is taller than John."
Human Expert:
o Experience-based: Relies on years of experience and intuition.
o Flexible: Can handle ambiguous situations and adapt to new information.
o Emotional intelligence: Capable of understanding the emotional and
psychological aspects of a problem.
Artificial Expert System:
o Knowledge-based: Relies on explicitly defined rules and data.
o Consistency: Performs consistently without fatigue or emotional bias.
o Limited flexibility: Can only handle situations within its programmed
knowledge base and defined rules.
The operations of an expert system can be explained with the following block diagram:
1. Knowledge Base: Stores domain-specific knowledge in the form of rules, facts, and
relationships.
2. Inference Engine: Processes the knowledge base and applies logical reasoning to
draw conclusions or make decisions based on user input.
3. User Interface: Allows users to interact with the system, providing data and
receiving output.
4. Knowledge Acquisition: Mechanism for adding or updating knowledge in the
system.
5. Explanation System: Provides a rationale for the system’s conclusions or
recommendations.
Maintainability: Changes to the knowledge base can be made without altering the
control structure.
Scalability: New knowledge can be added without modifying the overall system
architecture.
Flexibility: The system can be easily updated, and different knowledge bases can be
plugged into the same control module.
Modularity: Easier to manage and test components separately.
Advantages of Expert Systems
1. Limited Knowledge Scope: Restricted to the domain defined in the knowledge base.
2. No Intuition: Cannot mimic human intuition or emotional intelligence.
3. Complexity in Knowledge Acquisition: Gathering and codifying knowledge from
human experts can be time-consuming and difficult.
4. High Initial Cost: Developing an expert system requires significant resources for
knowledge base creation and system development.
9. (a) Why is game playing defined as search problem? Illustrate minimax search
procedure with example. Also write its limitation.
Game playing is considered a search problem because, in a game, the objective is to explore
different possible moves (states) from a given position, considering future outcomes, until an
optimal decision is found. Each possible move represents a state, and each subsequent set of
moves forms a tree of possibilities, which can be searched using various algorithms to
determine the best course of action. The goal is to find the most optimal path (winning
strategy) given the rules of the game.
Steps in Minimax:
1. Generate the Game Tree: List all possible moves from the current state.
2. Assign values to terminal nodes (leaf nodes) based on the outcome of the game (win,
lose, or draw).
3. Backpropagate values: Starting from the terminal nodes, backpropagate values up
the tree. At each level, if it's the maximizing player's turn, take the maximum value; if
it's the minimizing player's turn, take the minimum value.
4. Choose the optimal move: The root node's value determines the best move for the
current player.
Example:
For a simple game tree, consider a tree where the maximizing player aims for the highest
value (e.g., a win), and the minimizing player aims for the lowest value (e.g., a loss). After
evaluating the leaves and propagating values, the algorithm will choose the move with the
optimal value for the maximizing player.
1. Exponential Time Complexity: The search space grows exponentially with the depth
of the game tree, making it computationally expensive for large games.
2. No Handling of Uncertainty: Assumes both players will play optimally, which may
not always be true in real-world scenarios.
3. Not Ideal for Complex Games: In games with large state spaces (e.g., chess), the
minimax algorithm becomes impractical without optimization techniques like pruning
(alpha-beta pruning).
In the Water Jug Problem, the goal is to measure a specific amount of water using two jugs
with different capacities. The problem involves finding a sequence of actions (fill, empty,
pour) that leads to the desired amount of water in one jug.
Characteristics:
1. State Space: The state is represented by the amount of water in each jug (e.g., (x, y),
where x and y are the water amounts in the two jugs). The state space is relatively
small but can increase with larger jug capacities.
2. Initial State: Both jugs are initially empty or filled to a known quantity.
3. Goal State: The goal is to reach a specific amount of water in one of the jugs.
4. Operators: The operators include filling the jugs, emptying them, and pouring water
from one jug to the other.
5. Search Type: It is an example of a problem with well-defined operators, typically
solved using uninformed search algorithms (e.g., breadth-first search).
6. Solution Path: The path to the solution involves a series of logical moves based on
mathematical reasoning.
In the 8-Tile Puzzle, the objective is to arrange the tiles from a scrambled configuration to a
goal state by sliding them into adjacent empty spaces.
Characteristics:
1. State Space: The state is represented by the arrangement of the tiles in a 3x3 grid.
There are 9! (362,880) possible states.
2. Initial State: The tiles are in a scrambled order, and the empty space is located
somewhere in the grid.
3. Goal State: The tiles are arranged in a specific order, usually with the numbers in
sequence and the empty space in the bottom-right corner.
4. Operators: The operators are sliding a tile into the adjacent empty space, which
depends on the position of the empty space.
5. Search Type: The problem requires informed search algorithms (like A* with a
heuristic), as the search space is large and requires guidance to find the most efficient
solution.
6. Solution Path: The solution is a sequence of moves that transforms the initial
scrambled configuration into the goal configuration.