0% found this document useful (0 votes)
17 views

AI QB Answer Key

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

AI QB Answer Key

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

AI Assignment 1

1. What are the PEAS descriptors? Give peas descriptor for robot maid
cleaning the house.
Ans.
We know that there are different types of agents in AI.
PEAS System is used to categorize similar agents together.
The PEAS system delivers the performance measure with respect to the environment,
actuators and sensors of the respective agent.
Most of the highest performing agents are Rational Agents.
The PEAS framework helps in systematically analyzing and defining the key elements of
an AI problem, which is essential for designing and developing effective AI systems.
PEAS stands for Performance measure, Environment, Actuator, Sensor.
Performance Measure: It is the objective function to judge the performance of the agent.
Things we can evaluate against agent to know how well it performs. Environment: It the
real environment where the agent needs to deliberate actions. what the agent can perceive.
Actuator: These are the tools, equipment or organs using which agent performs actions in
the environment. This works as output of the agent. what an agent can use to act in its
environment.
Sensor: These are tools, organs using which agent captures the state of the environment.
This works as input to the agent.

Performance Measure: Efficiency in cleaning


Time taken
Coverage of areas
Percentage of dirt and debris
removed from rooms
Environment: Residential indoor spaces
various room layouts
Actuator: Motorized wheels
robotic arms
vacuum suction
brushes
Sensor: Cameras
ultrasonic sensors,
proximity sensors
dirt detectors
2. What are the PEAS descriptors? Give peas descriptor for Wumpus
world Problem.
Ans:
We know that there are different types of agents in AI.
PEAS System is used to categorize similar agents together.
The PEAS system delivers the performance measure with respect to the environment,
actuators and sensors of the respective agent.
Most of the highest performing agents are Rational Agents.
The PEAS framework helps in systematically analyzing and defining the key elements of
an AI problem, which is essential for designing and developing effective AI systems.
PEAS stands for Performance measure, Environment, Actuator, Sensor.
Performance Measure: It is the objective function to judge the performance of the agent.
Things we can evaluate against agent to know how well it performs. Environment: It the
real environment where the agent needs to deliberate actions. what the agent can perceive.
Actuator: These are the tools, equipment or organs using which agent performs actions in
the environment. This works as output of the agent. what an agent can use to act in its
environment.
Sensor: These are tools, organs using which agent captures the state of the environment.
This works as input to the agent.

Performance Measure: Number of gold collected


safety (avoiding pits and wumpus)
Environment: Grid-based world with pits,
Wumpus Gold
obstacles

Actuator: Movement (up, down, left, right),


shooting arrows
Sensor: Perceptions of adjacent squares (stench,
breeze, glitter)

3. Define Intelligent Agent. What are the characteristics of Intelligent


Agent
Ans.
An agent is anything that can be viewed as perceiving its environment through sensors
and acting upon that environment through actuators.
An intelligent agent in the context of artificial intelligence (AI) refers to a software or
hardware entity that perceives its environment, processes information, and takes actions
to achieve specific goals. Intelligent agents are designed to exhibit autonomous behavior,
decision-making capabilities, and the ability to adapt and learn from their experiences.

Characteristics of Agent

• Situatedness
The agent receives some form of sensory input from its environment, and it performs
some action that changes its environment in some way.

• Autonomy
The agent can act without direct intervention by humans or other agents and that it has
control over its own actions and internal state.

• Adaptivity
The agent is capable of (1) reacting flexibly to changes in its environment; (2) taking
goal-directed initiative (i.e., is pro-active), when appropriate; and (3) learning from its
own experience, its environment, and interactions with others.
• Sociability
The agent is capable of interacting in a peer-to-peer manner with other agents or humans.
4. What are the applications of AI and explain the significance of Turing
Test.
Ans.
Applications:
• Game playing: IBM developed chess playing computer called “DEEP BLUE” which
defeated world champion Gary Kasparav in 1997.
• Autonomous planning and scheduling: NASA developed” Remote Agent Program” to
control the scheduling of operation for a spacecraft .Remote Agent Program monitored
operation of spaceship and provided information to NASA.
• Autonomous Control: The ALVINN computer vision system was trained to drive a car,
this system was fitted in minivan fitted with video camera which transmit road images
and depending on images best direction to drive was selected. (Example: TESLA
autopilot system)
• Diagnosis: Medical diagnosis program used symptom analysis to predict disease and
gave result equivalent to expert physician. Example:MYCIN
• ROBOTICS: Many surgeon use Robot called HipNav to do microsurgery
• Logistics Planning: US forces developed a Dynamic Analysis and Replanning Tool to do
automatic logistic planning and scheduling for transportation. This tool allowed plan to be
generated in hours on providing start point and end destination.

Significance of turing test

Turing defined intelligent behaviour as the ability by machine to achieve human-level performance in all
decision making tasks and person must not know that he is getting reply from human or machine .

Allen Turing proposed a test in which computer is interrogated by a human via a teletype, and passes the test
if the interrogator(human) cannot tell if there is a computer or a human at the other end.Most of AI machine
is expected to pass this test.It’s significant because it spurred discussions about artificial intelligence and
consciousness, raising questions about the nature of intelligence, language, and whether machines can truly
think,it implies a level of AI sophistication.
5. Draw and describe architecture of Utility based agent. ANS.
• These agents are similar to the goal-based agent but provide an extra component of
utility measurement which makes them different by providing a measure of success
at a given state.
• Utility-based agent act based not only goals but also the best way to achieve the
goal.
• The Utility-based agent is useful when there are multiple possible alternatives, and
an agent has to choose in order to perform the best action.
• The utility function maps each state to a real number to check how efficiently each
action achieves the goals.
• Goals alone are not enough to generate high-quality behavior in most environments.
• For example, many action sequences will get the taxi to its destination (thereby
achieving the goal) but some are quicker, safer, more reliable, or cheaper than
others.
• when there are conflicting goals,only some of which can be achieved (for example,
speed and safety),
• The utility function specifies the appropriate tradeoff or the most important goal
• they choose the action based on a preference (utility)for each state.


Advantages:
1. Rational Decision Making: Utility-based agents make decisions based on
quantifiable criteria, ensuring a rational approach to choices.
2. Flexibility: They can accommodate various goals and preferences by assigning
appropriate utility values.
3. Complex Trade-offs: These agents can handle situations where decisions
involve trade-offs between conflicting objectives.
4. Consistency: Utility-based agents tend to make consistent decisions, adhering
to their assigned utility values.

Disadvantages:
1. Utility Estimation: Assigning accurate utility values can be challenging and
subjective, requiring knowledge of individual preferences.
2. Complexity: As the number of options and criteria increases, calculating utility
becomes more complex and computationally intensive.
3. Context Dependency: Utility values might change based on the context,
making it difficult to capture all nuances accurately.
4. Uncertainty: In situations with incomplete information, determining accurate
utility values can be uncertain, leading to suboptimal decisions.

6. Give initial state, goal test,successor function and cost function for N
queen problems.
ANS. The n queens problem aim is to place n×n queens on a chessboard in an order where no
queen may attack another.

A queen can attack other queens either diagonally or in same row and column.
1. Initial State: An empty chessboard
2. Goal Test: Checks whether 8-queens are placed on the chessboard without any
attack.
3. Successor Function: The successor function generates valid successor states by
moving one queen to another square in its own column. The new state must also
satisfy the constraint of no two queens threatening each other.
4. Cost Function: In the context of the N-Queens problem, the cost function can
be defined as the number of pairs of queens that threaten each other on the board.
The goal is to minimize this cost function to reach a solution.
7. Explain 4 views of AI.
ANS.
Systems that think like humans:

Most of the time it is a black box where we are not clear about our thought process.

One has to know functioning of brain and its mechanism for possessing information.

It is an area of cognitive science.

Cognitive processes manipulate representation to build new representations that are used to generate actions.

Neural network is a computing model for processing information similar to brain.

An example could be an AI system that learns to play a complex game like chess by analyzing past games and
strategizing like a human player would.

Systems that act like humans:


The overall behaviour of the system should be human like.

It could be achieved by observation.(Turing Test)

For example, a chatbot that engages in natural conversations, responds with emotions, and uses humor to
mimic human interaction.

Systems that think rationally:

Such systems rely on logic rather than human to measure correctness.

For thinking rationally or logically, logic formulas and theories are used for synthesizing outcomes.

For example,

given John is a human and all humans are mortal then one can conclude logically that John is mortal

Systems that act rationally:

Rational behavior means doing right thing(Rationally).

Even if method is illogical, the observed behavior must be rational.

An example could be an AI system designed to solve complex mathematical proofs or provide legal advice by
analyzing vast amounts of legal information and making rational conclusions.

8. Explain any 5 types of environmnts for an Agent.


ANS.
Fully Observable vs. Partially Observable: In a fully observable environment, the
agent has access to complete and accurate information about the current state of the
environment at all times. In contrast, a partially observable environment provides the
agent with incomplete or uncertain information about the state. Agents operating in
partially observable environments need to make decisions based on incomplete
information and often require sophisticated sensing or perception mechanisms.

For example, a vacuum agent with only a local dirt sensor cannot tell whether there is dirt in
other squares, and an automated taxi cannot see what other drivers are thinking.
Episodic vs. Sequential: In an episodic environment, each interaction or episode with the
environment is independent of previous episodes. The agent's actions do not have a
lasting impact on future interactions. In a sequential environment, actions taken by the
agent have consequences that affect future interactions. Sequential environments often
involve planning and decision-making over a series of steps.

Static vs. Dynamic: A static environment does not change while the agent is
deliberating. The state remains constant until the agent takes an action. In a dynamic
environment, the state of the environment can change even if the agent does not take
any action. Agents operating in dynamic environments need to continuously adapt to
changing conditions.
Eg. Taxi driving is clearly dynamic: the other cars and the taxi itself keep moving
Crossword puzzles are static

Discrete vs. Continuous: A discrete environment has a finite and distinct set of states
and actions. Agents in such environments deal with well-defined choices and transitions.
In a continuous environment, both states and actions are represented by continuous
values, often requiring agents to use techniques from calculus and optimization.
For example, the chess environment has a finite number of distinct states.

Taxi driving is a continuous-state and continuous-time problem: the speed and location of the
taxi and of the other vehicles sweep through a range of continuous values.
Single-Agent vs. Multi-Agent: In a single-agent environment, there is only one
autonomous agent interacting with the environment. In a multi-agent environment, there
are multiple autonomous agents interacting with each other and the environment. Multi-
agent environments introduce complexities such as coordination, competition, and
negotiation.
For example

Chess is a competitive multiagent environment.

Carom is multiagent.

9. For crossword puzzle and taxi driving task explain different types of
environment like Observable (Fully/Partially), Single/Multi
agent,Deterministic ,Sequential, Static,Discrete.
ANS. Crossword Puzzle:

Observable: Crossword puzzles are typically fully observable. The entire state of the
puzzle, including the positions and orientations of the letters, is known to the solver.

Single Agent: The crossword puzzle is solved by a single agent, the person attempting to
fill in the words.

Deterministic: The crossword puzzle itself is deterministic. The relationships between


words, the structure of the grid, and the clues are fixed and do not change.

Sequential: Solving a crossword puzzle is a sequential task. The solver fills in words one
at a time, and the order in which they are filled can impact the ability to complete the
puzzle.

Static: The puzzle remains static while the solver is working on it. The puzzle's state does
not change unless the solver modifies it.

Discrete: The crossword puzzle involves discrete elements, such as the grid cells and the
words to be filled in. The solver's actions are discrete and involve placing individual
letters in specific grid cells.

Taxi Driving Task:

Observable: The taxi driving task can be either partially observable or fully observable,
depending on the scenario. If the taxi has sensors providing real-time information about
its surroundings (e.g., GPS, cameras), it could operate in a fully observable environment.
If it lacks complete information (e.g., poor visibility, obscured obstacles), it would be
partially observable.

Single/Multi Agent: In most cases, the taxi driving task involves a single agent, which is
the taxi itself. However, in complex traffic scenarios, multiple agents (other vehicles,
pedestrians) may be present, leading to a multi-agent environment.

Deterministic/Stochastic: The taxi driving task is often stochastic due to factors like
traffic conditions, unpredictable pedestrian behavior, and weather. While some aspects of
the environment may be deterministic (e.g., traffic rules), the overall outcome of actions
is subject to uncertainty.

Sequential: Taxi driving is a sequential task, where the taxi must make a series of
decisions and actions over time to reach its destination or complete other objectives.

Dynamic: The taxi driving environment is dynamic as it involves interactions with other
moving agents (e.g., other vehicles, pedestrians) and changing road conditions. The
environment can change even if the taxi does not take any action.

Continuous/Discrete: The taxi's motion and position are continuous variables, as it can
move smoothly within a range of positions. However, discrete elements come into play
when considering discrete actions (turn left, turn right, accelerate, brake) and discretized
representations of the environment (grid-based maps or lane divisions).

10.Explain Hill Climbing. What are the problems that occur in Hill climbing
algorithm. Explain with solution.
ANS. Hill climbing algorithm is a local search algorithm which
continuously moves in the direction of increasing elevation/value to find
the peak of the mountain or best solution to the problem.
It terminates when it reaches a peak value where no neighbor has a higher value.
Hill climbing algorithm is a technique which is used for optimizing the mathematical
problems. It is also called greedy local search as it only looks to its good immediate
neighbor state and not beyond that.It Will stop if it doesn’t get best solution.

Problems in Hill Climbing Algorithm:


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.

Global maximum

Plateau: A plateau is the flat area of the search space in which all the neighbor states of the
current state contains the same value, because of this algorithm does not find any best
direction to move. A hill-climbing search might be lost in the plateau area.
Solution: The solution for the plateau is to take big steps or very little steps while
searching, to solve the problem. Randomly select a state which is far away from the current
state so it is possible that the algorithm could find non-plateau region.

2. Ridges: A ridge is a special form of the local maximum. It has an area which is higher
than its surrounding areas, but itself has a slope, and cannot be reached in a single
move.
Solution: With the use of bidirectional search, or by moving in different directions, we can
improve this problem.

11. Define the terms chromosome, fitness function, mutation,


crossover in genetic algorithm.
Ans.
Chromosome: In a Genetic Algorithm, a chromosome represents a potential
solution to the optimization problem. It is encoded as a string of genes, where
each gene typically represents a variable or a component of the solution. The
chromosome structure and gene encoding depend on the specific problem being
solved.

• Fitness Function: The fitness function determines how fit an individual is (the
ability of an individual to compete with other individuals).
• It gives a fitness score to each individual.
• The probability that an individual will be selected for reproduction is based on its
fitness score.

Mutation: The mutation operator inserts random genes in the offspring (new
child) to maintain the diversity in the population. It can be done by flipping some
bits in the chromosomes.
Random change in DNA.
It can be beneficial , neutral or harmful for organism.

Crossover (Recombination): The genes of parents are exchanged among


themselves until the crossover point is met. These newly generated offspring are
added to the population. This process is called as crossover.

12. Explain Genetic algorithm with flowchart.


ans.
1. Initial Population:
The process begins with a set of individuals which is called a Population. An individual is characterized by a set of
parameters (variables) known as Genes. Genes are joined into a string to form a Chromosome (solution).
In a genetic algorithm, the set of genes of an individual is represented using a string, in terms of an alphabet. Usually,
binary values are used (string of 1s and 0s). We say that we encode the genes in a chromosome.

2. Fitness Function:
The fitness function determines how fit an individual is (the ability of an individual to compete with other individuals).

It gives a fitness score to each individual.

The probability that an individual will be selected for reproduction is based on its fitness score.

3. Selection:
The main idea of selection phase is to select the fittest individuals and let them pass their genes to the next
generation.
Two pairs of individuals (parents) are selected based on their fitness scores.

4. Crossover:
The genes of parents are exchanged among themselves until the crossover point is met. These newly generated
offspring are added to the population. This process is called as crossover.

5. Mutation:
The mutation operator inserts random genes in the offspring (new child) to maintain the diversity in the population. It
can be done by flipping some bits in the chromosomes.
Random change in DNA.
It can be beneficial , neutral or harmful for organism.

6.Termination:
The algorithm terminates if the population has converged (produce offspring which are significantly different from the
previous generation).
Then it is said that the genetic algorithm has provided a set of solutions to our problem.
Common terminating conditions are:
A solution is found that satisfies minimum criteria
Fixed number of generations reached
Allocated budget (computation time/money) reached
The highest ranking solution’s fitness is reaching or has reached a plateau such that successive iterations no longer
produce better results
Manual inspection

Pseudocode

START
Generate the initial population
Compute fitness
REPEAT
Selection
Crossover
Mutation
Compute fitness
UNTIL population has converged
STOP

13. Explain A* algorithm with example.


Ans.
A* is formulated with weighted graphs, which means it can find the best path involving
the smallest cost in terms of distance and time. This makes A* algorithm in artificial
intelligence an informed search algorithm for best-first search.

A* algorithm works based on heuristic methods and this helps achieve optimality. A* is a
different form of the best-first algorithm.
When A* enters into a problem, firstly it calculates the cost to travel to the neighbouring
nodes and chooses the node with the lowest cost.
If The f(n) denotes the cost, A* chooses the node with the lowest f(n) value. Here ‘n’
denotes the neighbouring nodes. The calculation of the value can be done as shown
below: f(n)=g(n)+h(n) g(n) = shows the shortest path’s value from the starting node to
node n
h(n) = The heuristic approximation of the value of the node
EXAMPLE:
Let’s start with node A.Since A is a starting node, therefore, the value of g(x) for
A is zero and from the graph, we get the heuristic value of A is 11, therefore
● g(x) + h(x) = f(x)
● 0+ 11 =11
● Thus for A, we can write
● A=11
Now from A, we can go to point B or point E, so we compute f(x) for each of them
● A→B=2+6=8
● A→E=3+6=9
Since the cost for A → B is less, we move forward with this path and compute the
f(x) for the children nodes of B
Since there is no path between C and G, the heuristic cost is set infinity or a very
high value
A → E → D = (3 + 6) + 1 = 10
Comparing the cost of A → E → D with all the paths we got so far and as this cost is
least of all we move forward with this path. And compute the f(x) for the children of
D
A → E → D → G = (3 + 6 + 1) +0 =10
Now comparing all the paths that lead us to the goal, we conclude that A → E → D
→ G is the most cost-effective path to get from A to G.

14. Compare Breadth First Search and Depth first search

BFS DFS

Full form BFS stands for Breadth First Search. DFS stands for Depth First
Technique It a vertex-based technique to find the shortest It is an edge-based techni
path in a graph. along the edge are explore
the end node.
Definition BFS is a traversal technique in which all the nodes DFS is also a traversal tech
of the same level are explored first, and then we started from the root node
move to the next level. far as possible until we re
unvisited adjacent nodes.

Data Structure Queue data structure is used for the BFS traversal. Stack data structure is used

Backtracking BFS does not use the backtracking concept. DFS uses backtracking to
nodes.
Number of edges BFS finds the shortest path having a minimum In DFS, a greater number
number of edges to traverse from the source to the traverse from the source
destination vertex. vertex.
Optimality BFS traversal is optimal for those vertices which DFS traversal is optimal f
are to be searched closer to the source vertex. solutions are away from th

Speed BFS is slower than DFS. DFS is faster than BFS.


Suitability for It is not suitable for the decision tree because it It is suitable for the dec
decision tree requires exploring all the neighboring nodes first. decision, it explores all th
found, it stops its traversal
Memory efficient It is not memory efficient as it requires more It is memory efficient as it r
memory than DFS. BFS.

15. Compare Depth limited search and Iterative deepening depth


first search w.r.t. to performance measure.

You might also like