Professional Documents
Culture Documents
Artificial Intelligence
Artificial Intelligence
Artificial Intelligence
Intelligence
Spring – 2023
Course Details
• Teaching Methodology: Teacher-Centered
• Text / Reference Book: S. Russell and P. Norvig: Artificial Intelligence: A
Modern Approach. Pearson, 2010, 3rd Edition
• Course Assessment
• Quiz: 10% (3-5)
• Assignments: 5% (3-5)
• Midterm Exam: 30%
• Projects: 15% (1-2)
• Final Exam: 40%
• Mode of Communication: Email: huma.jabeen@dsu.edu.pk
• Submissions: Via LMS Or Hard Copies
Department of Computer Science – DHA Suffa University 2
Origin of Artificial
Intelligence
The purpose of the first computer is to
break the German communication system.
Department of Computer Science – DHA Suffa University 3
Alan Turing
Major Contribution
“The study and design of intelligent agents, where an intelligent agent is a system
that perceives its environment and takes actions that maximize its chances of
success.”
Russel and Norvig AI book
• Problems:
1. Not all knowledge can be expressed with logical notations.
2. Computational blow up.
Mathematics Neuroscience
Linguistics
AI Psychology
Control
Theory & Philosophy
Cybernetics
Informed Search (use heuristic to reach the goal faster): Greedy search, A*,
etc.
Explore + Execute
Department of Computer Science – DHA Suffa University 49
Adversarial Search: games
Solved games!
Checkers:
• Chinook ended 40-year-reign of human world champion Marion Tinsley in
1994.
• Used an endgame database defining perfect play for all positions involving 8
or fewer pieces on the board, a total of 443,748,401,247 positions.
• We don’t care about the path but about the goal itself.
• Solving the CSP: finding the assignment(s) that satisfy all constraints.
Environment
Percepts
?
Action
Actuators
• An agent program runs in cycles of: (1)perceive, (2)think, and (3)act
• Agent = Architecture + Program
Department of Computer Science – DHA Suffa University 61
Agents and environments
• Human agent:
―Sensors: eyes, ears, and other organs.
―Actuators: hands, legs, mouth, and other body parts.
• Robotic agent:
―Sensors: Cameras and infrared range finders.
―: Various motors.
• Software Agents:
―Sensors: keystrokes, file contents, and network packets
―Actuators: displaying on the screen, writing files, and sending network packets
• Agents everywhere!
―Thermostat
―Cell phone
―Vacuum cleaner
―Robot
―Alexa Echo
―Self-driving car
―Human
Department of Computer Science – DHA Suffa University 62
Vacuum cleaner
• Performance
• Environment
• Actuators
• Sensors
Department of Computer Science – DHA Suffa University 67
PEAS
What is PEAS for a self-driving car?
• Performance
• Environment
• Actuators
• Sensors
Environment
Percepts
What the world is like now?
Condition-
What action I should do now?
action-rule
Action
Actuators
Department of Computer Science – DHA Suffa University 84
Simple reflex agents
Environment
State
How the world What the world is like now?
evolves
What my actions do
Condition-
What action I should do now?
action-rule
Action
Actuators
Department of Computer Science – DHA Suffa University 88
Model-based reflex agents
Environment
What it will be like if I do the
action A
Action
Actuators
Department of Computer Science – DHA Suffa University 91
Utility-based agents
• Sometimes achieving the desired goal is not enough. We may look for
quicker, safer, cheaper trip to reach a destination.
• Agent happiness should be taken into consideration. We call it utility.
• A utility function is the agent’s performance measure
• Because of the uncertainty in the world, a utility agent choses the
action that maximizes the expected utility.
Environment
What it will be like if I do the
action A
Action
Actuators
Department of Computer Science – DHA Suffa University 93
Learning agents
• Programming agents by hand can be very tedious. “Some more
expeditious method seem desirable” Alan Turing, 1950.
• Four conceptual components:
―Learning element: responsible for making improvements
―Performance element: responsible for selecting external actions. It is what we
considered as agent so far.
―Critic: How well is the agent is doing w.r.t. a fixed performance standard.
―Problem generator: allows the agent to explore.
Feedback
Environment
changes
Learning Performance
Elements Elements
Knowledge
Learning
Goals
Problem Action
Generator Actuators
B A
• Depth-first search
• Bidirectional Search
Note: Backtracking is an algorithm technique for finding all possible solutions using recursion.
• Time Complexity: much larger than 𝑏 𝑑 , and just 𝑏 𝑑 , if all steps have the
same cost.
• Optimal: Yes
2'nd Iteration----> A, B, C
3'rd Iteration------>A, B, D, E, C, F, G
4'th Iteration------>A, B, D, H, I, E, C, F, K, G
• This knowledge help agents to explore less to the search space and
find more efficiently the goal node.
Iteration3: {(S--> A-->C--->G, 6), (S--> A-->C--->D, 11), (S--> A-->B, 7), (S-->G, 10)}
Iteration 4 will give the final result, as S--->A--->C--->G it provides the optimal path with cost 6.
•A* algorithm returns the path which occurred first, and it does not
search for all remaining paths.
•A* algorithm expands all nodes which satisfy the condition f(n)