What just happened
You were asked for random moves and produced patterns instead. The machine keeps a table of what you did after every short run of recent moves, and simply bets on whatever you did last time from the same position. Nothing about you personally is stored — only the last few presses of this run.
People avoid long repeats, alternate more often than chance would, and answer their own last move. A table of three to seven moves is usually enough to beat 50%, and 60% is a common score.
Where it comes from
This is one of the oldest machine-versus-human demonstrations there is.
- 1953 — David Hagelbarger builds SEER at Bell Labs, a relay machine that predicted human penny-matching about 60% of the time.
- Shortly after, Claude Shannon built a smaller rival machine in the same lab. In the play-off between the two machines, Shannon's won.
- 2000s — the same idea reappears as the "Aaronson oracle", a few dozen lines of code predicting keypresses from a five-move history.
How to actually beat it
Do not try to be random by feel — that is exactly what the table eats. Use an outside source of randomness: read digits off a clock, count letters in a page of text, follow the parity of passing seconds.
Or think one level up: the machine bets on your habits, so build a rule it has no column for — but keep in mind that any rule short enough for you to hold in your head is short enough for the table to learn.