Introduction to game theory
Course Overview:
![Insert image description here](https://img-blog.csdnimg.cn/08dd3dc9ebdb4d98a7139aab8268869a.png)
[Example] Select a number
Two participants, A and B, take turns choosing an integer from [3,4,5,6,7,8,9] (repeatable). When the cumulative total reaches 100, the game ends. At this time, the selected number will be judged so that the participants whose cumulative total reaches or exceeds 100 are the losers. Can A, who acts first, win this game? What is the optimal strategy?
[Answer]
The entire game process:
If the sum of the previously selected numbers can reach 97, 98, 99, then the next person will choose at least is 3, so it must be equal to or exceed 100. Then this person loses.
So how do we control A's choice in each round so that when B chooses in the last round, the sum of the numbers has reached 97, 98, 99, so that B will definitely lose?
That is to find the number we can control in each round.
Since we have observed that within the range of numbers we can choose, the maximum sum of the numbers selected by two people is 12, that is, we can always control the sum of each round to reach a fixed number of 12 through different number combinations. Then you can push forward one round at a time, and in the first round A should choose what number can win first. So the general idea is this:
According to backward induction, when the total is close to 100, the A who gets 99 will win, and the problem becomes grabbing 99. In the same way, the problem can be to grab 87[=99-(3+9)], 75, 63, 51, 39, 27, 15, 3. If you continue to work backwards, if you grab 3 first, you will win. If A chooses 3 first, A wins.
But if we don’t use the above strategy, what if A chooses 4 in the first round?
Then it will definitely lead to the fact that the sum of A and B must be less than 11 in the last round, and then it will be 99 when it is B's turn. But this is uncontrollable, because once B chooses 9, no matter what A chooses, the sum cannot be less than 11, so A directly loses the game.
Therefore, there is the following proposition:
[Proposition 1] In the digital game 1, the first mover has the only best response strategy (strategy) that must win.
Consider the situation of response pairs: In this example, we take the following: when A=3, B chooses X1, and A then chooses Y1, so that X1+Y1=12 (we call this situation A’s response to B ), and thus A is guaranteed to win. If A=3 (students can also try the situation where A is other numbers at the beginning, the situation may be a bit complicated), B adopts A+X1=12, followed by Y1+X2=12,..., we take this situation Call it B's reaction pair to A.
But if the first player chooses 3 in the first game, and then adopts a strategy that sums to 12, then no matter what response B makes, it will be useless, and B will face a situation where he must lose.
But if A does not choose 3 at the beginning, but chooses other numbers, then B has the only chance to win using the reaction strategy.
As shown in the figure below, A did not choose 3 in the first round, so he can only choose a number larger than 3. Then B controls the sum of the first round to 13, and B controls the sum to 12 in each subsequent round. Then the total is 12*6+13=85. Then in the last round, B can win as long as he controls the sum to 12, and depending on A's choice, he can also control it to 13 or 14, which are both sure-win strategies.
Therefore, there is the following proposition:
[Proposition 2] In the number game 1, if the number A≠3 is chosen by the first mover, then the second mover has the best response strategy (strategy) that must win, and for every number that is not equal to A of 3, this strategy (tactic) is unique.
What will happen if the participant who reaches or exceeds 100 is the winner?
According to the backward induction method, when the total is close to 100, the person who gets 88 will win, and the problem becomes grabbing 88. In the same way, the problem can be to grab 76, 64, 52, 40, 28, 16, 4, and continue to work backwards (
100-12n, when n=8, the remainder is 4), that is, the person who grabs 4 first will win. A, who acts first, chooses 4 first, then A wins.
[Example] Bash Game
There are n stones in a pile. Two people, A and B, take turns to take them. Each time they take at least 1 stone and at most m stones. The person who takes the last stone wins.
[Solution]
Suppose there are n=m+1 stones. Since only m stones can be taken at a time, no matter how many stones are taken by the first hand, the second hand can always take the remaining ones. In this case, the first hand must lose.
If stones n = (m+1)*r+s, the first player should take s stones first. Suppose the second player takes k stones, and the first player takes m+1-k. The remaining number of stones is (m+ 1)(r-1) Keep this method of taking from now on, and the one who takes first wins. In short, it is necessary to leave a multiple of m+1 to the opponent.
[Proposition 3] In the Bash game, if the number of stones n% (m + 1) = 0, the second player wins; if the number of stones n% (m + 1) ≠ 0, the first player wins.
[Example] Shooter game
Shooters A, B, and C draw lots to decide the order in which they will take turns to shoot and engage in a duel. A's hit rate is 100%, B's hit rate is 80%, and C's hit rate is 50%.
(1) If the shooting is done in order and C shoots first, what should he do?
(2) If the shooting is done in order, it proves that C has the greatest possibility of survival.
(3) If the person who shoots in each round is randomly selected, it proves that the probability of the shooter surviving is completely opposite to the hit rate.
[Answer]
There must be two goals to pursue: first, consider saving your life, and then consider who to shoot.
(1) If things proceed in order and C shoots first, what should he do?
Let π A ( ABC ) \pi_A(ABC)PiA( A BC ) means the probability of A surviving when all three are alive and shooting in the order of ABC. The other means have similar meanings.
①If C shoots someone else, he must shoot A. (Because you have to consider saving your life first, you will definitely give priority to shooting the person with a high hit rate)
If C hits A, then his payment isπ C ( BC ) \pi_C(BC)PiC( BC ) .
Because in the order BC, the probability of C surviving depends on B's hit rate. If B hits C, then C's survival probability is 0. So in this case, C's survival probability is 4 5 ∗ 0 = 0\ frac{4}{5}*0=054∗0=0 , if there is no hit (the probability is1 5 \frac{1}{5}51), it’s time for C to fight B.
So there is the formula: π C ( BC ) = π C ( CB ) / 5 \pi_C(BC)=\pi_C(CB)/5PiC(BC)=PiC(CB)/5
而 π C ( C B ) = 1 2 × 1 + 1 2 × π C ( B C ) = 1 2 × 1 + 1 2 × 1 5 π C ( C B ) \pi_C(C B)=\frac{1}{2} \times 1+\frac{1}{2} \times \pi_C(B C)=\frac{1}{2} \times 1+\frac{1}{2} \times \frac{1}{5} \pi_C(C B) PiC(CB)=21×1+21×PiC(BC)=21×1+21×51PiC( CB )
Then we can get:
π C (CB) = 5 9, π C (BC) = 1 9 (C hits A, the probability of C surviving) \pi_C(CB)=\frac{5}{9}, \pi_C(BC)=\frac{1}{9} (C hits A, probability of C surviving)PiC(CB)=95,PiC(BC)=91( C hits A , probability of C surviving )
The situation of not hitting A is such as ②:
② If C shoots into the air. Obviously A will shoot towards B instead of C, and B will shoot towards A instead of C. (Because you have to consider saving your life first, you will definitely give priority to shooting the person with a high hit rate). So A and B will shoot at each other until one of them is out, and then it's C's turn to shoot.
If A is a survivor of A and B shooting each other, then the probability of C surviving at this time is π C ( CA ) = 1 2 \pi_C(CA)=\frac{1}{2}PiC(CA)=21.
If B is a survivor of A and B shooting each other, then the probability of C surviving at this time is π C ( CB ) = 5 9 \pi_C(CB)=\frac{5}{9}PiC(CB)=95.
Because π C ( CB ) = 5 9 \pi_C(CB)=\frac{5}{9}PiC(CB)=95,π C ( CA ) = 1 2 \pi_C(CA)=\frac{1}{2}PiC(CA)=21,indefinitely C ( BC ) = 1 9 \pi_C(BC)=\frac{1}{9}PiC(BC)=91. Therefore, C shooting into the air is its best choice.
(2) If the shots are fired in order, it proves that C has the greatest probability of survival.
Proof: ① Assuming A shoots before B, the order may be CAB, ACB or ABC.
Because C is shot into the air, A must be sure to kill B, so
π C ( CAB ) = π C ( ACB ) = π C ( ABC ) = 1 2 \pi_C(CAB)=\pi_C(ACB)=\pi_C(ABC )=\frac{1}{2}PiC(CAB)=PiC(ACB)=PiC(ABC)=21
You can get it:
π A ( CAB ) = π A ( ACB ) = π A ( ABC ) = 1 2 \pi_A(CAB)=\pi_A(ACB)=\pi_A(ABC)=\frac{1}{2}PiA(CAB)=PiA(ACB)=PiA(ABC)=21
② Assuming that B shoots before A, the order is CBA, BCA or BAC. There are three possibilities. Then B will shoot towards A, and the probability of hitting is 4/5, so
π C ( CBA ) = π C ( BCA ) = π C ( BAC ) = 4 5 π C ( CB ) + 1 5 π C ( CA ) = 4 5 × 5 9 + 1 5 × 1 2 = 49 90 \begin{aligned} \pi_C(CBA) & =\pi_C(BCA)=\pi_C(BAC) \\ & =\frac{4}{5 } \pi_C(CB)+\frac{1}{5} \pi_C(CA) \\ & =\frac{4}{5} \times \frac{5}{9}+\frac{1}{5 } \times \frac{1}{2}=\frac{49}{90} \end{aligned}PiC(CBA)=PiC(BCA)=PiC(BAC)=54PiC(CB)+51PiC(CA)=54×95+51×21=9049
此外
π A ( C B A ) = π A ( B C A ) = π A ( B A C ) = 4 5 × 0 + 1 5 × 1 2 = 1 10 π B ( C B A ) = 4 5 × 4 9 + 1 5 × 0 = 16 45 \begin{aligned} \pi_A(C B A)=\pi_A(B C A)=\pi_A(B A C)\\ =\frac{4}{5} \times 0+\frac{1}{5} \times \frac{1}{2}=\frac{1}{10} \\ \pi_B(C B A) & =\frac{4}{5} \times \frac{4}{9}+\frac{1}{5} \times 0=\frac{16}{45} \end{aligned} PiA(CBA)=PiA(BCA)=PiA(BAC)=54×0+51×21=101PiB(CBA)=54×94+51×0=4516
(3) If the person who shoots in each round is randomly selected, it proves that the survival rate is completely opposite to the hit rate.
【Proof】Suppose π A [ A ] \pi_A[A]PiA[ A ] represents the survival probability of A when A fires the first shot,π A \pi_APiARepresents the overall survival probability of A, π A { AB } \pi_A\left\{AB\right\}PiA{
A B } means that it is arbitrary who of the two AB shoots the first shot. The rest are expressed similarly.
If the player who shoots in the next round chooses arbitrarily, the result is still that A and B will shoot each other until only one of them survives. In any case, it is clear that C prefers to compete one-on-one with B rather than A, so if C has the opportunity to shoot, he will shoot at A.
Now analyze the situation of two people:
π A { AB } = 1 2 × 1 + 1 2 × 1 5 π A { AB } π A { AB } = 5 9 , π B { AB } = 4 9 \begin{aligned} & \pi_A\{AB\}=\frac{1}{2} \times 1+\frac{1}{2} \times \frac{1}{5} \pi_A\{AB\} \\ & \ pi_A\{AB\}=\frac{5}{9}, \quad \pi_B\{AB\}=\frac{4}{9} \end{aligned}PiA{
AB}=21×1+21×51PiA{
AB}PiA{
AB}=95,PiB{
AB}=94
以此类推:
π A { A C } = 1 2 × 1 + 1 2 × ( 1 2 × π A { A C } ) \pi_A\{A C\}=\frac{1}{2} \times 1+\frac{1}{2} \times\left(\frac{1}{2} \times \pi_A\{A C\}\right) PiA{
AC}=21×1+21×(21×PiA{
A C } )
Letπ A { AC } = 2 3 , π C { AC } = 1 3 \pi_A\{AC\}=\frac{2}{3}, \pi_C\{AC\}=\ frac{1}{3}PiA{
AC}=32,PiC{
AC}=31
进而有:
π B { B C } = 1 2 × [ 4 5 × 1 + 1 5 π B { B C } ] + 1 2 × 1 2 π B { B C } \pi_B\{B C\}=\frac{1}{2} \times\left[\frac{4}{5} \times 1+\frac{1}{5} \pi_B\{B C\}\right]+\frac{1}{2} \times \frac{1}{2} \pi_B\{B C\} PiB{
BC}=21×[54×1+51PiB{
BC}]+21×21PiB{
BC }
π B { BC } = 8 13 π C { BC } = 5 13 \begin{aligned} & \pi_B\{BC\}=\frac{8}{13} \\ & \pi_C\{BC\ }=\frac{5}{13}\end{aligned}PiB{
BC}=138PiC{
BC}=135
Now, obviously:
π A [ A ] = π A { AC } = 2 3 , π B [ A ] = 0 , π C [ A ] = 1 3 \pi_A[A]=\pi_A\{AC\}=\ frac{2}{3}, \pi_B[A]=0, \pi_C[A]=\frac{1}{3}PiA[A]=PiA{
AC}=32,PiB[A]=0,PiC[A]=31
Similarly,
π B [ B ] = 4 5 π B { BC } + 1 5 π B , π A [ B ] = 1 5 π A π C [ B ] = 4 5 π C { BC } + 1 5 π C 和 π C [ C ] = 1 2 π C { BC } + 1 2 π C , π A [ C ] = 1 2 π A π B [ C ] = 1 2 π B { BC } + 1 2 π B \ begin{aligned} & \pi_B[B]=\frac{4}{5} \pi_B\{BC\}+\frac{1}{5} \pi_B, \pi_A[B]=\frac{1}{ 5} \pi_A \\ & \pi_C[B]=\frac{4}{5} \pi_C\{BC\}+\frac{1}{5} \pi_C \\ & \text { 和 } \pi_C[ C]=\frac{1}{2} \pi_C\{BC\}+\frac{1}{2} \pi_C, \pi_A[C]=\pi_1}{2} \pi_A\\ & \ pi_B[C]=\frac{1}{2} \pi_B\{BC\}+\frac{1}{2} \pi_B \end{aligned}PiB[B]=54PiB{
BC}+51PiB,PiA[B]=51PiAPiC[B]=54PiC{
BC}+51PiC Sum πC[C]=21PiC{
BC}+21PiC,PiA[C]=21PiAPiB[C]=21PiB{
BC}+21PiB
Let us have a simple solution:
π A = 1 3 [ 2 3 + 1 5 π A + 1 2 π A ] → π A = 20 69 π B = 1 3 [ 0 + 4 5 π B { BC } + 5 π B + 1 2 π B { BC } + 1 2 π B ] → π B = 24 69 π C = 1 3 [ 1 3 + 4 5 π C { BC } + 1 5 π C + 1 2 π C { BC } + 1 2 π C ] → π C = 25 69 \begin{aligned} & \pi_A=\frac{1}{3}\left[\frac{2}{3}+\frac{1}{5 } \pi_A+\frac{1}{2} \pi_A\right] \rightarrow \pi_A=\frac{20}{69}\\ & \pi_B=\frac{1}{3}\left[0+\frac {4}{5} \pi_B\{BC\}+\frac{1}{5} \pi_B+\frac{1}{2} \pi_B\{BC\}+\frac{1}{2} \pi_B \right] \rightarrow \pi_B=\frac{24}{69}\\ & \pi_C=\frac{1}{3}\left[\frac{1}{3}+\frac{4}{5} \pi_C\{BC\}+\frac{1}{5} \pi_C+\frac{1}{2} \pi_C\{BC\}+\frac{1}{2} \pi_C\right] \rightarrow\ pi_C=\frac{25}{69}\end{aligned}PiA=31[32+51PiA+21PiA]→PiA=6920PiB=31[0+54PiB{
BC}+51PiB+21PiB{
BC}+21PiB]→PiB=6924PiC=31[31+54PiC{
BC}+51PiC+21PiC{
BC}+21PiC]→PiC=6925
事有
π C > π B > π A \pi_C>\pi_B>\pi_APiC>PiB>PiA
Get certified.
(The video is the first section of 2.23)
Basic concepts of game theory:
Basic concepts of game theory: participants, strategies, actions, information, payoff functions, equilibrium results, etc.
- Elements (PAPI): game subject (participant), strategy (action), payment, information.
- Rules: participants, sequence of actions, balanced results.
participant
An individual or organization that makes independent decisions, acts independently and is responsible for the results.
"Natural": "Virtual participants"
are divided according to the number of participants:
- single player game
- Two person game
- multiplayer game
strategy
action
information
payoff function
[Example] Divide 100 yuan
Two people each report a non-negative integer that is at most 100. If the sum of the numbers reported does not exceed 100, each person will get the amount of money reported (the excess money will be confiscated); if the sum of the numbers reported by two people exceeds 100 and the numbers are different, the person who reported the smaller number will get If the sum of the numbers quoted by the two people exceeds 100 and the number is the same, each person will get 50 yuan.
[Solution] Three elements of the game:
Set of participants: N = { 1 , 2 } N=\left\{1,2\right\}N={
1,2 }
Strategy set:S t = { 0 , 1 , 2... , 100 } , t = 1 , 2 S_t=\left\{0,1,2...,100\right\},t=1 ,2St={
0,1,2...,100},t=1,2
participantsii_Payment of i
: ui = { si when si + sj ≤ 100 ( i , j = 1 or 2 ) si when si + sj > 100 , and si < sj 100 − sj when si + sj > 100 , and si > sj 50 When si + sj > 100 , and si = sj u_i= \begin{cases}s_i & \text { when } s_i+s_j \leq 100(i, j=1 \text { or } 2) \\ s_i & \text { when } s_i+s_j>100, \text { and } s_i<s_j \\ 100-s_j & \text { when } s_i+s_j>100, \text { and } s_i>s_j \\ 50 & \text { when } s_i+s_j>100, \text { and} s_i=s_j\end{cases}ui=⎩
⎨
⎧sisi100−sj50 when si+sj≤100(i,j=1 or 2 ) when si+sj>100, And si<sj when si+sj>100, And si>sj when si+sj>100, And si=sj