← All Base Form Math projects
BM-23NOT STARTEDBASE FORM · PROBABILITYMATHPYTHON

Board-game odds engine

Compute exact odds for poker hands and Monopoly squares, then check them by simulating a million games.

EST.6 h
REWARD+100 XP
AFTERoriginal

ML-ARENA BENCHMARKS

YOUR NUMBER VS THE INDUSTRY'S
METRICINDUSTRYMINE
square-landing probabilities
GOAL · simulation within 0.5%
exact Markov-chain answer—
no results yet
YOUR RESULTS

Your recorded results appear here.

Brief

Some odds you can work out exactly by counting. Others are easier to estimate by playing the game a million times on a computer. This project does both for the same questions and checks that they agree. That habit, an exact answer next to a simulation, is how you catch bugs in either one.

Poker is pure counting. There are (525)\binom{52}{5} = 2,598,960 five-card hands, each equally likely, so the chance of a hand class is its count divided by that total. Monopoly is harder because where you land depends on where you are. It is a Markov chain: a 40 × 40 matrix PP where PijP_{ij} is the chance a turn takes you from square ii to square jj. The long-run share of time on each square is the vector π\pi with πP=π\pi P = \pi, which you already know how to find with power iteration.

The simulation side is Monte Carlo: use a pseudo-random number generator to roll dice and deal cards, then count. An estimate of a probability pp from nn independent trials has standard error p(1−p)/n\sqrt{p(1-p)/n}. To halve the error you need four times as many samples. Successive Monopoly turns are not independent, so the real error is a little larger, which is one reason to simulate many separate games.

VISUALFig. 1
10^2 10^3 10^4 10^5 10^6 0.00 0.02 0.04 0.06 turns simulated (n) exact p = 0.03 band: p ± 2 standard errors
A running Monte Carlo estimate of a probability of 0.03. The band is two standard errors either side and narrows like one over the square root of n. Why it's here: Shows what 'within 0.5%' costs in samples before you pick your simulation size.
HINT · OBJECTIVE 3
Stuck? Hints stay hidden until you ask.
HINT · OBJECTIVE 5
Stuck? Hints stay hidden until you ask.

DATA · game rules

Objectives

0 / 6 CLEARED

Read-only. Log in to update progress.

VICTORY CONDITIONS

  1. Every Monopoly square's simulated probability is within 0.5% (relative) of the exact Markov-chain value. Record the worst one with `python tools/mlarena.py record BM-23 "<max relative error>"`.
  2. Your poker counts match the known table (for example 3,744 full houses and 5,108 flushes) and sum to 2,598,960.
  3. The error plot shows the error falling like one over the square root of the number of samples.

Side quests

Add the three-doubles rule. Track how many doubles in a row you have rolled, which turns the chain into 120 states.
Rank the property groups by expected rent per opponent turn, using your landing probabilities and the rent table.
Estimate Texas hold'em pre-flop win rates for a few starting hands by simulation.

Terms in plain words

Monte Carlo
Estimating a probability or an average by running a random experiment many times and counting what happens.
Pseudo-random number generator
A deterministic algorithm that produces numbers that look random. The same seed always gives the same sequence, which makes runs repeatable.
Standard error
The typical size of the gap between a Monte Carlo estimate and the true value. For a probability p from n trials it is the square root of p(1 − p)/n.
Markov chain
A process where the next state depends only on the current one, described by a matrix of move probabilities.
Stationary distribution
The long-run share of time spent in each state. It is the left eigenvector of the transition matrix with eigenvalue 1.