1
Game Theory and NE for AI
The fundamentals of game
theory, including Nash
equilibrium
2
Today
 Introduction to game theory
 We can look at market situations with
two players (typically firms)
 Although we will look at situations where
each player can make only one of two
decisions, theory easily extends to three
or more decisions
3
John Nash “A Beautiful Mind”
 One of the early
researchers in
game theory
 His work
resulted in a
form of
equilibrium
named after
him
4
Three elements in every
game
 Players
 Two or more for most games that are
interesting
 Strategies available to each player
 Payoffs
 Based on your decision(s) and the
decision(s) of other(s)
5
Prisoner’s Dilemma
Players?
Strategies?
Payoffs?
6
New Situation of Earning Profits
7
Game theory: Payoff matrix
(new situation of profit)
 A payoff
matrix
shows the
payout to
each
player,
given the
decision
of each
player
Action C Action D
Action
A
10, 2 8, 3
Action
B
12, 4 10, 1
Person
1
Person 2
8
How do we interpret this
box?
 The first number in
each box
determines the
payout for Person 1
 The second
number
determines the
payout for Person 2
Action
C
Action
D
Action
A
10, 2 8, 3
Action
B
12, 4 10, 1
Perso
n 1
Person 2
9
How do we interpret this
box?
 Example
 If Person 1
chooses Action A
and Person 2
chooses Action
D, then Person 1
receives a payout
of 8 and Person 2
receives a payout
of 3
Action
C
Action
D
Action
A
10, 2 8, 3
Action
B
12, 4 10, 1
Perso
n 1
Person 2
10
Back to a Core Principle:
Equilibrium
 The type of equilibrium we are looking for
here is called Nash equilibrium
 Nash equilibrium: “Any combination of
strategies in which each player’s strategy is
his or her best choice, given the other players’
choices”
 Exactly one person deviating from a NE
strategy would result in the same payout or
lower payout for that person.
11
Nash Equilibrium
 (In economics and game theory) a
stable state of a system involving the
interaction of different participants, in
which no participant can gain by a
unilateral change of strategy if the
strategies of the others remain
unchanged.
12
How do we find Nash
equilibrium (NE)?
 Step 1: Pretend you are one of the players
 Step 2: Assume that your “opponent” picks a
particular action
 Step 3: Determine your best strategy (strategies),
given your opponent’s action
 Underline any best choice in the payoff matrix
 Step 4: Repeat Steps 2 & 3 for any other opponent
strategies
 Step 5: Repeat Steps 1 through 4 for the other
player
 Step 6: Any entry with all numbers underlined is
NE
13
Steps 1 and 2
 Assume
that you
are Person
1
 Given that
Person 2
chooses
Action C,
what is
Person 1’s
best
Action
C
Action D
Action
A
10, 2 8, 3
Action
B
12, 4 10, 1
Perso
n 1
Person 2
14
Step 3:
 Underline
best payout,
given the
choice of
the other
player
 Choose
Action B,
since 12
> 10 
underline
12
Action
C
Action D
Action
A
10, 2 8, 3
Action
B
12, 4 10, 1
Perso
n 1
Person 2
15
Step 4
 Now
assume
that
Person 2
chooses
Action D
 Here,
10 > 8 
Choose
and
underline
Action C Action
D
Action
A
10, 2 8, 3
Action
B
12, 4 10, 1
Perso
n 1
Person 2
16
Step 5
 Now,
assume you
are Person 2
 If Person 1
chooses A
 3 > 2 
underline 3
 If Person 1
chooses B
 4 > 1 
underline 4
Action C Action D
Action
A
10, 2 8, 3
Action
B
12, 4 10, 1
Perso
n 1
Person 2
17
Step 6
 Which
box(es) have
underlines
under both
numbers?
 Person 1
chooses B
and Person
2 chooses
C
 This is the
only NE
Action C Action D
Action
A
10, 2 8, 3
Action
B
12, 4 10, 1
Perso
n 1
Person 2
18
Double check our NE
 What if
Person 1
deviates
from NE?
 Could
choose A
and get 10
 Person 1’s
payout is
lower by
deviating

Action C Action D
Action
A
10, 2 8, 3
Action
B
12, 4 10, 1
Perso
n 1
Person 2
19
Double check our NE
 What if
Person 2
deviates
from NE?
 Could
choose D
and get 1
 Person 2’s
payout is
lower by
deviating

Action C Action D
Action
A
10, 2 8, 3
Action
B
12, 4 10, 1
Perso
n 1
Person 2
20
Dominant strategy
 A strategy is
dominant if
that choice is
definitely
made no
matter what
the other
person
chooses
 Example:
Person 1 has a
dominant
strategy of
Action C Action D
Action
A
10, 2 8, 3
Action
B
12, 4 10, 1
Perso
n 1
Person 2
21
New example
 Suppose in
this example
that two
people are
simultaneous
ly going to
decide on
this game
Yes No
Yes 20, 20 5, 10
No 10, 5 10, 10
Perso
n 1
Person 2
22
New example
 We will go
through the
same steps
to determine
NE
Yes No
Yes 20, 20 5, 10
No 10, 5 10, 10
Perso
n 1
Person 2
23
Two NE possible
 (Yes, Yes) and
(No, No) are
both NE
 Although (Yes,
Yes) is the
more efficient
outcome, we
have no way to
predict which
outcome will
actually occur
Yes No
Yes 20, 20 5, 10
No 10, 5 10, 10
Perso
n 1
Person 2
24
Two NE possible
 When there are multiple NE that are
possible, economic theory tells us
little about which outcome occurs
with certainty
25
Two NE possible
 Additional information or actions may
help to determine outcome
 If people could act sequentially instead
of simultaneously, we could see that 20,
20 would occur in equilibrium
26
Sequential decisions
 Suppose that decisions can be made
sequentially
 We can work backwards to determine
how people will behave
 We will examine the last decision first
and then work toward the first decision
 To do this, we will use a decision tree
27
Decision tree in a sequential
game: Person 1 chooses
first
A
B
C
Person
1
chooses
yes
Person
1
chooses
no
Person 2
chooses
yes
Person 2
chooses
yes
Person 2
chooses no
Person 2
chooses
no
20, 20
5, 10
10, 5
10, 10
28
Decision tree in a sequential
game: Person 1 chooses
first
 Given point B,
Person 2 will
choose yes
(20 > 10)
 Given point C,
Person 2 will
choose no
(10 > 5)
A
B
C
Person
1
chooses
yes
Person
1
chooses
no
Person 2
chooses
yes
Person 2
chooses
yes
Person 2
chooses no
Person 2
chooses
no
20, 20
5, 10
10, 5
10, 10
29
Decision tree in a sequential
game: Person 1 chooses
first
 If Person 1 is
rational, she will
ignore potential
choices that
Person 2 will not
make
 Example: Person
2 will not choose
yes after Person 1
chooses no
A
B
C
Person
1
chooses
yes
Person
1
chooses
no
Person 2
chooses
yes
Person 2
chooses
yes
Person 2
chooses no
Person 2
chooses
no
20, 20
5, 10
10, 5
10, 10
30
Decision tree in a sequential
game: Person 1 chooses
first
 If Person 1 knows
that Person 2 is
rational, then she
will choose yes,
since 20 > 10
 Person 2 makes a
decision from
point B, and he
will choose yes
also
 Payout: (20, 20)
A
B
C
Person
1
chooses
yes
Person
1
chooses
no
Person 2
chooses
yes
Person 2
chooses
yes
Person 2
chooses no
Person 2
chooses
no
20, 20
5, 10
10, 5
10, 10
31
Summary
 Game theory
 Simultaneous decisions  NE
 Sequential decisions  Some NE may
not occur if people are rational
32
Can you think of ways game theory
can be used in these games?
33
Interesting Fact
• In 2014, with the Nobel Memorial Prize in
Economic Sciences went to game theorist Jean
Tirole for his analysis of market power and
regulation.
• Eleven game theorists have won the economics
Nobel Prize.
34
Reading/ Helping Material
https://en.wikipedia.org/wiki/Game_theory
The Mixed Strategy Algorithm:
https://www.youtube.com/watch?v=YRECCg7B_L0
Practice:
http://www.mikeshor.com/courses/gametheory/quizzes/quiz1.html
35
Questions?
Thank You!

07 Game Theory and Nash Equilibrium.pptx

  • 1.
    1 Game Theory andNE for AI The fundamentals of game theory, including Nash equilibrium
  • 2.
    2 Today  Introduction togame theory  We can look at market situations with two players (typically firms)  Although we will look at situations where each player can make only one of two decisions, theory easily extends to three or more decisions
  • 3.
    3 John Nash “ABeautiful Mind”  One of the early researchers in game theory  His work resulted in a form of equilibrium named after him
  • 4.
    4 Three elements inevery game  Players  Two or more for most games that are interesting  Strategies available to each player  Payoffs  Based on your decision(s) and the decision(s) of other(s)
  • 5.
  • 6.
    6 New Situation ofEarning Profits
  • 7.
    7 Game theory: Payoffmatrix (new situation of profit)  A payoff matrix shows the payout to each player, given the decision of each player Action C Action D Action A 10, 2 8, 3 Action B 12, 4 10, 1 Person 1 Person 2
  • 8.
    8 How do weinterpret this box?  The first number in each box determines the payout for Person 1  The second number determines the payout for Person 2 Action C Action D Action A 10, 2 8, 3 Action B 12, 4 10, 1 Perso n 1 Person 2
  • 9.
    9 How do weinterpret this box?  Example  If Person 1 chooses Action A and Person 2 chooses Action D, then Person 1 receives a payout of 8 and Person 2 receives a payout of 3 Action C Action D Action A 10, 2 8, 3 Action B 12, 4 10, 1 Perso n 1 Person 2
  • 10.
    10 Back to aCore Principle: Equilibrium  The type of equilibrium we are looking for here is called Nash equilibrium  Nash equilibrium: “Any combination of strategies in which each player’s strategy is his or her best choice, given the other players’ choices”  Exactly one person deviating from a NE strategy would result in the same payout or lower payout for that person.
  • 11.
    11 Nash Equilibrium  (Ineconomics and game theory) a stable state of a system involving the interaction of different participants, in which no participant can gain by a unilateral change of strategy if the strategies of the others remain unchanged.
  • 12.
    12 How do wefind Nash equilibrium (NE)?  Step 1: Pretend you are one of the players  Step 2: Assume that your “opponent” picks a particular action  Step 3: Determine your best strategy (strategies), given your opponent’s action  Underline any best choice in the payoff matrix  Step 4: Repeat Steps 2 & 3 for any other opponent strategies  Step 5: Repeat Steps 1 through 4 for the other player  Step 6: Any entry with all numbers underlined is NE
  • 13.
    13 Steps 1 and2  Assume that you are Person 1  Given that Person 2 chooses Action C, what is Person 1’s best Action C Action D Action A 10, 2 8, 3 Action B 12, 4 10, 1 Perso n 1 Person 2
  • 14.
    14 Step 3:  Underline bestpayout, given the choice of the other player  Choose Action B, since 12 > 10  underline 12 Action C Action D Action A 10, 2 8, 3 Action B 12, 4 10, 1 Perso n 1 Person 2
  • 15.
    15 Step 4  Now assume that Person2 chooses Action D  Here, 10 > 8  Choose and underline Action C Action D Action A 10, 2 8, 3 Action B 12, 4 10, 1 Perso n 1 Person 2
  • 16.
    16 Step 5  Now, assumeyou are Person 2  If Person 1 chooses A  3 > 2  underline 3  If Person 1 chooses B  4 > 1  underline 4 Action C Action D Action A 10, 2 8, 3 Action B 12, 4 10, 1 Perso n 1 Person 2
  • 17.
    17 Step 6  Which box(es)have underlines under both numbers?  Person 1 chooses B and Person 2 chooses C  This is the only NE Action C Action D Action A 10, 2 8, 3 Action B 12, 4 10, 1 Perso n 1 Person 2
  • 18.
    18 Double check ourNE  What if Person 1 deviates from NE?  Could choose A and get 10  Person 1’s payout is lower by deviating  Action C Action D Action A 10, 2 8, 3 Action B 12, 4 10, 1 Perso n 1 Person 2
  • 19.
    19 Double check ourNE  What if Person 2 deviates from NE?  Could choose D and get 1  Person 2’s payout is lower by deviating  Action C Action D Action A 10, 2 8, 3 Action B 12, 4 10, 1 Perso n 1 Person 2
  • 20.
    20 Dominant strategy  Astrategy is dominant if that choice is definitely made no matter what the other person chooses  Example: Person 1 has a dominant strategy of Action C Action D Action A 10, 2 8, 3 Action B 12, 4 10, 1 Perso n 1 Person 2
  • 21.
    21 New example  Supposein this example that two people are simultaneous ly going to decide on this game Yes No Yes 20, 20 5, 10 No 10, 5 10, 10 Perso n 1 Person 2
  • 22.
    22 New example  Wewill go through the same steps to determine NE Yes No Yes 20, 20 5, 10 No 10, 5 10, 10 Perso n 1 Person 2
  • 23.
    23 Two NE possible (Yes, Yes) and (No, No) are both NE  Although (Yes, Yes) is the more efficient outcome, we have no way to predict which outcome will actually occur Yes No Yes 20, 20 5, 10 No 10, 5 10, 10 Perso n 1 Person 2
  • 24.
    24 Two NE possible When there are multiple NE that are possible, economic theory tells us little about which outcome occurs with certainty
  • 25.
    25 Two NE possible Additional information or actions may help to determine outcome  If people could act sequentially instead of simultaneously, we could see that 20, 20 would occur in equilibrium
  • 26.
    26 Sequential decisions  Supposethat decisions can be made sequentially  We can work backwards to determine how people will behave  We will examine the last decision first and then work toward the first decision  To do this, we will use a decision tree
  • 27.
    27 Decision tree ina sequential game: Person 1 chooses first A B C Person 1 chooses yes Person 1 chooses no Person 2 chooses yes Person 2 chooses yes Person 2 chooses no Person 2 chooses no 20, 20 5, 10 10, 5 10, 10
  • 28.
    28 Decision tree ina sequential game: Person 1 chooses first  Given point B, Person 2 will choose yes (20 > 10)  Given point C, Person 2 will choose no (10 > 5) A B C Person 1 chooses yes Person 1 chooses no Person 2 chooses yes Person 2 chooses yes Person 2 chooses no Person 2 chooses no 20, 20 5, 10 10, 5 10, 10
  • 29.
    29 Decision tree ina sequential game: Person 1 chooses first  If Person 1 is rational, she will ignore potential choices that Person 2 will not make  Example: Person 2 will not choose yes after Person 1 chooses no A B C Person 1 chooses yes Person 1 chooses no Person 2 chooses yes Person 2 chooses yes Person 2 chooses no Person 2 chooses no 20, 20 5, 10 10, 5 10, 10
  • 30.
    30 Decision tree ina sequential game: Person 1 chooses first  If Person 1 knows that Person 2 is rational, then she will choose yes, since 20 > 10  Person 2 makes a decision from point B, and he will choose yes also  Payout: (20, 20) A B C Person 1 chooses yes Person 1 chooses no Person 2 chooses yes Person 2 chooses yes Person 2 chooses no Person 2 chooses no 20, 20 5, 10 10, 5 10, 10
  • 31.
    31 Summary  Game theory Simultaneous decisions  NE  Sequential decisions  Some NE may not occur if people are rational
  • 32.
    32 Can you thinkof ways game theory can be used in these games?
  • 33.
    33 Interesting Fact • In2014, with the Nobel Memorial Prize in Economic Sciences went to game theorist Jean Tirole for his analysis of market power and regulation. • Eleven game theorists have won the economics Nobel Prize.
  • 34.
    34 Reading/ Helping Material https://en.wikipedia.org/wiki/Game_theory TheMixed Strategy Algorithm: https://www.youtube.com/watch?v=YRECCg7B_L0 Practice: http://www.mikeshor.com/courses/gametheory/quizzes/quiz1.html
  • 35.

Editor's Notes

  • #32 Game theory can be applied in football to help teams make strategic decisions by considering the actions of opponents. Here’s how it can be used briefly: 1. **Penalty Kicks:** - The kicker and the goalkeeper are in a strategic "game." The kicker chooses whether to shoot left or right, and the goalkeeper decides which way to dive. - Each choice has potential payoffs, and game theory can help determine the best strategy by considering the opponent's likely actions (e.g., a mix of shooting left and right to stay unpredictable). 2. **Offensive and Defensive Strategies:** - Teams can use game theory to plan their attacking and defensive formations. For example, if a team usually attacks through the middle, the opponent might strengthen their defense in that area. - The attacking team can then use game theory to switch tactics and attack from the wings, keeping the opponent off balance. 3. **Play-Calling:** - Coaches can use game theory to decide which plays to call, based on the likelihood of the opponent's responses. For instance, alternating between passing and running plays to avoid being predictable. 4. **In-Game Decisions:** - Situations like deciding whether to go for a risky play or take a safer option can be modeled using game theory to maximize the team's chances of winning. In essence, game theory helps football teams anticipate opponents' actions and adjust strategies to optimize outcomes. Game theory can be applied to card games to help players **make strategic decisions** and **optimize their outcomes.** Here's a brief overview of how it can be used: 1. **Bluffing:** In games like **poker**, game theory can help determine the optimal frequency for bluffing (betting with a weak hand). It considers the probabilities of opponents having stronger hands and how they might react. 2. **Decision Making:** Players can use game theory to **assess risk and reward** when deciding whether to **fold, call, or raise** based on the cards they hold and the actions of other players. 3. **Mixed Strategies:** In some games, it’s better to use a **randomized or unpredictable strategy**. Game theory provides a framework for determining how often to take different actions to avoid being predictable. 4. **Equilibrium Strategies:** Game theory can identify **Nash Equilibria**, where each player’s strategy is optimal given the strategies of others. In card games, this means choosing actions that can't be exploited by opponents. In essence, game theory helps players **maximize their chances of winning** by making informed decisions based on the **strategies of their opponents** and the **available information.**
  • #34 Sure! Here's a summary of the document on game theory: --- **Game Theory Overview:** Game theory is the study of mathematical models of strategic interactions among rational decision-makers. It has applications in various fields such as economics, logic, systems science, and computer science. **Historical Development:** - **Early Origins:** Discussions on the mathematics of games date back to the 16th century with Cardano's work on games of chance. Pascal and Huygens further developed the concept of expectation in the 17th century. - **Modern Foundations:** John von Neumann's 1928 paper and his 1944 book with Oskar Morgenstern, "Theory of Games and Economic Behavior," laid the groundwork for modern game theory. - **Key Contributions:** John Nash introduced the Nash equilibrium in the 1950s, which applies to a wide variety of games. Other significant contributors include Reinhard Selten, John Maynard Smith, and many Nobel laureates. **Types of Games:** - **Cooperative vs. Non-Cooperative:** Cooperative games allow for binding commitments, while non-cooperative games do not. - **Symmetric vs. Asymmetric:** Symmetric games have identical strategies for all players, whereas asymmetric games do not. - **Zero-Sum vs. Non-Zero-Sum:** In zero-sum games, one player's gain is another's loss. Non-zero-sum games can have outcomes where all players benefit. - **Simultaneous vs. Sequential:** Simultaneous games involve players making decisions at the same time, while sequential games involve players making decisions one after another. **Applications and Models:** - **Economics:** Used to model behaviors of firms, markets, and consumers. Examples include Cournot and Bertrand competition models. - **Biology:** Explains phenomena such as evolutionary strategies and animal behavior. - **Political Science:** Models political processes, voting systems, and international relations. - **Computer Science:** Applied in algorithms, multi-agent systems, and artificial intelligence. **Key Concepts:** - **Nash Equilibrium:** A set of strategies where no player can benefit by unilaterally changing their strategy. - **Evolutionarily Stable Strategy (ESS):** A strategy that, if adopted by a population, cannot be invaded by any alternative strategy. - **Bayesian Games:** Games with incomplete information where players have beliefs about the types of other players. **Notable Games:** - **Prisoner's Dilemma:** Demonstrates why two rational individuals might not cooperate, even if it appears that it is in their best interest. - **Ultimatum Game:** Explores fairness and negotiation, where one player proposes a split of a sum of money and the other can accept or reject it. - **Trust Game:** Measures trust and reciprocity between players. --- This summary captures the key points and main arguments from the document. If you need more details on any specific section, feel free to ask! Source: Conversation with Copilot, 10/26/2024 (1) nash-wiki. https://nustedupk0-my.sharepoint.com/personal/hsardar_bscs22seecs_student_nust_edu_pk/_layouts/15/download.aspx?UniqueId=31037a68-7583-489a-a47d-814506c681f5&Translate=false&tempauth=v1.eyJzaXRlaWQiOiIwMTQ3M2I4NC03MjM2LTQxYWEtYjEwNS0yYmI3N2QxYjAxYjciLCJhcHBfZGlzcGxheW5hbWUiOiJPZmZpY2UgMzY1IFNlYXJjaCBTZXJ2aWNlIiwiYXBwaWQiOiI2NmE4ODc1Ny0yNThjLTRjNzItODkzYy0zZThiZWQ0ZDY4OTkiLCJhdWQiOiIwMDAwMDAwMy0wMDAwLTBmZjEtY2UwMC0wMDAwMDAwMDAwMDAvbnVzdGVkdXBrMC1teS5zaGFyZXBvaW50LmNvbUAxNTExYWIyZS01MDJiLTRlMmQtYmQ2OC1mNjc5ZjU0OWI1YTIiLCJleHAiOiIxNzI5OTMwODY0In0.CgoKBHNuaWQSAjY0EgsIooeDjJnmuj0QBRoNMjAuMTkwLjE1OS4zMyosWW8rT0N0R00zdkFQbTBncnNUK2VSK0dNSEJuR25BME1VclhBTERaY1p1QT0wrQE4AUIQoV2eAPwgAKBGmCBiSDFf1EoQaGFzaGVkcHJvb2Z0b2tlblIIWyJrbXNpIl1yKTBoLmZ8bWVtYmVyc2hpcHwxMDAzMjAwMjI2OWIwODFhQGxpdmUuY29tegEyggESCS6rERUrUC1OEb1o9nn1SbWikgEESGlyYZoBBlNhcmRhcqIBJ2hzYXJkYXIuYnNjczIyc2VlY3NAc3R1ZGVudC5udXN0LmVkdS5wa6oBEDEwMDMyMDAyMjY5QjA4MUGyATpteWZpbGVzLnJlYWQgbXlmaWxlcy53cml0ZSBhbGxmaWxlcy53cml0ZSBhbGxwcm9maWxlcy5yZWFkyAEB.99_Yg8aNRtkgBl32R8XePXpIC8QVScAhATfvECiNGOQ&ApiVersion=2.0?web=1.