Sei sulla pagina 1di 14

1) Define Artificial intelligence and write its applications(3 marks)

Definition (1 mark)
According to the father of Artificial Intelligence, John McCarthy, it is “The science and
engineering of making intelligent machines, especially intelligent computer programs”.
Artificial Intelligence is a way of making a computer, a computer-controlled robot, or a software
think intelligently, in the similar manner the intelligent humans think.

Applications of AI (2 marks)

AI has been dominant in various fields such as −


 Gaming − AI plays crucial role in strategic games such as chess, poker, tic-tac-toe, etc., where
machine can think of large number of possible positions based on heuristic knowledge.
 Natural Language Processing − It is possible to interact with the computer that understands
natural language spoken by humans.
 Expert Systems − There are some applications which integrate machine, software, and special
information to impart reasoning and advising.
 Vision Systems − these systems understand, interpret, and comprehend visual input on the
computer. For example, A spying airplane, Medical Diagnosis, Forensics
 Speech Recognition − Some intelligent systems are capable of hearing and comprehending the
language in terms of sentences and their meanings while a human talks to it.
 Handwriting Recognition − the handwriting recognition software reads the text written on paper
by a pen or on screen by a stylus. It can recognize the shapes of the letters and convert it into
editable text.
 Intelligent Robots − Robots are able to perform the tasks given by a human. They have sensors
to detect physical data from the real world such as light, heat, temperature, movement, sound,
bump, and pressure.

2) Define PEAS for an Automated taxi(3 marks)

PEAS (1 mark)

PEAS stand for Performance Measures, Environment, Actuators, and Sensors.

Performance Measure: The objective function to judge the performance of the gent. Environment:
The real environment where the agent need to deliberate actions.

Actuators: These are the tools, equipment or organs using which agent perform actions in the
environment.

Sensors: These are tools, organs using which agent captures the state of the environment.

PEAS for an Automated Car taxi Driver (2 marks)

Performance Measure:
Safety: Automated system should be able to drive the car safely without dashing anywhere.

Optimum speed: Automated system should be able to maintain the optimal speed depending upon the
surroundings.

Comfortable journey: Automated system should be able to give a comfortable journey to the end user.

Environment:

Roads: Automated car driver should be able to drive on any kind of a road ranging from city roads to
highway.

Traffic conditions: You will find different sort of traffic conditions for different type of roads.

Actuators:

Steering wheel: used to direct car in desired directions.

Accelerator, gear: To increase or decrease speed of the car.

Sensors: To take input from environment in car driving example cameras, sonar system etc.

3. Illustrate the drawbacks of Hill climbing algorithm. 3M

(3 disadvantages each carries 1M (1M+1M+1M)

A. 1. Local Maxima: a local maximum as opposed to global maximum. A local maxima is a “peak”
that is higher than each of its neighboring states, but lowers than global maxima.

Hill climbing algorithm that reaches the vicinity of local maxima will be drawn upwards towards the
peak but will then be stuck with nowhere else to go.

2. Plateaus (flat local maxima): An area of the search space where evaluation function is flat, thus
requiring random walk.

3. Ridge: Where there are steep slopes and the search direction is not towards the top but towards the
side. Ridges result in a sequence of local maxima that is very difficult to navigate.

4. Illustrate Map colouring problem with an example. 3M

(Definition 1M + Example 2M (Identification of variables, values and constraints 1M+Final


assignment representation 1M)

A. Map Coloring: Given a map of countries, and a fixed set of colors, assign a color to each region in
the map in such a way that no two adjacent regions have the same color

Example:
 Variables WA, NT, Q, NSW, V, SA, T

 Domains D = {red,green,blue} (Domain Values)

 Constraints: adjacent regions must have different colors


e.g., WA ≠ NT, or (WA,NT) in {(red,green),(red,blue),(green,red),
(green,blue),(blue,red),(blue,green)}

Solutions are complete and consistent assignments

WA = red, NT = green, Q = red, NSW = green, V = red, SA = blue, T = green

5. State Breadth First Search algorithm and illustrate with an example.

• Breadth-first search is the most common search strategy for traversing a tree or graph. This
algorithm searches breadth wise in a tree or graph, so it is called breadth-first search.
• BFS algorithm starts searching from the root node of the tree and expands all successor nodes at
the current level before moving to nodes of next level.
• Breadth-first search implemented using FIFO queue data structure.
Algorithm:

1. Create a variable called NODE-LIST and set it to initial state


2. Until a goal state is found or NODE-LIST is empty do
a. Remove the first element from NODE-LIST and call it E. If NODE-LIST was
empty, quit
b. For each way that each rule can match the state described in E do:
i. Apply the rule to generate a new state
ii. If the new state is a goal state, quit and return this state
iii. Otherwise, add the new state to the end of NODE-LIST
Example:
A

Advantages: G

 BFS will provide a solution if any solution exists.


 If there are more than one solution for a given problem, then BFS will provide the minimal
solution which requires the least number of steps.
Disadvantages:

 It requires lots of memory since each level of the tree must be saved into memory to expand the
next level.
 BFS needs lots of time if the solution is far away from the root node.
Scheme: Statement 1M

Algorithm: 2M

Example: 2M

6. Discuss main characteristics of production systems.

Production systems can be defined as a kind of cognitive architecture, in which knowledge is


represented in the form of rules. So, a system that uses this form of knowledge representation is called a
production system.

A production system consists of:

• A set of rules, each consisting of a left side that determines the applicability of the rule and a
right side that describes the operation to be performed if that rule is applied.
• One or more knowledge/databases that contain whatever information is appropriate for the
task. Some parts of the database may be permanent, while other parts of it may pertain only to
the solution of the current problem.
• A control strategy that specifies the order in which the rules will be compared to the database
and a way of resolving the conflicts that arise when several rules match at once.

• A rule applierwhich checks the capability of rule by matching the content state with the left-
handside of the rule and finds the appropriate rule from database of rules.

Scheme: Production System Definition: 1M


Each characteristic: 1M (4 characteristics 4Marks)

7. Discuss the logic of Local Beam Search problem.[5M]

Ans:

In this algorithm, it holds k number of states at any given time. At the start, these states are generated
randomly. The successors of these k states are computed with the help of objective function. If any of
these successors is the maximum value of the objective function, then the algorithm stops.

Otherwise the (initial k states and k number of successors of the states = 2k) states are placed in
a pool. The pool is then sorted numerically. The highest k states are selected as new initial states. This
process continues until a maximum value is reached.[2M]

function BeamSearch( problem, k), returns a solution stat

start with k randomly generated states

loop

generate all successors of all k states

if any of the states = solution, then return the state

else select the k best successors

end [3M]

8. Justify “Map Colouring is an example constraint satisfaction problem”. Use a suitable


example.[5M]

Ans:
Constraint satisfaction problem (or CSP) is defined by a set of vari- CONSTRAINT SATISFACTION
PROBLEM VARIABLES, X1, X2, . . . , Xn, and a set of constraints, C1, C2, . . . , Cm. Each variable
Xi has a CONSTRAINTS nonempty domain Di of possible values. Each constraint C i involves some
subset of the DOMAIN VALUES variables and specifies the allowable combinations of values for that
subset. A state of the problem is defined by an assignment of values to some or all of the variables, {X i
= vi , Xj = ASSIGNMENT vj , . . .}. An assignment that does not violate any constraints is called a
consistent or legal CONSISTENT assignment. A complete assignment is one in which every variable is
mentioned, and a solution to a CSP is a complete assignment that satisfies all the constraints. Some
CSPs also require a solution that maximizes an objective function.[2M]

So what does all this mean? Suppose that, having tired of Romania, we are looking at a map of
Australia showing each of its states and territories, as in Figure 5.1(a), and that we are given the task of
coloring each region red, green, or blue in such a way that no neighboring regions have the same color.
To formulate this as a CSP, we define the variables to be the regions: WA, NT, Q, NSW , V , SA, and
T. The domain of each variable is the set {red, green, blue}. The constraints require neighboring
regions to have distinct colors; for example, the allowable combinations for WA and NT are the pairs
{(red, green),(red, blue),(green, red),(green, blue),(blue, red),(blue, green)} . (The constraint can also be
represented more succinctly as the inequality WA 6= NT, provided the constraint satisfaction algorithm
has some way to evaluate such expressions.) There are many possible solutions, such as {WA = red,
NT = green, Q = red, NSW = green, V = red, SA = blue, T = red }. CONSTRAINT GRAPH It is
helpful to visualize a CSP as a constraint graph, as shown in Figure.

The nodes of the graph correspond to variables of the problem and the arcs correspond to constraints.
Treating a problem as a CSP confers several important benefits. Because the representation of states in
a CSP conforms to a standard pattern—that is, a set of variables with assigned values—the successor
function and goal test can written in a generic way that applies to all CSPs. Furthermore, we can
develop effective, generic heuristics that require no additional, domain-specific expertise. Finally, the
structure of the constraint graph can be used to simplify the solution process, in some cases giving an
exponential reduction in complexity.

Final solution:

Solutions are complete and consistent assignments

e.g., WA = red, NT = green, Q = red, NSW = green,V = red,SA = blue,T = green


[3M]

9. Water-Jug Problem
Water Jug Problem:

Example: You are given two jugs, a 4-gallon one and a 3-gallon one. Neither has any measuring mark
on it. There is a pump that can be used to fill the jugs with water. How can you get exactly 2 gallons of
water into the 4-gallon jug?

Solution:
The state space for this problem can be described as the set of ordered pairs of integers (x,y)
Where,
X represents the quantity of water in the 4-gallon jug X= 0,1,2,3,4
Y represents the quantity of water in 3-gallon jug Y=0,1,2,3
Start State: (0,0)
Goal State: (2,0)
Generate production rules for the water jug problem
Production Rules: 3MARKS

Rule State Process


1 (X,Y | X<4) (4,Y)
{Fill 4-gallon jug}
2 (X,Y |Y<3) (X,3)
{Fill 3-gallon jug}
3 (X,Y |X>0) (0,Y)
{Empty 4-gallon jug}
4 (X,Y | Y>0) (X,0)
{Empty 3-gallon jug}
5 (X,Y | X+Y>=4 ^ (4,Y-(4-X))
Y>0) {Pour water from 3-gallon jug into 4-gallon jug until 4-
gallon jug is full}
6 (X,Y | X+Y>=3 (X-(3-Y),3)
^X>0) {Pour water from 4-gallon jug into 3-gallon jug until 3-
gallon jug is full}
7 (X,Y | X+Y<=4 (X+Y,0)
^Y>0) {Pour all water from 3-gallon jug into 4-gallon jug}
8 (X,Y | X+Y <=3^ (0,X+Y)
X>0) {Pour all water from 4-gallon jug into 3-gallon jug}
9 (0,2) (2,0)
{Pour 2 gallon water from 3 gallon jug into 4 gallon
jug}

Initialization: 4Marks
Start State: (0,0)
Apply Rule 2:
(X,Y | Y<3) -> (X,3)
{Fill 3-gallon jug}
Now the state is (X,3)

Iteration 1:
Current State: (X,3)
Apply Rule 7:
(X,Y | X+Y<=4 (X+Y,0)
^Y>0) {Pour all water from 3-gallon jug into 4-gallon jug}
Now the state is (3,0)

Iteration 2:
Current State : (3,0)
Apply Rule 2:
(X,Y | Y<3) -> (3,3)
{Fill 3-gallon jug}
Now the state is (3,3)

Iteration 3:
Current State:(3,3)
Apply Rule 5:
(X,Y | X+Y>=4 ^ (4,Y-(4-X))
Y>0) {Pour water from 3-gallon jug into 4-gallon jug until 4-
gallon jug is full}
Now the state is (4,2)

Iteration 4:
Current State : (4,2)
Apply Rule 3:
(X,Y | X>0) (0,Y)
{Empty 4-gallon jug}
Now state is (0,2)

Iteration 5:
Current State : (0,2)
Apply Rule 9:
(0,2) (2,0)
{Pour 2 gallon water from 3 gallon jug into 4 gallon
jug}
Now the state is (2,0)

Goal Achieved.

State Space 2Marks

10. Discuss the role of Agents, and the Environment in which they operate?

Diagram:

5
 An agent is anything that can be viewed as perceiving its environment through sensors and
acting upon that environment through actuators. A human agent has eyes, ears, and other
organs for sensors and hands, legs, vocal tract, and so on for actuators. A robotic agent might
have cameras and infrared range finders for sensors and various motors for actuators.( 1M)

 An agent's percept sequence is the complete history of everything the agent has ever
perceived. In general, an agent's choice of action at any given instant can depend on the
entire percept sequence observed to date, but not on anything it hasn't perceived.(1M)

 An agent action always depends on the environment. There is to say about the agent.
Mathematically speaking, we say that an agent's behavior is described by the agent function
that maps any given percept sequence to an action.(1M)

 A rational agent is one that does the right thing—conceptually speaking, every entry in the
table for the agent function is filled out correctly. Obviously, doing the right thing is better
than doing the wrong thing.(1M)

 A robotic agent might have cameras and infrared range finders for sensors and various motors
for actuators. A software agent receives keystrokes, file contents, and network packets as
sensory inputs and acts on the environment by displaying on the screen, writing files, and
sending network packets (1M)

 The agent function for an artificial agent will be implemented by an agent program. It is
important to keep these two ideas distinct. The agent function is an abstract mathematical
description. Agent program is a concrete implementation, running within some physical
system. (1M)

11. Consider the following game tree in which the static scores (at the tip nodes) are all from the first
player’s point of view. Assume that the first player is the maximizing player (i.e. MAX), and that high
numbers represent better scores for MAX

11 A) Use Mini-max algorithm to determine which move the first player should choose.

The mininiax algorithm is designed to determine the optimal strategy for MAX, and thus to decide what
the best first move is. The algorithm consists of five steps: 2M

• Generate the whole game tree, all the way down to the terminal states.

• Apply the utility function to each terminal state to get its value.
• Use the utility of the terminal states to determine the utility of the nodes one level higher
• Continue backing up the values from the leaf nodes toward the root, one layer at a time.

• Eventually, the backed-up values reach the top of the tree; at that point, MAX chooses the move that
leads to the highest value.

Example with Explanation with diagram 2.5M

A two-ply game tree as generated by the minimax algorithm. The A nodes arsmoves by MAX and the
V nodes UK moves by MIN. The terminal nodes show the utility value forMAX computed by the utility
function (i.e., by the rules of the game), whereas the utilities of theother nodes are computed by the
minimax algorithm from the utilities of their successors. MAX'Sbest move is A\, andMlN's best reply
is A\\.Minimax maximizes the utility for the worst-case outcome for max.

11 B) Examine the nodes not needed to be pruned using the alpha-beta pruning algorithm assuming that
nodes are examined in left-to-right order?

Procedure: 2M

It is possible to compute the correct minimax decision without looking at every node in the search tree. The
process of eliminating a branch of the search tree from consideration without examining it is called pruning
the search tree. The particular technique we will examine is called alpha-beta pruning. When applied to a
standard minimax tree, it returns the same move as minimax would, but prunes away branches that cannot
possibly influence the final decision.

Explanation: 2.5M
Consider a node n somewhere in the tree, such that Player has a choice of moving to that node. If Player has a
better choice m either at the parent node of n, or at any choice point further up, then n will never be reached
in actual play. So once we have found out enough about n (by examining some of its descendants) to reach
this conclusion, we can prune it

12. Define the terminology used in Genetic Algorithms. Illustrate Genetic algorithm with an Example.

A genetic algorithm is a search heuristic that reflects the process of natural selection where
the fittest individuals are selected for reproduction in order to produce offspring of the next
generation. In this algorithm, successor states are generated by combining two parent states
rather than by modifying a single state.

Five phases are considered in a genetic algorithm.


1. Initial population

2. Fitness function

3. Selection

4. Crossover

5. Mutation

Steps with example:

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).
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. We can consider
Hamming distance as fitness function for N-puzzle game.

Selection

The 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. Individuals
with high fitness have more chance to be selected.

Crossover: Crossover is the most significant phase in a genetic algorithm.

For each pair of parents, a crossover point is chosen at random from within the genes.
Mutation

In certain new offspring formed, some of their genes can be subjected to a mutation with a low
random probability. This implies that some of the bits in the bit string can be flipped. Mutation
occurs to maintain diversity within the population and prevent premature convergence.

Termination

The algorithm terminates if the population has converged (does not 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.

EXAMPLE

An 8-queens state must specify the positions of 8 queens, each in a column of 8 squares. The
state could be represented as 8 digits, each in the range from 1 to 8.

Introduction and number of phases 4 marks


Illustration with example of steps 5 marks

Potrebbero piacerti anche