0% found this document useful (0 votes)
106 views93 pages

Unit 3 PPT Ai

The document discusses artificial intelligence concepts including adversarial search, game theory, mini-max algorithm, alpha-beta pruning, Monte Carlo tree search, stochastic games, partially observable games, constraint satisfaction problems, backtracking search, and examples like graph coloring.

Uploaded by

sanudantal42003
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)
106 views93 pages

Unit 3 PPT Ai

The document discusses artificial intelligence concepts including adversarial search, game theory, mini-max algorithm, alpha-beta pruning, Monte Carlo tree search, stochastic games, partially observable games, constraint satisfaction problems, backtracking search, and examples like graph coloring.

Uploaded by

sanudantal42003
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/ 93

310253 Artificial Intelligence

• Lecture: 4 hours/week
• MidSem: 30 Marks
• EndSem : 70 Marks

https://itempool.com/Rajeswaripccoe/live

11
Which country gave the citizenship to the first humanoid

In 2017, social robot Sophia was given citizenship of


Saudi Arabia – the first robot to be given legal
personhood anywhere in the world.

2
True Father of AI

Alan Mathison Turing


Theoretical work. The earliest
substantial work in the field of
artificial intelligence was done in
the mid-20th century by the British
logician and computer pioneer Alan
Mathison Turing. (1950)

John McCarthy

3
Company that Created a processor that works with the help of
AI, called the Tensor Processing Unit (TPU)

•Google's parent company, Alphabet, has created a processor


that works with the help of AI, called the Tensor Processing Unit
(TPU).
•It is designed to make its advertising, search, Gmail, Google
Photos, and other services smarter.

4
Course Outcomes
• CO1: Identify and apply suitable Intelligent agents for
various AI applications
• CO2: Build smart system using different informed search /
uninformed search or heuristic approaches
• CO3: Identify knowledge associated and represent it by
ontological engineering to plan a strategy to solve given
problem
• CO4: Apply the suitable algorithms to solve AI problems
• CO5: Implement ideas underlying modern logical inference
systems
• CO6: Represent complex problems with expressive yet
carefully constrained language of representation

5
Unit 3 –Adversarial Search and
Games(7 hours)
• Game Theory
• Optimal Decisions in Games
• Heuristic alpha–beta tree search
• Monte carlo tree search
• Stochastic games
• Partially observable games
• Limitations of game search algorithms
• Constraint satisfaction problems (csp)
• Constraint propagation: inference in csps,
backtracking search for csps.
6
Adversarial Searches
● Some situations where more than one agent is searching
for the solution in the same search space
Example : - Game Playing - Chess, Tic-Tac-Toe

7
Adversarial Searches
● The environment with more than one agent is termed as
multi-agent environment, in which each agent is an
opponent of other agent and playing against each other.
● Real-life Example: Playing a soccer match is a multi-agent
environment.

8
Adversarial Searches
• Searches in which two or more players with conflicting
goals are trying to explore the same search space for the
solution, are called adversarial searches, often known as
Games.

9
Adversarial Searches

10
Adversarial Searches

11
Game Playing
Why do AI researchers study game playing?

1. It’s a good reasoning problem, formal and nontrivial.

2. Direct comparison with humans and other computer


programs is easy.

12
What Kinds of Games?
Mainly games of strategy with the following characteristics:

1. Sequence of moves to play


2. Rules that specify possible moves

3. Rules that specify a payment for each move


4. Objective is to maximize your payment

13
Games as Adversarial Search
• States: – board configurations
•Initial state: – the board position and which player will
move
•Successor function: – returns list of (move, state) pairs,
each indicating a legal move and the resulting state
• Terminal test: – determines when the game is over
•Utility function: – gives a numeric value in terminal states
(e.g., -1, 0, +1 for loss, tie, win)

14
Game Tree for Tic-Tac-Toe (2-player,
Deterministic, Turns)

15
Mini-Max Algorithm

16
Mini-Max Algorithm

17
Mini-Max Terminology

18
Alpha-Beta Pruning/ Agorithm

19
Alpha-Beta Pruning/
Agorithm

20
Alpha-beta Tree search
• Depth first search
–only considers nodes along a single path from root at any time

alpha = highest-value choice found at any choice point of path for
MAX
(initially, α = −infinity)
beta = lowest-value choice found at any choice point of path for MIN
(initially, β = +infinity)
• Pass current values of α and β down to child nodes during search.
•Update values of α and β during search:
–MAX updates a at MAX nodes
–MIN updates b at MIN nodes
• Prune remaining branches at a node when alpha ≥ beta
21
Alpha-Beta

22
Working of Alpha-Beta Pruning:

23
24
25
26
Monte-Carlo Tree Search
● MCTS is about approximate inference (propagation or
pruning: exact inference)

● MCTS is related to Machine Learning

● It is a probabilistic and heuristic driven search algorithm

● Combines the classic tree search implementations


alongside machine learning principles of reinforcement
learning.

27
Monte-Carlo Tree Search
•Monte Carlo Tree Search is a search technique in Artificial
Intelligence.
•This has recently been used by Artificial Intelligence
Programs like AlphaGo, to play against the world's top Go
players.
•Monte Carlo methods have been used for decades to predict
outcomes probabilistically.
•In MCTS, nodes are the building blocks of the search tree.
•These nodes are formed based on the outcome of a number
of simulations.

28
Monte-Carlo Search

29
Monte-Carlo Tree Search

The process of Monte Carlo Tree Search can be broken


down into four distinct steps, viz.,
• selection,
• expansion,
• simulation and
• backpropagation.

30
Monte-Carlo Tree Search

31
Principle of Operation

32
V1 is the value of some node Eg 30/46
C1 is a constant
n is the current position , 83 [ no of time in
current position ]
ni is the no of times u have playeKdR@BoS_SPPU_FDP_AI_24thJan2022 33
23
34
35
36
37
38
39
40
Stochastic Game
•Stochastic game is repeated game with
probabilistic/stochastic transitions.
•Unpredictable in nature, such as those involving dice
throw.
• Outcome depends on skills as well as luck.
• Transition probabilities depend upon actions of players.
•Ludo, Cards, dice throw, backgammon, golf ball,
gambling game.
•Two player stochastic game : 2 and 1/2 player game. e-
Enterprise Lab Ex: Prisoner’s Dilemma

41
42
43
Stochastic Game

Chance

44
Stochastic Game

45
Stochastic Game

46
Partially observable games

47
Limitations of Game Search Algorithms

48
Constraint satisfaction technique.
• Problem-solving technique
• Constraint satisfaction means solving a problem
under certain constraints or rules.

Constraint satisfaction depends on three


components, namely:
● X: It is a set of variables.
● D: It is a set of domains where the variables reside.
There is a specific domain for each variable. Like 5 is
a number which is in integer domain
● C: It is a set of constraints which are followed by the
set of variables.
49
Constraint Satisfaction Problem.

50
Backtracking search for CSPs

• Backtracking search, a form of depth-first search.


• Intelligent backtracking in CSP.
• A depth-first search that chooses values for one variable
at a time and backtracks when a variable has no legal
values left to assign.

51
Map Coloring

52
Map Coloring

53
Backtracking Example

54
Backtracking Example

55
56
57
Backtracking Search

58
Examples:
Graph Coloring: The problem where the constraint is that no
adjacent sides can have the same color.

59
CSP – Graph colouring
• 1 2

• 3 4

V = {1,2,3,4}
D={ RED, GREEN, BLUE}
C = {1# 2, 1#3, 1#4, 2#4, 3#4}
60
SOLUTION
1 2 3 4

1=R R G,B G,B G,B


2=G R G GB B
(3 IS NOT
NEIGHBO
H OF 2)
3=B R G B EMPTY(PR
OBLEM
NOT
SOLVED)

61
SOLUTION –BACK TRACKING
1 2 3 4

1=R R G,B G,B G,B


2=G R G GB B
(3 IS NOT
NEIGHBO
H OF 2)
3=B R G B EMPTY(PR
OBLEM
NOT
G SOLVED)
B

62
CSP – Graph colouring-Solution
• R G

• G B

63
64
65
66
Minimum remaining values
checking

67
Degree heuristic

68
Least constraining value

69
Forward checking

70
Forward checking

71
Forward checking

72
Forward checking

73
Propagating Information through
constraints

74
75
76
77
78
79
80
Crypt Arithmetic
❑ Cryptarithmetic Problem is a type of constraint satisfaction
problem
❑ where the game is about digits and its unique replacement
either with alphabets or other symbols.
❑ In cryptarithmetic problem, the digits (0-9) get substituted by
some possible alphabets or symbols.
❑ The task in cryptarithmetic problem is to substitute each digit
with an alphabet to get the result arithmetically correct.
❑ The rules are that all occurrences of a letter must be assigned
the same digit
❑ No digit can be assigned to more than one letter.

81
Crypt arithmetic problem
B A S E

B A L L

---------------------------------

G A M E S

82
Crypt arithmetic problem

83
Crypt arithmetic problem

84
Each puzzle has one or many solutions or no solution

85
Crypt arithmetic problem

86
87
Crypt arithmetic problem
1. From Column 5, M=1, since it is only carry-over possible
from sum of 2 single digit number in column 4.
2. To produce a carry from column 4 to column 5 ‘S + M’ is
at least 9 so ‘S=8or9’ so ‘S+M=9or10’ & so ‘O=0or1’ .
But ‘M=1’, so ‘0=0’.
3. If there is carry from column 3 to 4 then ‘E=9’ & so
‘N=0’. But ‘O=0’ so there is no carry & ‘S=9’ & ‘c3=0’.
4. If there is no carry from column 2 to 3 then ‘E=N’ which
is impossible, therefore there is carry & ‘N=E+1’ &
‘c2=1’.
5. If there is carry from column 1 to 2 then ‘N+R=E mod
10’ & ‘N=E+1’ so ‘E+1+R=E mod 10’, so ‘R=9’ but
‘S=9’, so there must be carry from column 1 to 2.
Therefore ‘c1=1’ & ‘R=8’. 88
6. To produce carry ‘c1=1’ from column 1 to 2,
we must have ‘D+E=10+Y’ as Y cannot be 0/1
so D+E is at least 12. As D is at most 7 & E is
at least 5(D cannot be 8 or 9 as it is already
assigned). N is atmost 7 & ‘N=E+1’ so
‘E=5or6’.
7. If E were 6 & D+E atleast 12 then D would be
7, but ‘N=E+1’ & N would also be 7 which is
impossible. Therefore ‘E=5’ & ‘N=6’.
8. D+E is atleast 12 for that we get ‘D=7’ &
‘Y=2’.

89
Examples:
● Sudoku Playing: The game play where the constraint
is that no number from 0-9 can be repeated in the

same row or column. Total 81(9*9) places(variables).

In each box, 1-9 is the domain -can be written.

● n-queen problem: In n-queen problem, the constraint


is that no queen should be placed either diagonally, in

the same row or column.

90
Constraint propagation: Inference in CSPs

•Anumber of inference techniques use the constraints to infer


which variable/value pairs are consistent and which are not.
These include node, arc, path, and k-consistent.

•Constraint propagation: Using the constraints to reduce the


number of legal values for a variable, which in turn can reduce
the legal values for another variable, and so on.

91
Case Study
• Machine Learning At Google: The Amazing
Use Case Of Becoming A Fully Sustainable
Business

92
To summarize:: Unit 3 –Adversarial
Search and Games(7 hours)
• Game Theory
• Optimal Decisions in Games
• Heuristic alpha–beta tree search
• Monte carlo tree search
• Stochastic games
• Partially observable games
• Limitations of game search algorithms
• Constraint satisfaction problems (csp)
• Constraint propagation: inference in csps,
backtracking search for csps.
93

You might also like