You are on page 1of 84

Name: Reha Shah Roll No.

: 21BCP148
Internal Assessment: 1: Unit 1 AI Semester: 6 Division: 3

Answer the following with appropriate diagrams where necessary.

1. Complete the following table with relevant analysis of the systems mentioned in first column.

System Performance Environment (E) Actuator (A) Sensor (S)


Measure (P)
Lego-based House 1. Percentage of The Lego pieces Display, speaker, Keyboard, mouse,
Design Assistance users who were that we are using printer. scanner, mic,
from available able to build the to build he camera, screen
Legos design they house. touch sensor or
(I am assuming wanted using the any other source
this to mean that design and steps to for user to input
the AI helps to follow that the the type of house
only design the system generated. they want to build
Lego house based 2. Average level of and how they
on the user inputs satisfaction/ want to build it
and doesn’t accuracy achieved and how detailed
actually build it) by user in the steps they might
house after using need.
the system.
3. Average time
and space and
computation taken
by system to
generate the
solution.
4. Measure of how
detailed the
solution was (could
be the number of
steps that the
system gave for
the user to follow –
the more the
better).
Augmented 1. Speed of Toddlers, Monitor/Display, Camera, mic,
reality toddlers learning parents, speaker. keyboard, mouse,
environment for concepts as educators, GPS ( or some
toddler learning compared to surrounding other device to
traditional objects to know current
methods. overlay digital location and
2. Retention of the items on. orientation),
contained learned motion sensor.
by the toddlers.
3. Continuous
engagement rate.
Name: Reha Shah Roll No.: 21BCP148
Internal Assessment: 1: Unit 1 AI Semester: 6 Division: 3

4. Quality of
feedback from the
users.
5. Accuracy and
quality of content
delivered.
Water Jug 1. Whether the If in real life: If in real life: 2 Water level
Problem Solution goal state is Source of water, buckets (jugs) to sensor in the jugs.
reached or not i.e. a place (sink) to fill water in, a
if we are able to dump water in. person/robotic
achieve the arm to lift and fill
required quantity the jugs.
of water.
2. Number of If in a simulation: If in a simulation: If in a simulation:
states we had to the system itself the rules we apply the states in the
explore before (incl. the – that we can only state space search
reaching the goal. processors, fill the jugs we will explore to
3. Time taken to memory etc. in completely (not reach the goal
reach the goal the computer/ partially) and state of achieving
state. device). when empting the required
4. Percentage of them into the sink quantity of water
problems solved then have to if possible.
with given empty completely
constraints within and other rules.
a set time limit.
Tic tac toe 1. Percentage of The system itself The rules we The states that
(assuming it to be games that the (incl. the apply: the grid, X are possible to
a simulation – computer wins processors, and O, way to win reach in the game
computer against the human. memory etc. in etc. constraints. (state space).
application) 2. Average number the computer/
of steps before the device).
computer
wins/loses/reaches
a draw.
Grass trimming 1. Accuracy of the Grass, ground, Cutter, motor, Keyboard, touch
robot cutting. i.e. user. wheels (or screen, mic,
percentage of the whatever object proximity sensor,
grass that has been used to move), camera, IR sensor,
cut to its required shovel to move something to
height. the cut grass sense the quality
2. Time taken to do aside, of the land that
the task. screen/monitor, the robot has to
3. Percentage of speaker. move over i.e.
faults done i.e. if it whether it will be
cut something that able to hold the
Name: Reha Shah Roll No.: 21BCP148
Internal Assessment: 1: Unit 1 AI Semester: 6 Division: 3

was not grass or weight and how


hurt or damaged soft it is and how
any object or much force will
person in the way. the robot need to
4. Amount of cut move over it.
grass that was
piled neatly in the
designated place.

2. Considering the generic search algorithm mentioned below complete the given table.

function Search(graph, start, goal):

0. Initialize

agenda = [ [start] ]

extended_list = []

while agenda is not empty:

1. path = agenda.pop(0) # get first element from agenda & return it

2. if is-path-to-goal(path, goal) return path

3. otherwise extend the current path if not already extended

for each connected node

make a new path (don't add paths with loops!)

4. add new paths from 3 to agenda and reorganize agenda

(algorithms differ here see table below)

Fail!

Search Algo Properties Type of Example of Type of What it does


problems it problem agent(s) with agenda in
can be generally step 4
applicable to using the
algo
BFS 1. Queue is used. When the goal Using Simple Appends all
2. Every node is node is nearer interpolation reflex the new paths
explored at most to the source to resize agents. to the end of
once. node in terms images (we the agenda
3.Neighbours are of neighbours. will have to list.
explored first. consider the
Name: Reha Shah Roll No.: 21BCP148
Internal Assessment: 1: Unit 1 AI Semester: 6 Division: 3

4. In worst case it adjacent


is the same as pixels).
brute force.
5. It is a complete
algorithm.
6. Time
complexity: O(bd)
DFS 1. Stack is used. When the goal Finding the Simple Inserts all the
2. Every node is node is on a diameter of a reflex new paths to
explored at most farther level graph or the agents. the agenda list
once. from the longest path at index 0.
3.First available source node from the
child nodes are and needs a current node.
explored first. forward
4. In worst case it movement
is the same as focused
brute force. search.
5. It is not a
complete
algorithm.
6. Time
complexity: O(nm)
Uniform Cost 1. Priority queue When we Finding the Utility Inserting all
is used. want to find best available based. the new paths
2. A node may be the most path given to agenda
explored more optimal path source array so that
than once if we available. location to our the array
find a lower cost destination in remains
path to it. map and path sorted in
3.Lowest cost finding GPS ascending
neighbours are type order based
explored first. applications. on the cost of
4. In worst case it the path from
can be worse the source
than brute force. node.
5. It is a complete
algorithm.
6. Time
complexity:
O(b1+[C*/e))
Iterative 1. Stack is used. When we Trying to find Simple Will add all the
Deepening 2. Every node is don’t know the nearest reflex paths within
explored at most the depth of location that agents. the current
once. the whole sells the threshold to
graph and specific item index 0 in the
Name: Reha Shah Roll No.: 21BCP148
Internal Assessment: 1: Unit 1 AI Semester: 6 Division: 3

3.First available want to we want or agenda array


child nodes are explore all the has the and the rest
explored first. paths in a properties afterwards
4. In worst case it given depth required by based on what
is the same as before going the user (like depth they are
brute force. deeper in the trying to find and if we have
5. It may happen way DFS does. the nearest reached the
that the goal barber) but it threshold then
node was just 1 is unknown as we will also
level deeper than to at what increase it be
the current value distance we the increment
of threshold. will find them value.
6. It is a complete and the
algorithm. possible
7. Time distance can
complexity: O(bd) be infinite.
Depth Limited 1. Stack is used. When we Trying to find Simple Inserts all the
Search 2. Every node is want to find a a path to our reflex new paths to
explored at most path of a destination agents. the agenda list
once. maximum while the at index 0 that
3.First available specified amount of don’t go to a
child nodes are depth or else petrol depth that
explored first. give up. available is exceeds the
4. It may happen limited and maximum
that we don’t can only go to depth limit we
reach the goal a finite have set.
node at all if it is distance from
at a depth more source before
than our failing.
maximum depth.
5. It is not a
complete
algorithm.
6. Time
complexity: O(ln)
Bidirectional 1. It is dependent When we are Trying to chart Simple We will have
Search on the algorithm trying to solve a path that reflex to have 2
used to actually a puzzle with two people agents. agenda lists,
traverse the more than one can follow to one for the
graph. (specifically 2) reach other source node
2. The graph is moving points when both can and one for
traverse from the in the search move. the goal node.
goal and source space. And then we
node both at will insert to it
once. based on the
Name: Reha Shah Roll No.: 21BCP148
Internal Assessment: 1: Unit 1 AI Semester: 6 Division: 3

3. Only node may search


be explored more technique we
than once, that is use to do the
the node that will actual search
join both the from both the
paths. ends.
4. In worse case it
becomes same as
brute force.
5. It is a complete
algorithm if BFS is
used.
6. Time
complexity:
depends on
search algorithm
used.

3. Write an algorithm for bidirectional search implementing BFS in both subtrees.


Name: Reha Shah Roll No.: 21BCP148
Internal Assessment: 1: Unit 1 AI Semester: 6 Division: 3

4. Comment on the requirement of Heuristic search techniques. Mention its benefits and
drawbacks as compared to blind search techniques.

Analyzing the requirement of heuristic (informed) search techniques by using proof by contradiction:
in the uninformed (blind) search techniques we have no information to compare all the immediately
available moves therefore we either do FCFS or choose at random or choose based on the cost
incurred so far and thus there is a very real possibility of these algorithms running huge time
complexities and becoming the same as brute force or even worse with very high space complexities
also to store all the possible paths that were explored in this manner. Thus, the uninformed
techniques inherently have many problems and limitations that can be at least partially solved by
having some information about the nodes and their relation to the goal. And therefore we can
conclude that heuristic search techniques are required.

Another way to comment on the requirement of heuristic search techniques: seeing all their
advantages and how they improve search techniques. They use heuristic functions to estimate the
cost of the path to the goal node from the current node and then based on this value they decide the
next node to explore. With a good estimating function, this method reduces the number of states to
explore by a very good amount. They are also focused on finding the most optimal path, not just the
first available path like uninformed techniques and thus are better performing in optimizing problems.
The time complexity of these methods is also less due to the reduced number of nodes that are
explored and the space complexity is also low because even though there is added space requirement
to store the heuristic value (the “information” that separates these methods from blind search
techniques) the reduced number of states traversed reduces the memory needed to store all the
paths and this is much more significant than the heuristic values. Thus, heuristic search techniques
are required whenever we want any of the properties discussed in this paragraph.

But these techniques are much more complex and difficult to implement and understand and need
more computational power to implement thus if our problem is relatively easy and can be solved by
Name: Reha Shah Roll No.: 21BCP148
Internal Assessment: 1: Unit 1 AI Semester: 6 Division: 3

uniformed search and there is no constraint of time or space and any available path to goal will be
acceptable then heuristic search is not required and it would be easier to just implement blind search
techniques. We need to analyze the following before we choose the search technique that will be the
best:

A. is the problem decomposable

B. is the solution absolute or relative

C. is the solution a state or a path

D. is the universe predictable

E. is a large amount of knowledge needed to solve the problem or is it only required to constrain the
search

F. can the problem solution steps be ignored or undone

G. is the system/problem’s solution simply given or requires user input/interaction.

Mentioning the benefits and drawbacks as compared to blind search techniques: already covered in
the above paragraphs, thus I won’t be writing the same thing again.

5. Give the details to complete the following heuristic search comparison table:

Technique Properties Required Performance What it does with


parameters Measures agenda in step 4
of generic algo
mentioned in Q-2
Greedy Best First 1. It is a greedy 1. Heuristic 1. Whether a Add the paths
Search algorithm and function viable path was that have not
thus most times 2. Source node generated within been generated
gives a local 3. Goal node finite time or not. already to the
optimal with no 2. Cost of that agenda list and if
guarantee of it path. they have then
being the global 3. Time and space add them if the
optimal as well. complexity. new variant is
2. Recursively 4. Number of better based on
chooses the best states explored the heuristic. And
node available in before reaching then sort the
the OPEN list goal. agenda list in
based on the 5. How better it ascending based
heuristic value. was to use this as on the heuristic
3. More focused compared to value.
on moving closer doing simple BFS.
to the goal than
Name: Reha Shah Roll No.: 21BCP148
Internal Assessment: 1: Unit 1 AI Semester: 6 Division: 3

on finding the 6. Efficiency of the


best path to it. heuristic used.
Heuristic Search 1. Generates 1. Heuristic 1. Whether a Append the paths
(assuming you entire paths to function viable path was at the end of the
mean generate check if path 2. Source node generated within agenda list in
and test here) available. 3. Goal node finite time or not. ascending order
2. Not optimal. 2. Cost of that of their heuristic
3. Performance path. value.
depends on the 3. Time and space
rules applied and complexity.
the heuristic used 4. Number of
to evaluate the states explored
nodes. before reaching
goal.
A* Search 1. It gives a global 1. Heuristic 1. Whether a Append all the
optimal value. function viable path was non-explored
2. It is the only 2. Source node generated within nodes and
informed search 3. Goal node finite time or not. explored but now
technique that is 4. h(x), f(x), g(x) 2. Cost of that updated to a
complete. 5. Parent node path. lower cost paths
3. It takes into 3. Time and space to the agenda list
account the cost complexity. such that it is
of reaching to the 4. Number of sorted in an
current node and states explored ascending order
the predicted cost before reaching based on the f(x)
of reaching the goal. value.
goal when 5. How many
evaluating a given times did the
node. algorithm have to
4. It doesn’t get backtrack before
stuck in local reaching the goal.
optimums as it is
always looking to
move forward
from the current
node and
compares
available
successors to
each other
instead of to the
current node.
5. It is very
dependent on the
heuristic used.
Name: Reha Shah Roll No.: 21BCP148
Internal Assessment: 1: Unit 1 AI Semester: 6 Division: 3

Uses:
G(x): cost to reach
current node from
source using
current path
H(x): estimated
cost to reach goal
from current node
F(x): g(x) + (h(x)
Simulated 1. Based on a 1. Heuristic 1. Whether a Calculate the
Annealing mechanical function viable path was heuristic
process called 2. Quantity for generated within probability
annealing where the value of finite time or not. function value for
we gradually heat delta(e) 2. Cost of that each node and if a
up and cool down 3. annealing path. node found where
metal to make its schedule. 3. Time and space the probability is
internal energy 4. Increment/ complexity. more then
minimum. decrement value 4. Number of recursively call it.
2. Very after each states explored
dependent on the iteration before reaching
heuristic function 5. Quantity to goal.
and the constants take as the 5. Number of
we choose. temperature iterations done.
3. Not complete 6. Source and goal 6. Average
but if allowed to node number of times
run long enough 7. Value for the states were
will mostly give a Boltzmann revisited.
solution. constant

You might also like