Saturday, June 23, 2012

Rock Paper Scissors

The best game ever? If you don't know RPS, I feel bad for you. What is the optimal way to play? Is there a way to get an advantage? I think so...



Single Hand

Lets model the throw of a single hand from player one's perspective where a win is 1, a draw is 0 and a loss is -1:
      P2
      R  P  S
   R  0 -1  1
P1 P  1  0 -1
   S -1  1  0

A mixed strategy equilibrium exists by solving for the $r=P(P1,R),\ p=P(P1,P)$ and $s=P(P1,s)$ that make P2 indifferent to playing R, P or S. Specifically make $E[P2,R]=E[P2,P]=E[P2,S]$ where $r+p+s=1$.

$E[P2,R]=p-s$
$E[P2,P]=s-r$
$E[P2,S]=r-p$


these series of equations yield $r=p=s=\frac{1}{3}$

Due to symmetry, each player should play randomly assing a 1/3 probability to Rock, Paper and Scissors...and there is no advantage to be had.

Best of Three

Generally, people play a best-of-three format where ties don't count; the first person to win two throws is the champ. Theoretically, this game could go on forever and for two informed players who throw optimally it is equivalent to just tossing a coin. The fun of the game exists because we cannot think randomly, by definition, so no one can perfectly play each hand with a 1/3 chance. Strategies evolve as a result...

However, with a little tweak in the game and some more analysis we'll see that a player can find a way to bias the coin in their favor.

Best of Three, Ties Count

I generally propose playing RPS in the same fashion as above with one exception: ties count. The best total score after three tosses wins. In the event of a draw (same final score), continue with single "elimination match" throws to determine the winner.

To analyze this game, assume that each player determines a set of three throws before the match even begins. There are 27 (3^3) possible hands: {RRR, RRP, RRS, RPR, RPP, RPS, RSR, RSP, RSS, PRR, PRP, PRS, PPR, PPP, PPS, PSR, PSP, PSS, SRR, SRP, SRS, SPR, SPP, SPS, SSR, SSP, SSS}. For example, player 1 may know he is going to throw PRS before anything happens to prevent unconscious patterns from forming, reduce subconscious signals that give away the next throw, and ensure that certain tricks do not affect play. (I'm talking about the twitching of fingers, delaying unveiling a throw until the last possible instant, calling out bluffs, etc.) If P1 wins the first throw, P2 threw RRR, RRP, RRS, RPR, RPP, RPS, RSR, RSP, or RSS. Arranging this, we can see that after winning the first throw, P1's final score can be any of the following:

 3 RSP
 2 RRP, RSS
 1 RRS, RPP, RPR
 0 RPS, RRR
-1 RSR

The same logic can be applied to P1's first throw losing as well as becoming a draw. So, depending on the first throw, here is what to expect for the match in the three different situations:

                       win draw lose
First throw is a  win: 6/9  2/9  1/9
First throw is a draw: 1/3  1/3  1/3
First throw is a loss: 1/9  2/9  6/9

Because of this phenomenon, the three game match can be simplified to worrying mostly about predicting your opponent's first throw (because if you win that, you are a big favorite). To make things a bit easier, the 27 combinations can be further classified to assist in predicting the first throw:

Straight Run (SR): {RRR, PPP, SSS}
Mixed Run (MR): {RPS, RSP, PRS, PSR, SRP, SPR}
Heavy Run (HR): {RRP, RRS, RPR, RPP, RSR, RSS, PRR, PRP, PPR, PPS, PSP, PSS, SRR, SRS, SPP, SPS, SSR, SSP}

Knowing a player's preference when it comes to types of runs can make one hell of a difference for the outcome of a match (win, draw, lose): 


          SR               MR               HR
SR (0.33,0.33,0.33)                                  
MR (0.00,1.00,0.00) (0.17,0.66,0.17)                 
HR (0.50,0.00,0.50) (0.50,0.00,0.50) (0.31,0.38,0.31)

We see that a SR_v_HR and MR_v_HR will always have a winner and a loser, with equal chance (until the first throw); SR_v_MR will always result in a draw headed to sudden death overtime; and runs of the same kind have an interesting battle where anything goes.

Knowing these facts for a best-of-three match where ties count can bias the advantage in your favor if you have some insight into the player's tendencies. For example, if I was playing against George Bush, it might be safe to assume that he will throw a HR because it is the most probable choice. As a result, I want to throw MR or SR because the match will end in a win or loss. I also think that his first throw will most likely be Rock, so I have narrowed my set to {PPP, PSR, and PRS} each giving me a 2/3 chance of winning and 1/3 chance of losing if my assumptions are right.

No comments:

Post a Comment