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

Example Problems

Uploaded by

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

Example Problems

Uploaded by

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

Agents and Environment Practice Questions:

Describe the environment, sensors, actuators of a search engine such as Google. What type of agent
should a search engine be? Provide proper explanation. (2.5)
Ans: Environment: world wide web, Sensors: Keyboard, voice input, actuators: Computer monitor etc.
For purely performance maximization, it can be a goal based agent. It can also be a utility based agent if it
considers ethical search results.

What are the sensors and actuators in case of an intelligent agent in a self driving car? Also what
could be the elements of the environment in which self driving cars drive themselves? (2.5 marks)

Ans: In autonomous driving, various sensors are employed to collect information from the environment.
These include cameras, GPS, and radar. Various actuators are used to initiate actions. For example, brakes
are used to bring the car to a stop and steering wheels are used to turn the car into left or right. In this
application, the environment can be pedestrians, other vehicles, roads, or road signs.

Local Search Practice Questions:

What are the drawbacks of the hill climbing algorithm ? Mention and describe briefly 2
solutions of the drawbacks of hill climbing algorithm [1 + 1 marks]
Ans: Mostly given in the slides.

What is the difference between Greedy Best First Search and Hill Climbing algorithm?
Ans:
- Existence of fringe in GBFS vs the lacking of fringe in Hill climb
- Backtracking vs not backtracking
Student ID: CSP Practice Problem CSE422

Try to solve the problem first by yourself. If you get stuck, look at the solutions.

Problem: Campus Layout


You are asked to determine the layout of a new, small college. The campus will have four structures: an administration
structure (A), a bus stop (B), a classroom (C), and a dormitory (D). Each structure (including the bus stop) must be
placed somewhere on the grid shown below.

The layout must satisfy the following constraints:

i. The bus stop (B) must be adjacent to the road.


ii. The administration structure (A) and the classroom (C) must both be adjacent to the bus stop (B).
iii. The classroom (C) must be adjacent to the dormitory (D).

iv. The administration structure (A) must not be adjacent to the dormitory (D).
v. The administration structure (A) must not be on a hill.
vi. The dormitory (D) must be on a hill or adjacent to the road.
vii. All structures must be in different grid squares.

Here, adjacent means that the structures must share a grid edge, not just a corner.
Now answer the following questions.

(a) Which of the constraints above are unary constraints?


Answer: i, v, vi
Explanation: Unary constraints are constraints that involve a single variable. i only constrains (B), v only
constrains (A), and vi only constrains (D). All the other constraints involve more than one variable.
(b) List all the values that remain in the domains of all the variables after enforcing the unary constraints (also known
as enforcing node consistency).
Answer:
A ∈ {(1, 1), (1, 3), (2, 2), (2, 3)}
B ∈ {(1, 3), (2, 3)}
C ∈ {(1, 1), (1, 2)(1, 3), (2, 1), (2, 2), (2, 3)}
D ∈ {(1, 2), (1, 3), (2, 1), (2, 3)}
Explanation: i limits (B) to (1,3) or (2,3), because those are the only positions adjacent to the road. v removes
(1,2) and (2,1) from the domain of (A) because those two positions have hills. vi removes (1,1) and (2,2) from
the domain of (D) because those two positions are neither on a hill, nor adjacent to the road. (C) has no unary
constraints, and thus can still be any value after unary constraints are applied.

1
Student ID: CSP Practice Problem CSE422

(c) Continuing from (b), enforce the consistency of the arc A → B and list the remaining values in the domain of A
and B.
Answer: A ∈ {(1, 3), (2, 2), (2, 3)}
B ∈ {(1, 3), (2, 3)}
Explanation: After an arc is enforced, every value in the domain of the tail has at least one possible value in the
domain of the head such that the two values satisfy all constraints with each other. If a value in the tail’s domain
does not satisfy this, that value can be removed, because it is guaranteed not to be a part of a solution without
backtracking on some previously selected variable. In this case, (1,1) in A’s domain is not adjacent to either (1,3)
or (2,3), so B has no possible values and (1,1) can be removed from A’s domain.
(d) Continuing from (c), you should convince yourself that the arcs A → C, A → D, B → A, B → C, B → D, and
C → A are already consistent. The next arc is C → B. List the remaining values in the domain of C and B after
the consistency of C → B is enforced.
Answer: C ∈ {(1, 2)(1, 3), (2, 2), (2, 3)}
B ∈ {(1, 3), (2, 3)}
Explanation: (1,1) and (2,1) are removed from C, because if either value is assigned to C, there is no possible
value in B’s domain that satisfies all of the constraints.
(e) Continuing from (d), which arcs need to be rechecked after the consistency of C → B was enforced?
Answer: A → C and B → C.
Explanation: When a domain changes after enforcing an arc, all arcs that end at that variable must be re-added
to the queue: A → C, B → C. This is done because some values in other variables’ domains might have relied on
the removed values to be consistent, so they have to be checked again.

(Credits to Dan Klein and Pieter Abbeel)

2
Informed Search Practice Questions:

In the graph given above, consider that you keep track of already expanded nodes and
their f cost. Also, if you visit an already expanded node by some other branch, you push
it back to the fringe only if their new f cost is lower than the previous f cost. Now,
simulate A* search for Start Node A and Goal Node P. (5)

Ans:
1. Predict whether A* search algorithm will be able to provide an optimal path from the
start node A to the goal node G for the above graph. Why or why not? [2]
2. Considering A as the start node and G as the goal node, Apply A* search algorithm for
the given graph. Make sure to show each step. [8]

Ans:

1. Yes because h is admissible

2.
Uninformed Search Practice Question

a) Assuming E is the goal node and A is the start node for the following tree, Simulate BFS

and DFS.

b) Considering time and space complexity, what is the branching factor for the tree above?

Ans:
a) Try it yourselves. There are many BFS/DFS samples with solution online
b) Branching factor = Max number of children = 4

You might also like