28

It is known that one cannot beat a truly random player in Rock Paper Scissors.

Here you will play a variant of the game. In this variant you are not allowed to play the same shape twice in a row. So if you have played rock then in the next round you must play paper or scissors.

You will play against a random bot. It will choose shapes uniformly at random while avoiding the same shape twice in a row.

Can you find a strategy that beats the random bot in the long run? More specifically, can you obtain more wins in expectation?

Dmitry Kamenetsky
  • 35,897
  • 5
  • 66
  • 276

4 Answers4

29

Here's how you win in the long run

If you win one round, in the next round pick the option which hasn't been picked by either player in the previous round. For example, if you win with ROCK against SCISSORS, pick PAPER in the next round. You are guaranteed to win or draw the next round.

If you draw a round (both players pick the same), in the next round pick the option that would have lost to your previous choice. For example, if you both pick ROCK then pick SCISSORS next. You are guaranteed to win or draw the next round.

If you lose a round, in the next round pick your opponent's previous choice. You then have a 50/50 chance of winning or losing the next round and once you win one, you will never lose again.

Expected number of losses

$\frac{1}{6} + \frac{2}{12} + \frac{3}{24} + \frac{4}{48} + \ldots = \frac{2}{3}$ (over an infinite number of turns).

Thanks to Evargalo for fixing the last calculation.

hexomino
  • 135,910
  • 10
  • 384
  • 563
  • My infinite sums are way behind me, but I think the result is 3/4 (can't be over 1, right?) Anyway, +1 for the clarity of the explanation. – Tloz Dec 11 '23 at 21:38
  • Well done and nicely explained. – Dmitry Kamenetsky Dec 11 '23 at 22:40
  • 12
    @Tloz The sum is indeed 4/3, and there is no reason it cannot exceed 1. It is the expected number of losses, not a proability if that's what you were thinking. – EphraimRuttenberg Dec 11 '23 at 22:41
  • I find it interesting that a small change to the rules of the game changes the outcome and makes a dominant strategy weak. – Dmitry Kamenetsky Dec 12 '23 at 07:38
  • 3
    @EphraimRuttenberg oh, yeah, my bad. I'll definitly stop browsing stackoverflow afterdark ^^ – Tloz Dec 12 '23 at 15:53
  • @DmitryKamenetsky the strategy was hardly dominant. It was merely unbeatable. – Christofer Ohlsson Dec 12 '23 at 17:48
  • The earlier fractions seem to be losses over total outcomes. Won't the number of losses always be lower than the total number of outcomes? – Michael Richardson Dec 12 '23 at 18:08
  • @MichaelRichardson It will, but that doesn't preclude the infinite sum ending up greater than 1. – Idran Dec 12 '23 at 19:15
  • 1
    @Evargalo gah! you are indeed, correct, I'm sorry. Will correct it. – hexomino Dec 13 '23 at 13:04
  • 1
    There is more than one way to write the expectation of the number of losses as a sum; intuitively I would have written 1/3 + 1/6 + 1/12 + 1/24 + 1/48 + ... = 1/3(1 + 1/2 + 1/4 + ...) = 2/3. – Stef Dec 13 '23 at 18:21
  • I don't get it. You can lose only the 1st round with a probability of 1/3. The expected sum of all losses is 1/3. Second, the question asks about improving the wins, not reducing the losses. The expected wins are 1/2 of the rounds in the long run. What is that 2/3 or 3/4? – Florian F Dec 15 '23 at 07:53
  • @FlorianF 2/3 is the expected number of losses. That is, if a large number of people played this game then the average number of losses between them all would be 2/3. I agree, the expected number of wins divided by the number of rounds approaches 1/2 in the limit. – hexomino Dec 15 '23 at 09:33
  • On the first round we have 1/3 win, 1/3 draw and 1/3 loss. Do you count a draw as a loss? – Florian F Dec 15 '23 at 11:56
  • @FlorianF No, a draw is not a loss. Remember, this isn't the probability of a loss we are calculating but the expected number of losses. You might lose 0 or 1 but you might also lose 20 (albeit with a very low probability). See here for more info. – hexomino Dec 15 '23 at 13:04
  • OK, I got it. (I know what the expected value is.) My mistake was to think that after a loss you can guarantee a safe move. In fact you can't because the safe move is exactly the move you cannot play. So, ok, it sums to 2/3. – Florian F Dec 15 '23 at 17:00
20

I agree with both answers, but the answer is a little simpler than their explanations. It can be simplified to:

On every round after the first, the best play is what your opponent would have beaten in the last round. If they played rock, you now play scissors. This gives you a win or a tie.

In the event you can't play the best play (because you played it last time), the second best is to play the same one they played last time. This gives you a win or a loss.

Those two rules alone cover every possibility.

For completeness:

Obviously, your play on the first round doesn't matter. You have a 1/3-1/3-1/3 chance of a win/loss/tie.

Greg Martin
  • 1,166
  • 7
  • 13
Stevish
  • 1,335
  • 7
  • 12
10

Yes

Here is a winning strategy:

First play Paper. Just because.

Then at each move there are 3 possibilities:

If you have just made a draw (wlog, you both played Rock) then you both have the same possibilities for the next move, one beating the other (here Scissors > Paper). Play this one (here Scissors) with an expected score of 3/4.

If you have just lost (wlog, you played Rock against Paper), then one of your two possibilities can make either a draw or a loss (here Scissors, vs Scissors or Rock) and the other can either win or lose (here Paper, vs Scissors or Rock). Play the latter one with an expected score of 1/2.

If you have just won (wlog, you played Paper against Rock), then one of your two possibilities can make either a draw or a win (here Scissors, vs Scissors or Paper) and the other can either win or lose (here Rock, vs Scissors or Paper). Play the former one with an expected score of 3/4.

Your expected win is

a linear combination of 3/4, 1/2 and 3/4 with non-zero probabilities, so it is higher than 1/2.

Your probabilities for round n (n>1) are:

loss: P_L(n) = 2^(1-n) / 3
draw: P_D(n) = (3-2^(1-n)) / 6
win: P_W(n) = (3-2^(1-n)) / 6

Counting 1 for a win, 1/2 for a draw and 0 for a loss, your expected score on round n is:

E(n)= (3-2^(1-n)) / 4

When the number of games tends to infinity, your expected average score

tends to 3/4.

bobble
  • 10,245
  • 4
  • 32
  • 80
Evargalo
  • 6,270
  • 1
  • 19
  • 39
6

After a possible streak of losses, you can guarantee that you will never lose again.

Start by picking randomly. You have a 1/3 chance to either win, lose or draw.

If you lose, choose whatever they chose. By doing this, you can't draw because they can't choose that same thing again. You have a 1/2 chance to either win or lose.

Example 1: I chose ROCK, they chose PAPER, and I lost. Next, I choose PAPER. They might choose SCISSORS and win, or ROCK and lose.

If you draw or win, choose whatever would be beaten by what they chose. They can't choose the same thing again, so they can't use it to beat you. You have a 1/2 chance to either win or draw.

Example 2: I chose PAPER, they chose PAPER, and we drew. Next, I choose ROCK. They might choose ROCK and draw, or SCISSORS and lose.

Example 3: I chose ROCK, they chose SCISSORS, and I won. Next, I choose PAPER. They might choose PAPER and draw, or ROCK and lose.

You may start in a loss cycle and lose repeatedly. But after you have won or drawn once, this strategy will ensure that you never lose again.

Diagram:

Random RSP

Hand-E-Food
  • 745
  • 5
  • 8