Game math portfolio project · 5×3 reels · 10 lines

Brass Sevens

A classic slot designed math-first. Every number below is derived exactly from the reel strips and paytable, including a player-choice respin feature whose return depends on strategy, solved with a Markov chain and checked by simulation.

96.19%RTP, optimal play
90.31–96.19%RTP range by player strategy
32.70%Hit frequency per spin
235×Max win, total bet
01 · Play

The game

Lines pay left to right from reel 1. Gears pay nothing, but each gear on screen charges the meter. A full meter lets you respin any reels you choose.

Brass Sevens
Charge 0/20
1,000Credits
10Bet
0Win
Press Spin or the space bar.
Spins 0 Wagered 0 Won 0 Session RTP — Respins 0
Demo credits only, no real money. Each bet level keeps its own meter. Reel stops come from crypto.getRandomValues.

How it plays

  1. Ten fixed paylines cross the 3×5 window. A line wins with 3, 4 or 5 matching symbols in a row starting from reel 1.
  2. Each gear on screen adds one charge. The meter holds 20; anything beyond that is lost.
  3. When the meter is full, you decide after each spin. Collect the win and keep waiting, or spend all 20 charges to respin the reels you pick.
  4. The panel shows the exact expected value of your selection and of the best one. It recommends spending only when the best respin adds at least 3.5× the total bet.

That threshold is the optimal strategy. Spending at the first chance is legal but worth only half as much, which is why this game has an RTP range instead of a single number.

02 · Model

The base game par sheet

Three inputs define the base game: the reel strips, the ten paylines and the paytable. Base RTP is 83.67%; the feature adds the rest.

Paytable

Pays in line bets. The last column is each symbol's exact contribution to base RTP, computed from strip frequencies.

Symbol×3×4×5RTP share

Why one line is enough

Every cell of the window shows each strip position with probability 1/L, because the stop is uniform and the strip wraps around. So all ten lines share the same distribution, and by linearity of expectation RTP of the game = RTP of one line, however the lines overlap.

P(exactly k of s) = p₁(s)·…·p_k(s)·(1 − p_{k+1}(s)) RTP = Σ_s Σ_k pay_k(s) · P(exactly k of s)

Win distribution per spin

Hit frequency cannot come from a formula: lines share cells, so their wins are correlated. These figures come from a full enumeration of all 4,686,066 stop combinations, rerun live in your browser.

Running the exact enumeration…

Paylines

Rows numbered top 0, middle 1, bottom 2. Lines 1, 8, 9 and 10 all start in the middle cell of reel 1, which is why line wins move together.

Reel strips

One gear per strip, so a reel window holds at most one. Reels 4 and 5 carry extra cherries and lemons, which makes long combinations rarer.

SymbolR1R2R3R4R5
03 · Feature

A respin whose value depends on the player

The feature adds 12.51% RTP under optimal play and 6.64% if the meter is spent at the first chance. Solving it takes three steps.

1. Exact value of any respin

For a given window and a chosen set of reels R, a held reel keeps its symbol and a respun reel draws from its strip again. Per line, replace p with q:

q_i(s) = p_i(s) if reel i is respun q_i(s) = 1[c_i = s] if reel i is held

The window's expected win is the sum over ten lines. Lines through the same respun reel are dependent, but expectation is linear, so this is exact. A line's value depends only on its five symbols, so a table of 7⁵ contents × 32 reel sets answers any query with ten lookups. That powers the in-game advisor.

Check: respinning all five reels from any window is worth exactly the base RTP, 8.37 line bets.

2. The meter as a Markov chain

States are 0–19 charges plus "full". Each paid spin moves the chain by the number of gears on screen. On a full meter, the player spends if the gain G = best respin − current win clears a threshold g; otherwise the meter stays full and new gears burn. The stationary distribution π gives the feature's return directly:

RTP_feature(g) = Σ_m π_m(g) · E[G · 1{G ≥ g} | state m]

3. The optimal threshold

Waiting costs only the burned charges, about 0.70 per spin. Scanning g shows the optimum at a gain of 3.5× the total bet.

Feature RTP by spending threshold

feature RTP at thresholdoptimum

RTP range

Operators and regulators see the whole range, so the minimum must also be acceptable. Two design rules follow from the persistent meter: each bet level keeps its own meter, otherwise charges collected at a low bet could be spent at a high one; and the meter is capped so that waiting has a price.

StrategyFeature RTPRespin everyAvg gain / respin
Threshold 3.5×12.51%38.8 spins4.85×
Spend at once6.64%28.8 spins1.91×
04 · Verification

Exact numbers, checked by simulation

The simulator plays the full game, meter and respins included, with the chosen strategy and pays the actual outcomes. It shares no code path with the Markov chain. Three runs of 20 million spins averaged 96.17% ± 0.08% against the exact 96.19%.

Run it yourself

Ready

Dashed line: exact value. Band: 95% interval ±1.96·σ/√n using the sample σ.

How many spins prove an RTP

The sample mean wobbles by σ/√n. With the feature, σ ≈ 3.21 total bets per spin, so

n = (1.96 · σ / ε)²
Target accuracy εSpins needed
±1%≈ 396,000
±0.5%≈ 1.6 million
±0.1%≈ 39.6 million

This is why the par sheet relies on exact methods, and why simulation is used as an independent check rather than as the source of the numbers.

Exact methods used

Closed-form line probabilities for RTP and symbol shares · full enumeration of 4.69M outcomes for hit frequency, σ and the win distribution · linearity of expectation for respin values · a 21-state Markov chain for the feature under each strategy.

05 · Project log

How the game evolved

v2 · October 2026
Charge meter and selective respin

Added a non-paying gear symbol, one per strip, and a 20-charge meter per bet level. Gears diluted the strips and base RTP fell from 96.06% to 80.39%, so plum and lemon pays were retuned. Feature value solved exactly with a Markov chain; optimal spending threshold 3.5× total bet; RTP range 90.31–96.19%.

v1 · October 2026
Base game and par sheet

5×3 reels, 10 lines, six symbols. Strips and pays tuned to 96.06% RTP; hit frequency, σ and max win from full enumeration; in-browser Monte Carlo convergence check.