Select Page

Something completely different this week! I’ve been a bit of computer spod for most of my life, and it all started with a 48K ZX Spectrum home computer. My dad bought it in the early 80s and I took to writing games and keying in code listings from the likes of Your Computer and Your Sinclair. As a big fan of emulation and retro-computing, I’ve obviously acquired a Speccy simulator to relive the good old days.

Now, last week I was discussing the “Monty Hall Problem” with my missus. For the uninitiated, this is a probability problem that is often described in the context of a US game-show, where a contestant picks one of three doors. Behind one of these doors is the star prize, a car, with the other doors concealing a pair of undesirable goats. In the game, once the contestant has chosen a door, the host, the titular Monty Hall, reveals, at random, one of the goat doors and asks the contestant: “Do want to stick with your original choice or choose the other door?”. The Monty Hall problem suggests that the contestant has a 1 in 3 (33%) chance of winning with their original choice yet a 2 in 3 (66%) chance if they choose to swap. As such, the contestant should always choose to swap to have the best chance of winning the car. The problem can be proven mathematically, using Bayes Theorem, but is a fascinating problem to simulate using a simple computer program.

Combining these two interests, then, I’ve written a simulation of the Monty Hall Problem in BASIC on my simulated ZX Spectrum.

The solution is also available as .tap and .z80 files, which are available at the bottom of the listing. Next steps? To implement as a Siebel Workflow of course! 🙂

Download .tap file
Download .tzx file