0% found this document useful (0 votes)
20 views13 pages

Muhanned Ansari AI Assignment 5

Uploaded by

bosscid2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views13 pages

Muhanned Ansari AI Assignment 5

Uploaded by

bosscid2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Artificial Intelligence

Assignment

Name: Muhanned Ansari


Student ID:21587167
Subject of Study: Artificial Intelligence
University: University of Westlondon
Question 1[25 Marks]
Pick an “AI technology” that has appeared in the news or on TV
recently. Read about the technology and gather some information
about how it has evolved with AI. Prepare a PowerPoint presentation
(up to three slides) and make a video (not exceeding 3 minutes)
presenting your work on powerpoint slides.
Submission: You will need to submit your powerpoint and your
video (in any format accepted by ‘Blackboard’) containing the
following information:
- Cover slide: Introduction of yourself (including your full name,
student
ID, and your subject of study at the University of West London).
- Slide 1: Explanation and demonstration of the technology.
- Slide 2: How the technology has evolved with AI.
Ans: Link : https://youtu.be/-mOSDK9uFK0?si=-x-rbbu_R-7LKHl5
Screenshot:
Question 2 [25 Marks]
You will be answering parts (a) to (c) for a “smart home assistant”
like Google Home or Amazon’s Alexa. These agents listen for
keywords (e.g. “Okay, Google”), and when addressed, respond to
questions and perform tasks (e.g.adding an item to a list).
(a) Develop a description of the agent using the PEAS analysis, i.e.
- Performance ------------------------
- Environment ------------------------
- Actuators ----------------------------
- Sensors -------------------------------
(b)Describe the environment according to the following properties,
i.e.,
- Fully versus partially observable ------------------------ (why?)
- Deterministic versus stochastic ------------------------- (why?)
- Episodic versus sequential ------------------------------- (why?)
- Static versus dynamic ------------------------------------- (why?)
- Discrete versus continuous ------------------------------ (why?)
- Single versus multi-agent -------------------------------- (why?)
(c) Suggest the most appropriate agent design by choosing the most
appropriate of the following types:
- Simple reflex agent
- Model-based agent
- Goal-based agent
- Utility-based agent
- Learning agent
Justify your answer with explanation
Ans:
(a)
o Performance- – Support users by addressing inquiries and
managing smart home devices, prioritizing user satisfaction
and ensuring safety.
o Environment- houses, cars, works with all kinds of smart
gadgets, etc.
o Actuators – Speaker, Cloud Servers, Software Algorithms, etc
o Sensors- Microphones, Motion Sensors, Temperature
Sensors, Light Sensors, Camera Sensors etc.
(b)
o Partially Observable- Because the smart home assistant can
only perceive information through its sensors—such as
microphones for voice commands—therefore the
environment is only partially observable. It might not be
able to see or sense everything going on around it, so it
doesn't have a full understanding of its surroundings.
o Stochastic - Because user input is unpredictable and user
communication or request phrasing might vary, therefore
the environment is stochastic.
o Sequential-The interaction with the smart home assistant is
arranged in a sequential manner, consisting of a series of
commands and answers.
o Dynamic: The environment is dynamic as it changes over
time. Users may introduce new commands, devices may be
added or removed, and the state of the smart home is subject
to constant updates. The assistant must adapt to these
changes in real-time.
o Continuous – the temperature , weather conditions change
continuously , therefore continuous updating is required. It
can also be discrete as user commands and responses are
distinct events.
o Single Agent- The smart home assistant is primarily a single
agent, as it operates independently to understand and
respond to user commands, but as it interacts with other
devices it’s a also a multi agent.
(c ) The suitable agent design for smart home assistant is A utility-
based agent as it excels in optimizing actions to maximize user
satisfaction, considering factors like relevance, efficiency, and
user preferences. Its ability to make decisions under uncertainty,
flexibility in goal representation, and adaptability to changing
user preferences make it well-suited for the dynamic and diverse
environment of a smart home.

Question 4
4.1)Consider the following joint probability distribution of X and
Y shown in Table 4.1.

Find:
(a) P(X=1, Y=2)
(b)P(X=0, 1≤Y<3)
(c) Find the marginal probability function for X and Y
(d)Give the conditional probability function for X given Y=1
(e) Are X and Y independent?

4.2 What is the probability of any of the following events? Please


provide details of your calculations, if required.
A. P(X=true | Y=true) ?
B. P(X=false | Y=true) ?
C. P(Y=false | X=true) ?

Ans :
4.1)
(a) P(x=1 y=2) = 1/12
(b) (b)P(X=0, 1≤Y<3) = 1/6+1/12
2/12+1/12
= 3/12
= ¼ =0.25
(c) marginal probability condition of x =
(x=0) = 1/12+1/6+1/12=0.33
(x=1)= 1/12+1/6+1/12=0.33
(x=2) =1/6+1/12+0=0.25
(x=3)= 1/12+0+0=0.083
marginal probability condition of y =
(y=0)= 1/12+1/12+1/6+1/12=0.41
(y=1) = 1/6+1/6+1/12+0=0.41
( y=2) =1/12+1/12+0+0=0.16
(d) conditional probability of X given Y=1
 (x=0 | y=1) = P(x=0, y=1)/P(y=1)
= 1/6/5/12
= 1/6 *12/5=2/5= 0.4
 (x=1|y=1) = P(x=1,y=1)/P(y=1)
= 1/6/5/12
= 1/6*12/5
= 2/5 =0.4
 (x=2|y=1)
= P(x=2,y=1)/P(y=1)
= 1/12/5/12
=1/12*12/5
= 1/5 = 0.2
 (x=3|y=1)
= P(x=3,y=1)/P(y=1)
= 0/5/12
= 0*12/5=0

e) P(Y)= 1/12+1/12+1/6+1/12=5/12
P(Y)=1/6+1/6+1/12+0=5/12
P(Y)=1/12+1/12+0+0=1/6
5/12+5/12+1/6=1

P(X)=1/12+1/6+1/12=2/6=1/3
P(X)= 1/12+1/6+1/12=1/3
P(X)=1/6+1/12+0=3/12=1/4
P(X)=1/12
2/3+1/4+1/12=1
In order for ,X and Y to be independent
P(X,Y)= P(X) x P(Y)

Here P(X,Y) is not equal to P(X) x P(Y) , that is LHS is not equal to
RHS for the cases (X=2,Y=0), (X=3,Y=0) and so on, therefore they
are dependant.
4.2)
A) P(X=true | Y=true)=0.2
B) P(X=false | Y=true)=0.4
C) . P(Y=false | X=true)=0.3

Question5 Programming Question [25 Marks]

A state space graph is shown in Figure 5.1. S is the start state and J is
the goal state. Develop a computer code [in any language] to solve
this search problem using the Breadth First Search (BFS) method.

Ans:
Screenshot

Code:
from collections import deque

class Graph:
def __init__(self):
self.graph = {}

def add_edge(self, node, neighbors):


self.graph[node] = neighbors

def bfs(graph, start, goal):


visited = set()
queue = deque([start])
visited.add(start)
while queue:
current_node = queue.popleft()
print(current_node, end=' ')

if current_node == goal:
print(f"\nGoal node {goal} reached.")
return

for neighbor in graph.get(current_node, []):


if neighbor not in visited:
queue.append(neighbor)
visited.add(neighbor)

print(f"\nGoal node {goal} not reached.")

graph_obj = Graph()
graph_obj.add_edge('S', ['A', 'B', 'C'])
graph_obj.add_edge('A', ['D'])
graph_obj.add_edge('B', ['E'])
graph_obj.add_edge('C', ['F', 'J'])
graph_obj.add_edge('D', ['G'])
graph_obj.add_edge('E', ['I', 'J'])
graph_obj.add_edge('I', [])
graph_obj.add_edge('J', [])
graph_obj.add_edge('F', ['S'])
graph_obj.add_edge('G', ['H'])
graph_obj.add_edge('H', ['D'])

start_node = 'S'
goal_node = 'J'
print(f"BFS starting from node {start_node} to reach goal node {goal_node}:")
bfs(graph_obj.graph, start_node, goal_node)

You might also like