About the Computer Strategies
Rock Paper Scissors on this site ships with two different computer opponents. Each version uses a distinct algorithm so you can experiment with predictable play and adaptive counter-strategies.
Undergraduate – Dynamic Order Markov Chain
This model dynamically chooses the Markov Chain model based on the available context.
- The model first looks for if the order seven Markov Chain has a prediction. If it does, this is prioritized.
- It then looks to the order five Markov Chain then the order three model.
- If none has a prediction, it defaults to a weighted random prediction.
Senior – Order Seven Markov Chain
Version 4 is an extension of Versions 3 and 2, but with a 7 move long context window.
- The model then needs to learn for the first seven moves, then can start predicting.
Junior – Order Five Markov Chain
Version 3 is an extension of Version 2, this time with an extended context window up to 5 moves long.
- This model first trains itself for five moves then starts predicting your moves.
Sophmore – Order Three Markov Chain
Version 2 starts with a weighted opening move for the first four turns. It then uses the last three moves to predict the next move.
- If the computer has seen the pattern before and the user clearly chooses one of the options more than the others it will play the counter to that mostly likely move.
- If the computer has seen the pattern before and the user chooses is equally likely to choose two different moves, it falls back on the wieghted probabilities model to choose between the two options and plays the counter to that.
- If the computer has never seen the pattern before or the user is equally as likely to choose every move, it falls back on the weighted probabilities model.
Freshman – Single Order Markov Model
Version 1 starts with a weighted opening move from Version 0 and then adapts based on the players last turn. It does this through a single-order Markov chain.
- If the player just won, the model assumes they will repeat the winning move and therefore throws the counter to that move. Ex. If the player wins with rock, the computer will play paper.
- If the player just lost, it expects them to switch to the move that would have beaten the computer and counters that instead. Ex. If the player loses with paper, the computer will play rock.
- After a draw, it anticipates that the player will play what wins against what was just thrown. Ex. There is a tie with scissors, the computer will play paper.
Elementary – Weighted Random Probabilities
The original computer opponent pulls from a simple random generator. The probability of the computer's move is based on empirical data synthesized from multiple studies.
- Internally the strategy selects one of the three moves with the probabilities: 31% rock, 36% paper, and 33% scissors.
- Because each turn is independent, the computer never learns from player behavior, making it predictable only in the sense that it never adapts.