Matching Pairs Game
In this matching pairs game you turn over two cards – if they match, the pair is yours and you go again. If not, they are turned face down. Remember where everything is and you win.
Source: Velleman D. J., Warrington G. S. (2013): What to Expect in a Game of Memory. American Mathematical Monthly 120(9), 787–805. Updated: .
How it is calculated
How to play
- Choose the board, the number of players and the pictures. Every picture appears exactly twice.
- On each move, tap two cards. If they match, they stay face up, count as a pair for the current player, and that player goes again.
- If they differ, they are turned back after one second and it is the next player’s turn.
- When all pairs are found, whoever has the most wins. Solo, your moves and time count.
On a computer everything works by keyboard too: Tab jumps into the board, the arrow keys move, Enter or Space turns a card.
Fairly shuffled
Before each game the cards are shuffled with the Fisher–Yates algorithm; the random numbers come from the browser’s crypto.getRandomValues() (W3C Web Cryptography API) without modulo bias. Every layout is equally likely and nobody can predict the board.
How many moves is good?
Even with perfect memory you cannot avoid some guessing. Velleman and Warrington showed in the American Mathematical Monthly (2013) that with n pairs an optimal player needs on average about (3 − 2 ln 2) · n + 7/8 − 2 ln 2 ≈ 1.61 · n moves. With 8 pairs (16 cards) that is about 12 moves, with 18 pairs about 29. After a solo game the tool shows this value for comparison – as a guide, not a grade.
Notes
- For children, 12 or 16 cards with animals work well; 6 × 6 with numbers is a challenge for adults.
- In multiplayer mode you pass one device around; the player whose turn it is appears above the board.
- The game state is not saved and nothing is sent. Board size, players and pictures are part of the link and can be shared.
Frequently asked questions
How does the matching pairs game work?
All cards start face down. On each move two are turned over; a matching pair is kept and the player goes again, otherwise both are turned back. Whoever has the most pairs at the end wins.
Can two people or kids play together?
Yes, 2 to 4 players can share one device. Scores are shown above the board and the current player is highlighted. For young children, 12 cards with animals are ideal.
How many moves does it take on average?
With perfect memory and the best strategy, about 1.61 moves per pair (Velleman and Warrington, 2013) – roughly 12 for 16 cards. Anything below that means lucky guesses.
Are the cards really shuffled randomly?
Yes. They are shuffled with the Fisher–Yates algorithm using the browser’s cryptographic random numbers, so every layout is equally likely.
Does the game work on phones and tablets?
Yes, in any current browser. The cards adapt to the screen width; on small phones 4 × 4 is the most comfortable size.
Sources and legal basis
- Velleman D. J., Warrington G. S. (2013): What to Expect in a Game of Memory. American Mathematical Monthly 120(9), 787–805
- Chakrabarti A., Chen Y. (2017): Time-Space Tradeoffs for the Memory Game, arXiv:1712.01330 (introduction: T(n) according to Velleman/Warrington)
- W3C Recommendation: W3C Web Cryptography API – getRandomValues()
- MDN Web Docs – Crypto.getRandomValues()
As of: · Editorial policy
Related tools
- Play the 2048 game onlinePlay 2048 free in your browser: swipe or use the arrow keys to merge tiles until you reach 2048. With best score, one-step undo and your game saved.
- Play the mines game onlineFree mine puzzle in your browser: beginner, intermediate and expert, first click always safe, flags by long press or right click, best times. No app or sign-up.
- Play tic tac toe onlineTic tac toe online: play the computer (easy, medium, unbeatable), a friend on one device or by link. 3×3, 4×4 and 5×5 boards with score – free, no sign-up.
- Dice roller: roll d6, d20 and more onlineDice roller: roll d4 to d100 or type dice notation like 3d6+2 or 2d20kh1. Several sets at once, advantage, roll history, exact odds and a shareable link.
- Play Solitaire OnlineFree Klondike solitaire in your browser: draw 1 or 3, unlimited undo, hints and a winnable daily deal. Share your time – the link deals the same cards.
- Mini golf scorecard onlineMini golf scorecard online: tap the strokes of each player after every hole, the card adds up and names the winner after 18 holes. No app, share by link.
- Two truths and a lie ideas: prompts at randomTwo truths and a lie ideas at random: spin for a sentence starter – funny, for work, for school or about travel and food – and turn it into three statements.
- Table tennis scoreboard onlineTable tennis scoreboard online and free: tap to score, games end at 11 with a two-point lead, the server changes every two points. Best of 3, 5 or 7 games.
- Baby name wheelBaby name wheel: spin for a random girl, boy or gender-neutral name, or type in your own shortlist and let the wheel decide. Free, fair, nothing to install.