– mainan kecerdasan –
Ada empat bandit. Dari delapan nama (Merah/Oranye/Coklat/Kuning/Hijau/Biru/Hitam/Putih), kita diminta untuk menyingkap SIAPA SAJA penjahatnya—beserta LOKASI persembunyiannya. Master Mind adalah permainan tebak warna yang bisa diibaratkan dengan kisah seperti itu.

Master Mind – sebuah seni menggali dan mengolah informasi (Foto oleh: Fetri)
Soal cara main selengkapnya bisa cek/coba sendiri di internet (mis di sini). Tetapi intinya ialah, ini permainan dua orang—yang satu menentukan sebuah kombinasi warna secara rahasia dan yang satu lagi coba menebak WARNA dan POSISI masing-masing dari kombinasi rahasia tsb.
![]() |
![]() |
![]() |
| Bak detektif – merangkai kemungkinan, mengeliminasi ketidakmungkinan | ||
Simpel, menantang dan lintas umur (dari SD hingga orang dewasa), ciri khas mastermind ialah kelugasannya dalam ‘mengasah logika’ (menalar/reasoning)—utamanya induksi dan deduksi (secara prinsip, persis dengan jurus Sherlock Holmes ketika sedang menghadapi suatu kasus).
Jadi, tahun baru ingin punya mainan baru? Coba saja Master Mind. Oya, karena untuk bilang “Selamat Natal dan Tahun Baru” rasanya sudah lewat momentum, langsung ke yang ini saja:
Selamat Imlek
Mari upaya dan doakan yang terbaik.
——————————
CATATAN
Ada banyak versi master mind tapi yang paling lazim ya yang di atas itu—delapan kode warna (dengan empat kode warna untuk tiap-tiap tebakan) serta sepuluh kali kesempatan menebak.
Dalam istilah Inggris, endol besar yang warna-warni itu disebut dengan code pegs (itu kenapa yang menebak biasa disebut dengan code breaker atau pemecah kode) dan endol kecil yang cuma dua warna itu disebut dengan key pegs (‘peg’: benda kecil yang untuk ditancapkan).
Key pegs umumnya berwarna hitam-putih (karena alasan visual, ketiga contoh di atas pakai merah-putih—karena kalau hitam akan jadi sulit dibedakan dengan ‘kosong’ yang juga gelap).
Key peg hitam (merah): ada sebuah kode yang warna SERTA posisinya sudah benar
Key peg putih: ada sebuah kode yang sudah ‘benar-warna’ TAPI masih ‘salah-posisi’
Jauhkan mainan ini dari anak yang masih terlalu kecil (takut ditelan pegs-nya).
SCORING
Yang paling sederhana ialah dengan memberi nilai hanya kepada si penebak—10 jika berhasil (dapat empat key pegs hitam) di tebakan pertama, 9 jika berhasil di tebakan kedua... dst.
VARIASI TINGKAT KESULITAN
Jelas, makin banyak kemungkinan kombinasinya makin repot mikirnya. Maka untuk pemula, sepakati bahwa keempat kode harus warna unik (tidak boleh ada warna kembar). Misalnya:
Hijau/Oranye/Coklat/BiruHitam/Biru/Merah/HijauKuning/Merah/Hitam/Putih
Jika mainnya sudah mulai nyantai atau sering sukses di percobaan ke-5, bebaskan soal warna. Jadi kalau mau, orang juga boleh (tanpa memberitahukan!) pakai warna kembar. Misalnya:
Merah/Kuning/Merah/BiruCoklat/Coklat/Coklat/CoklatPutih/Oranye/Putih/Putih
Dan jika itu pun acap tembus, bebaskan orang (tanpa memberitahukan!) untuk ‘tidak mengisi’ alias pakai ‘kosong’ (anggap saja ‘kosong’ sebagai warna yang kesembilan, gitu). Misalnya:
Kuning/Hitam/Hijau/kosongPutih/kosong/Biru/Birukosong/kosong/kosong/Merah
INDUKSI DAN DEDUKSI
Sederhananya, dalam ‘ilmu berpikir’ (sebut saja begitu), induksi adalah dari khusus ke umum sedangkan deduksi adalah dari umum ke khusus. Dalam mastermind, info spesifik/detail dari key pegs bisa kita anggap sebagai yang ‘khusus’ sedangkan asumsi kombinasi code pegs yang disembunyikan sebagai yang ‘umum’. Pelacakan tentang seberapa benar/salah kita dalam membuat tebakan bisa dilakukan baik dari key pegs (induksi) maupun code pegs (deduksi).
VARIAN PRODUK UMKM/HOME INDUSTRY(?)
Master mind pada foto di atas dibuat dari satu gagang pel bekas, dua sumpit bambu, sebilah papan 0kecil), dan sebilah tripleks (lebih kecil lagi). Lalu dengan sedikit cat/pelitur dkk (butuh ketrampilan juga pastinya), jadilah, master mind yang ‘the one and only’ (karena bikin sendiri).
BIAR ANAK DOYAN, PENDEKATAN ADALAH KOENTJI(?)
Waktu SD dulu, pendekatan ala detektif vs penjahat sukses ‘memastermindkan’ sesama bocah sehingga selepas magrib teras kecil (di asrama tentara) itu sering dipadati tetangga yang ingin main—bahkan beberapa ‘anak gede’ (yang sudah SMP) pun sudi antre untuk ikut mencicipi.
KEREN TAPI NGGAK BEKEN
Kalau mengacu pengalaman pribadi, di Jakarta tahun 70-an master mind cuma bisa ditemukan di pusat perbelanjaan Sarinah—dan kalau sekarang kita bertanya di toko mainan, bukan tidak mungkin Mas/Mbaknya malah bingung. Jadi rasanya aneh juga, kenapa mainan ciamik satu ini demikian jarang ‘digauli’/dikenal orang. Mungkin Pembaca punya cerita lain atau pendapat?
—KK—



I remember playing a plastic version of this when I was young… late 70s, early 80s? I enjoy logic games; they’re good distractions.
With 8 colors and four placements, that’s 8^4, or 4,096 possible combinations. Seems intuitively as though it should be impossible, but I’m sure there’s an algorithm that can be applied to playing most efficiently. Since each turn eliminates some long branch (or branches) of possibilities, that suggests some “minimax” approach to setting up the longest branches. “Game Theory”, literally. Too bad, I need to go to bed… probably dream about this now. 😉
And Happy Lunar New Year to you!
The ‘Sherlockey elegance’ of this color fun never fails to amaze me. Definitely one of my all-time-fave board games from elementary school (beside chess and scrabble).
One particular approach I often (not always, though, for variety sake) use (especially when playing duplicates or duplicates-and-blanks) is using two pairs of doubles for starter (like that one in the rightmost pic)—hoping that both colors ARE wrong. 🙂
I hope you woke afresh this morning.
Interesting… We must think alike. I played about a dozen rounds on the link this evening, with repeating colors allowed. Just intuitively, I started all of the games with the same two pairs. Most of the games went five rounds, a few went six, and one went seven. I can see how things are eliminated, but I couldn’t quite see an algorithm.
Looking at the Wiki article, there’s a section on strategies. Seems there are several, depending upon how “efficiency” is defined. “Minimax” is mentioned first, and I suspect that’s what I’m (and you are) defaulting to. But that means that arriving at a solution is statistical. And that might be the best one can do…
There is apparently a proof that MasterMind is “NP-Complete”. The correctness of a solution can be verified quickly, but only a brute-force search algorithm can find a solution by trying all possible solutions. So it might be that the best one can do is that statistical strategy. There may be some “luck” built into the process that can’t be removed by any algorithm.
https://arxiv.org/abs/cs/0512049
[ ‘a’, ‘b’, ‘c’, ‘d’ –> the positions, from left to right ]
[ blacko –> (black-o) the black key peg ]
[ whiteo –> (white-o) the white key peg ]
I guess that’s just about it—figuring/eliminating, minimax-ing, ‘coloring’ (from keys to codes), ‘blackandwhite-ing’ (from codes to keys).. And luck! 🙂
The verifying/searching algorithm reminds me of chess engines’ tablebase (some sort of endgame database where positions are mapped already). And now that you mention it, I think the two-color starter in a ‘singleton game’ (no duplicates or blanks) is quite an interesting ‘algorithm’..
Being Logical vs Being Reasonable
If we take logic as “what follows what and why” and reason as “anything is considerable as long as it has sufficient/sane grounds”, then perhaps in mastermind we’ll have this dialog..
🔴 🔴 🟢 🟢
Logic: “Hey, you can’t be right with that. This is a singleton.”
Reason: “It ain’t my plan to nail it on Move #1. The probability and stats would be all against me. I just need some info, QUICK and EASY.”
Not to be a lexicon freak, it always intrigues me how an AI might reason out beyond its predefined logic. Against/revising its own algorithm(?) Learning. Like us.
Clarity: Being [Unmistakably] Wrong Has Its Perks
We know that, like a stepping stone, the two-color approach can save us the trouble of wading in the water with the [normal] four-color guess. And one [useful] ‘cannot-be-right’ leads to another..
Move number three (M#3) is obviously a lucky shot. Big time. Thanks to the ‘illogical’ placing of Red (on ‘c’ instead of on ‘a’ or ‘b’) for in this case it makes the ‘squeeze’ (of information) exhaustive so that we can tell—with absolute certainty, what The Code is.
The Dumb and Dumber
Now this sure looks clumsy..
Logically, if we assume that the three keypegs on Move #1 correspond to Brown White Black with Brown being the blacko (which actually was what I imagined at the time of playing), then on Move #2 we won’t put White and Black at exactly the same positions, right? (So if White here is dumb then Black must be dumber—there comes the name LOL).
Yet, the silly persistence of the trio does have its merit since it tells us—with such certainty, that:
Any change in the keypegs (say, from ⚈⚆⚆ on M#1 to ⚈⚈⚆ on M#2) must have something to do with the fourth code ONLY (Red/Orange, in this case), and NOT with the other three (Brown White Black).
Yet, what follows is no less tricky..
keypegs: [blacko whiteo whiteo]
Unfortunately, the composition stays the same. Now it might be impulsively tempting to trash Red and make a running guess with the three remaining colors (Blue Green Yellow). But this is a somewhat Monty-Hall-Problem-like situation (with all doors still closed, that is).
Color-wise (regardless of positions), the three keypegs tell us that The Code is either without Brown, without White, without Black, OR without Red.
Naturally, three out of four, it is WITH Red. So if in Monty we should shift door (2/3), here I will gladly change my assumption of what color I should do WITHOUT (not necessarily 3/4—in fact here it just shifts to another 1/4 with ‘all doors’ still closed) because a blind loyalty to one particular 1/4 chance in mastermind (Brown White Black—without Red) surely doesn’t sound like a good idea.
Consequently, IF Red is indeed in play, THEN Orange must be there too (or we would have had four keypegs instead of three here). So, one of the assumed trio must go. A wild guess territory. I kick Brown out (my assumed blacko, why not?).
Luck must be smiling. The squeeze is now complete.
The Thing Called Luck
It is clear that while logic alone would eventually ‘take us there’, finishing the game in less than five moves needs some varying degrees of luck that equal to, say:
M#1: divine intervention
M#2: big lottery
M#3: small lottery
M#4: free coffee
Since divine intervention is unlikely and we can’t really plan to win a lottery, the last pick on the list seems to be the only one with some fair chance of happening. And I guess those cases above prove that, AT TIMES, a little ‘crazy play’ could help us being in the close proximity of luck.
That being said, I think it’s worth noting that—with the compliments of luck, even a ‘normal play’ could as well ‘bargain the odds’ (the phrase ‘beat the odds’ feels a little too much here), as in these two cases below.. (The one on the left is still a 50-50, though)
I hope I don’t bore you with the blabber, Kumi. Sorry for the link pending and the very slow response. (It’s about 7 PM now. I’ll try to reply to your other comment late tomorrow night. You mentioned something really interesting—again(!)🍷, there)
Fascinating… I must have had a run of good luck earlier.
Twenty rounds without duplicate colors, always starting red, red, green, green, I averaged exactly 6. Twenty rounds starting with all red, 7.8. I could see how at some point, the elimination narrows down to guessing a remaining color. Starting with one color leaves too little information about position, and starting with all different colors *can* leave too little information about which color (unless they’re all eliminated).
I’m not a statistician, but it’s fascinating to see how this works. The paper I linked goes into unfamiliar territory. But I think they’re showing that various possible outcome trees connect at single points, rendering a computation exhaustive (like deriving two primes from a multiple). Computationally, there doesn’t seem to be any shortcut to an answer, just a best approach to eliminating impossibilities most quickly on average.
I love that. Can’t put it better. While generally I always want my tries to be as exhaustive as possible, sometimes it is the lack of ‘trees’ that puts me under probability’s spell..
Stat Rules
Only one position left, yet I have to interrogate down to the last suspect to catch the culprit (Yellow). There’s no room for bargaining the odds. 🙂 But luck is being friendlier on the following case..
The Chutzpah Attack
Here the two blackos on M#1 are definitely Blue and Black, with the sole whiteo being either White or Yellow. Only one vacant position left (‘c’ or ‘d’), and Green is not in play. Having all those info before Move #3 surely is good. The problem is..
there are still too many remaining colors around and trying them out one after another could make the play end up just like the one before. Luckily there’s still a way to bargain the odds..
Green The Insolent (it is clearly not in play but insists on being there) is of course just a dummy. And I call this trick ‘attack’ because it is aggressive (marauding two locations at once).
So, the plan is to put, say, Red on ‘b’ and Brown on ‘d’, then four out of six (as long as it’s not one whiteo) I’ll nail this on the next move.
*****
All in all, I guess we just can’t beat stats, now can we? So, many plays will need five or six moves (sometimes more). Still, having those occasional free coffee every now and then I think is fun. 🍸
Intermittently snowed-in for the last week… been a good opportunity to revisit this. I tend to approach these kinds of puzzles as how can I beat it down with an algorithm. But I think that’s what anyone looking at the puzzle logically is actually doing… if just intuitively.
Since there are a limited number of possibilities for answers (4,096), each trial eliminates pools of patterns (overlapping sets of patterns possessing some characteristic)… those “trees”.
“…sometimes it is the lack of ‘trees’ that puts me under probability’s spell.” Yes! As the game progresses, each set of trees becomes progressively smaller. So, you reach a point where it becomes an exhaustive process, each step eliminating little more than a single leaf. At that point, it’s just probability. One must, “…interrogate down to the last suspect.”
I’m not a software engineer; but (perhaps naively) I’d approach writing an algorithm to solve this by starting with an array of all possible answers. The R-R-G-G start pattern seems to balance a 1-in-4 probability of eliminating 25% of possibilities with an opening move with at worst a 50/50 determination of a color. Determining just one color gives a 1-in-3 chance of finding a position on the next round. A color & position then excludes 1024 possibilities associated with that column, as well as another 384 possibilities for re-use of the color in a no-duplicates game. The cool part is that you can be running more than one algorithm at a time, and the trees will overlap and feed into each other.
You can see the overlaps, especially as you experiment with moving colors to resolve white pegs. Sometimes, You’ll “know” that you’re going to resolve at least two colors (occasionally three) on the very next move. Kinda’ fun when you move the colors around and know that the next “check” will result in a “solved”. The human brain is an amazing apparatus, even if you can’t exactly explain what it’s doing.
Looking through some math resources, there is apparently an old software algorithm that solves for six-colors in an average of about 4.34 turns. I don’t have easy access to it, and I don’t know how it works. I don’t see anything for eight colors. Looking at that average, however… four turns is indeed a coffee. Love to know the odds on a 3-turn, “small lottery” win. I live in a US state that allows gambling. 😉
–
To wit, here’s what I’d been contemplating recently. (And the solution was a bit of a surprise).
Imagine picking a single outcome from some random, but discrete possibility… for example, the chance of “death or taxes” during one’s life, flipping “heads” on a coin-toss, rolling a “five” on a fair die. Now give yourself the same number of chances as there are possible outcomes… one life, two coin-tosses, six rolls of the die, 36 spins of a Roulette Wheel with no green “zero” slots, and so on.
The odds are not too difficult to calculate for each trial, by subtracting the multiple of the odds of each failure from one:
1- [(n-1) / n]^n
Death or taxes…100%.
For a double coin toss, that comes out to a 0.75 chance of seeing a “heads”.
For six rolls of a die, that “five” has about 0.67 chance of showing up.
For 36 spins of that Roulette table, it’s close to 0.64.
For a 100 tries at a 1-in-100 game, its about 0.634.
Obviously, this is approaching some limit. What is it?
If I’d been any good at statistics in college, I would have known immediately. There’s even a name for this kind of a trial, and it applies to a lot of games where discrete odds are repeated, even Mahjong. But it turns out that there’s an obvious engineering solution with such pile-ons. Think, “Euler”.
Cheers!
Now that “komputer” has been published, your words here do remind me of Katherine’s in Hidden Figures..
It could be old math.
Something that looks at the problem numerically, and not theoretically.
Math is always dependable. . .
Euler’s method.
While that part is only a dramatization (the problem they’re dealing with was too complex to be approached/solved by a single method), it sure made a [very good] point. Like yours. Cheers!
yeah! my personal perfect game
logistic matter
It is fun and challenging. 🙂