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

Assignment-1-RollNo-333

The document is an assignment on Artificial Intelligence submitted by Ahmed Hassan Shah, covering the foundations of AI, intelligent agents, and problem-solving as search. It includes definitions, historical context, applications, and future trends of AI, as well as detailed explanations of agents, their types, and search strategies. The assignment also presents practical exercises, including the Missionaries and Cannibals problem solved using BFS.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Assignment-1-RollNo-333

The document is an assignment on Artificial Intelligence submitted by Ahmed Hassan Shah, covering the foundations of AI, intelligent agents, and problem-solving as search. It includes definitions, historical context, applications, and future trends of AI, as well as detailed explanations of agents, their types, and search strategies. The assignment also presents practical exercises, including the Missionaries and Cannibals problem solved using BFS.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Assignment 1

Artificial Intellegence

Submitted by:

Ahmed Hassan Shah

SU92-BSCSM-F22-333

Submitted to:

Prof. Iftikhar Hussain Babur

Superior University Gold Campus,Lahore


Assignment-1: Exploring Artificial Intelligence
Total Marks: 50
Submission Deadline: 02-02-2025 till 10am

Part 1: Foundations of AI (10 Marks)

1. Introduction to AI:
a. Define Artificial Intelligence in your own words.

Artificial Intelligence (AI) is the subfield of computer science which emphasizes the creation
of systems able to perform tasks that require human intelligence. Among them are problem-
solving, data-driven learning, decision-making, and natural language processing. Algorithms
and computational models allow AI to mimic human cognitive functions, hence allowing
machines to perform complex tasks in an efficient manner.

b. Briefly discuss the history and evolution of AI.

AI has passed through several key stages:

1950s-1960s (The Birth of AI):

Alan Turing introduced the concept of machine intelligence and proposed the Turing Test.
The first AI programs, such as the Logic Theorist, were developed.
John McCarthy coined the term "Artificial Intelligence" in 1956.
1970s-1980s (AI Winter):

Due to high expectations but slow progress, funding and research declined.
Limited computational power and unrealistic goals led to reduced interest in AI.
1990s-2000s (Revival and Growth):

Artificial intelligence improved machine learning, expert systems, and robotics.


IBM's Deep Blue won against chess champion Garry Kasparov in 1997, and AI established its
competitiveness.
2010s-Present (Deep Learning Era):

Big data and deep learning ushered speech recognition, autonomous driving, and natural-
language processing developments.
Google Assistant, Siri, and self-driving cars became the household norm.
AI became widespread in the industries of health care, financial services, and cybersecurity.

2. Turing Test:
a. What is the Turing Test?

The Turing Test, proposed in 1950 by Alan Turing, is an approach to know whether a
machine can exhibit behavior equivalent to that of a human or indistinguishable from a
human. Here, a human judge interacts through text-based conversation with both the human
and the machine. A machine is considered to have passed the test when the judge can't
reliably differentiate between the two.

b. Why is it considered a milestone in AI?

The Turing Test is a landmark in AI because:


•Introduced the concept of machine intelligence and established a benchmark for the
development of AI.

•It shifted the focus from whether machines "think" like humans to whether they behave
intelligently.

•It shaped the development of natural language processing (NLP) and chatbots like GPT-
based AI models.

• It is a core concept in AI philosophy and ethics, guiding research in human-computer


interaction.

3. Applications and Future Trends:


a. Describe three of the current applications of AI in different domains.

• Healthcare:
• AI-based diagnostic tool, such as IBM Watson, helps doctors in detecting diseases, such as
cancer, through the analysis of images and predictive models.
• AI-based chatbots and virtual assistants provide medical consultancy.
• Finance:
• Fraud detection algorithms detect unusual transactions, preventing cybercrime.
• Automated trading systems have high accuracy for analyzing market trends and executing
trades.
• Autonomous Vehicles:
•\tAI enables self-driving cars, such as Tesla's Autopilot, to navigate roads using computer
vision and deep learning.
•\tAI helps in real-time decision-making for traffic management and accident prevention.
b. Predict two future trends in AI development.

 General AI (AGI - Artificial General Intelligence):

 Future AI systems will move beyond narrow task-based intelligence to develop


human-like reasoning and decision-making capabilities.
 AGI could lead to AI systems that learn and adapt without needing specific training
data.

 AI and Quantum Computing:

 Quantum AI will enable ultra-fast computations, improving AI’s ability to solve


complex problems in fields like drug discovery and cryptography.
 AI-powered quantum algorithms will enhance data encryption, financial modeling,
and scientific research.

Part 2: Intelligent Agents (15 Marks)

1. Agents and Environments:


a. Define an agent and its environment.

An agent is an entity that perceives its environment through sensors and acts upon it using
actuators to achieve a specific goal. It can be a software program, a robotic system, or an AI
model.

The environment is the exterior system in which an agent works. It gives inputs or percepts
that cause the agent's decisions. In addition, an environment can either be static or dynamic,
deterministic or stochastic, and fully or partially observable.

Example
A robot vacuum cleaner (agent) perceives dust levels (sensor input) and moves accordingly
(actuators).
A chatbot (agent) interacts with users (environment) through text inputs.

b. Explain the concept of rationality in agents with examples.

Rationality in AI refers to an agent’s ability to take the best possible action based on its
percepts, knowledge, and available resources to maximize performance. A rational agent:

Always selects the optimal action.


Considers all available information.
Adapts to changes in the environment.
Examples:
Google Maps Navigation: Uses real-time traffic data to suggest the shortest route.
Stock Market Trading Bots: Analyze market trends and execute trades for maximum profit.
Autonomous Drones: Adjust flight paths based on wind conditions and obstacles.

2. Agent Types:
a. Differentiate between simple reflex agents, goal-based agents, model-based agents, and
utility-based agents.
Agent Type Description Decision making process
Simple reflex Agent Agents Based on current precerts Uses conditions-actions rules (eg if
without considering history traffic light = red then stop)
Model based Agent Maintain an internal model of the world Uses past and present data to make
to handle partial observability decisions.
Goal based Agents Takes actions to achieve a specific Uses search and planning algorithms.
goal, even if multiple steps are needed.
Utility Based Agents Maximizes a utility function to choose Considers both goals and preferences.
the best possible outcome.

b. Provide a real-world example for each agent type.

Agent Type Real World Example


Simple reflex Agent Agents Based on current precerts without considering history
Model based Agent Maintain an internal model of the world to handle partial observability
Goal based Agents Takes actions to achieve a specific goal, even if multiple steps are needed.
Utility Based Agents Maximizes a utility function to choose the best possible outcome.

3. PEAS Framework:
a. Choose one of the following systems and describe its PEAS:
o Autonomous vehicle
PEAS description for an Autonomous Vehicle
Component Description
Performance Measure Safe driving, reaching the destination
efficiently, minimizing fuel consumption,
avoiding accidents.
Environment Roads, traffic, pedestrians, weather
conditions, traffic rules.
Actuators Steering, braking, acceleration, indicator
lights.
Sensors Cameras, LiDAR, GPS, speed sensors,
proximity sensors.

o Online recommendation system

Part 3: Problem-Solving as Search (25 Marks)

1. State Space and Problem-Solving:


a. Explain the concept of state space with an example.
State space refers to the set of all possible states a system can be in while solving a problem.
It consists of:

Initial state: The starting point.


Goal state(s): The desired solution.
Operators: Actions that transform one state into another.
Example: 8-Puzzle Problem
State: Any arrangement of tiles.
Operators: Moving a tile up, down, left, or right.
Goal State: The tiles are arranged in the correct order.

b. Describe the problem space for the Water Jug Problem or Missionaries and
Cannibals problem.

State space refers to the set of all possible states a system can be in while solving a
problem. It consists of:

Initial state: The starting point.


Goal state(s): The desired solution.
Operators: Actions that transform one state into another.
Example: 8-Puzzle Problem
State: Any arrangement of tiles.
Operators: Moving a tile up, down, left, or right.
Goal State: The tiles are arranged in the correct order.

2. Search Strategies:
a. Define Depth First Search (DFS) and Breadth First Search (BFS) with pseudo-code.

Depth First Search (DFS)


DFS explores as deep as possible along each branch before backtracking.

Pseudo-code:

def DFS(graph, start, goal, visited=None):


if visited is None:
visited = set()
visited.add(start)
if start == goal:
return True
for neighbor in graph[start]:
if neighbor not in visited:
if DFS(graph, neighbor, goal, visited):
return True
return False
Breadth First Search (BFS)
BFS explores all nodes at the current depth before moving deeper.

Pseudo-code:

from collections import deque

def BFS(graph, start, goal):


queue = deque([start])
visited = set([start])

while queue:
node = queue.popleft()
if node == goal:
return True
for neighbor in graph[node]:
if neighbor not in visited:
visited.add(neighbor)
queue.append(neighbor)
return False

b. Explain Uniform Cost Search (UCS) with an example.

UCS finds the least-cost path by expanding the node with the lowest cost first.

Example: Pathfinding in a Weighted Graph


Consider a graph with cities and road distances:

A → B (cost 4)
A → C (cost 2)
B → D (cost 3)
C → D (cost 5)
UCS starts from A and always expands the cheapest path, ensuring the shortest path to D is
chosen

3. Practical Exercise:
Solve the Missionaries and Cannibals problem using any of the search strategies (DFS,
BFS, or UCS). Clearly explain your approach and provide the solution steps.

Approach:
Use BFS to explore all possible moves while ensuring no missionaries are eaten.
Track visited states to avoid loops.
If the goal state (0,0,1) is reached, return the sequence of moves.
Solution Steps:
Steps Left Side Right Side Move
1 (3,3,0) (0,0,1) Start
2 (3,1,1) (0,2,0) Move 2 cannibal
3 (3,2,0) (0,1,1) Return with 1
cannibal
4 (3,0,1) (0,3,0) Move 2 cannibal
5 (3,1,0) (0,2,1) Return with 1
missionary
6 (2,1,1) (1,2,0) Move 2
missionary
7 (3,1,0) (0,2,1) Return with 1
missionary
8 (1,1,1) (2,2,0) Move 2
missionary
9 (2,2,0) (1,1,1) Return with 1
cannibal
10 (0,2,1) (3,1,0) Move 2
missionary
11 (1,1,0) (2,2,1) Return with 1
missionary
12 (0,0,1) (3,3,0) Move final 2
missionary

You might also like