The Math Behind Matching Games Like Spot It & Dobble
- Yael Hewitt
- Feb 24
- 4 min read

Ever wondered about the math behind Spot It and Dobble and how every card magically shares exactly one matching symbol with every other card? It feels like some wizardry is at play—but actually, it’s all math!
Behind the fun and fast-paced gameplay lies a fascinating mathematical structure built on finite projective planes, combinatorics, and modular arithmetic. If you’ve ever wanted to understand how these matching games work (or even create your own), this article breaks down the magic behind the math.
How Does a Spot It/Dobble-Style Game Work?
A standard Spot It/Dobble deck has 55 circular cards, and each card contains 8 different symbols. The game’s trick?
✔ Every two cards always share exactly one matching symbol.
✔ No card repeats its set of symbols.
✔ The deck is structured so that any two cards in the set are "compatible" for play.
But how is this possible? If you randomly slap images onto cards, this structure wouldn’t work. Instead, the game is based on finite geometry, specifically finite projective planes of order n.
The Math Behind Spot It and Dobble: Finite Projective Planes Explained
At the core of the math behind Spot It and Dobble is a special type of mathematical structure called a finite projective plane.
What’s a Finite Projective Plane?
A finite projective plane of order n is a set of points and lines where:
1️⃣ Each line contains exactly n + 1 points
2️⃣ Each point appears in exactly n + 1 lines
3️⃣ Any two lines intersect at exactly one point
For Spot It/Dobble-style games, we use a finite projective plane of order n = 7, which gives:
✅ n² + n + 1 = 8² - 8 + 1 = 57 symbols
✅ n + 1 = 8 symbols per card
✅ 57 total cards (only 55 are used in the official game)
This setup ensures that every pair of cards shares exactly one symbol!
Building a Spot It-Style Game Using Math
To generate a set of cards that follow the game's rules, we use a construction algorithm based on modular arithmetic and projective geometry.
Step 1: Choose an Order n
In the official game, n = 7, giving us a 57-symbol deck.
For smaller sets, you can choose n = 3 (7 symbols, 7 cards) or n = 4 (13 symbols, 13 cards).
Step 2: Generate Symbols & Assignments
We can construct a valid deck using a system of modular arithmetic:
Create a grid where each row represents a card.
Assign symbols using a formula based on Galois fields (a type of finite field math).
Ensure that each card contains n + 1 symbols, and every pair of cards shares exactly one symbol.
Step 3: Verify & Optimize the Deck
Check that each symbol appears on exactly n + 1 cards.
Ensure every two cards share only one common symbol.
Adjust any duplications or gaps using combinatorial adjustments.
Example: Small Spot It-Style Game with n = 3
Let’s construct a mini deck with n = 3, which gives:
7 symbols: {A, B, C, D, E, F, G}
7 cards, each containing 4 symbols
✔ Each pair of cards shares exactly one matching symbol!
This same logic scales up to create the full 55-card deck used in Spot It/Dobble.
Can You Make a Spot It-Style Game with Any Number of Symbols?
🔴 No. The number of symbols and cards follows a strict formula based on finite projective planes.
✅ The number of symbols, cards, and symbols per card must satisfy n² + n + 1 for some integer n.
✅ If n isn’t a prime power (e.g., 2, 3, 5, 7, 11...), the system breaks down.
That’s why you can’t have a perfect Spot It-style game with 50 symbols and 50 cards—it must follow the projective plane formula.
How to Generate a Spot It/Dobble-Style Game with Code
If you want to generate your own game, you can use:
Python & NumPy for modular arithmetic
Google Sheets + Apps Script (like in this guide)
Figma or Canva to design the visuals
A simple Python script could generate the symbol sets using modular arithmetic, then export them into a printable format.
Would you like a Python script to generate a custom deck? Let me know! 🚀
Final Thoughts: The Perfect Blend of Math & Fun
While Spot It and Dobble feel like magical games, the math behind Spot It and Dobble is actually based on a century-old mathematical concept.
The use of finite projective planes ensures that every two cards share exactly one symbol—creating the perfect, fast-paced matching experience.
So next time you play, remember—you’re not just having fun. You’re engaging with beautiful mathematics in action!
🔹 Want to create your own personalized matching game?
✅ Upload your own images & symbols
✅ Automatically generate a valid deck
✅ Print high-quality, durable cards
.png)