<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[BoosterHand Lab]]></title><description><![CDATA[BoosterHand Lab]]></description><link>https://boosterhand.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6af82ebb222a4e60c481db6b/c29af6c3-bd2d-467d-a63c-e862ad254d84.png</url><title>BoosterHand Lab</title><link>https://boosterhand.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Fri, 04 Dec 2026 23:43:22 GMT</lastBuildDate><atom:link href="https://boosterhand.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Plinko Is Pascal's Triangle: Exact Slot Odds for 8, 12 and 16 Rows in Python]]></title><description><![CDATA[Every Plinko board hides the same piece of math: Pascal's triangle. Once you see it, the "1,000×" edge slots stop looking reachable. At each peg the ball…]]></description><link>https://boosterhand.hashnode.dev/plinko-is-pascal-s-triangle-exact-slot-odds-for-8-12-and-16-rows-in-python</link><guid isPermaLink="true">https://boosterhand.hashnode.dev/plinko-is-pascal-s-triangle-exact-slot-odds-for-8-12-and-16-rows-in-python</guid><category><![CDATA[Python]]></category><category><![CDATA[probability]]></category><category><![CDATA[statistics]]></category><dc:creator><![CDATA[BoosterHand Lab]]></dc:creator><pubDate>Wed, 02 Dec 2026 14:47:17 GMT</pubDate><content:encoded><![CDATA[<p>Every Plinko board hides the same piece of math: Pascal's triangle. Once you see it, the "1,000×" edge slots stop looking reachable.</p>
<h2>One ball = n coin flips</h2>
<p>At each peg the ball goes left or right with probability 1/2. After <strong>n</strong> rows it lands in slot <strong>k</strong>, where k is the number of right bounces. So the slot follows a binomial distribution:</p>
<pre><code>P(slot k) = C(n, k) / 2^n
</code></pre>
<h2>The code</h2>
<pre><code class="language-python">from math import comb

def slot_odds(rows):
    return [comb(rows, k) / 2 ** rows for k in range(rows + 1)]

for n in (8, 12, 16):
    p = slot_odds(n)
    print(f"{n} rows: edge 1 in {1 / p[0]:,.0f}, centre {p[n // 2]:.2%}, middle 3 slots {sum(p[n//2-1:n//2+2]):.1%}")
</code></pre>
<p>Output:</p>
<pre><code>8 rows: edge 1 in 256, centre 27.34%, middle 3 slots 71.1%
12 rows: edge 1 in 4,096, centre 22.56%, middle 3 slots 61.2%
16 rows: edge 1 in 65,536, centre 19.64%, middle 3 slots 54.6%
</code></pre>
<h2>What it means</h2>
<ul>
<li><strong>Each extra row halves the edge chance.</strong> 16 rows put each edge at 1 in 65,536; either edge is 1 in 32,768.</li>
<li><strong>The middle carries the board.</strong> More than half of all balls land in the three centre slots even on 16 rows. On most high-risk payout tables those slots pay less than 1×.</li>
<li><strong>Risk level changes payouts, not odds.</strong> Low, medium and high tables reuse the same binomial probabilities; they only move money from the middle to the edges.</li>
<li><strong>RTP is a dot product.</strong> <code>sum(p[k] * payout[k])</code>. Plug in any game's table to get its RTP, and 1 − RTP is the house edge.</li>
</ul>
<h2>Try it</h2>
<ul>
<li>Plot <code>slot_odds(16)</code> next to a histogram of <code>numpy.random.binomial(16, 0.5, 1_000_000)</code>: the bell curve appears on its own.</li>
<li>Paste a real payout table and compute the RTP.</li>
<li>Compute the variance per ball for low vs high risk tables with the same RTP.</li>
</ul>
<p>Full tables for 8, 12 and 16 rows: <a href="https://boosterhand.com/guides/plinko-odds-chart/">Plinko odds chart</a>. Interactive version for any payout table: <a href="https://boosterhand.com/tools/plinko-calculator/">Plinko calculator</a>. Code: <a href="https://github.com/AndrewCharov/casino-math-simulations/tree/main/plinko-1m-balls">GitHub</a>.</p>
<p><em>18+. A probability exercise, not betting advice.</em></p>
]]></content:encoded></item><item><title><![CDATA[Gambler's Fallacy Tested: 1,000,000 Roulette Spins in NumPy (Is Red Ever Due?)]]></title><description><![CDATA[Black, black, black, black, black. Five in a row, so red has to come next, right? That feeling has a name, the gambler's fallacy. Instead of arguing about…]]></description><link>https://boosterhand.hashnode.dev/gambler-s-fallacy-tested-1-000-000-roulette-spins-in-numpy-is-red-ever-due</link><guid isPermaLink="true">https://boosterhand.hashnode.dev/gambler-s-fallacy-tested-1-000-000-roulette-spins-in-numpy-is-red-ever-due</guid><category><![CDATA[Python]]></category><category><![CDATA[probability]]></category><category><![CDATA[statistics]]></category><category><![CDATA[numpy]]></category><dc:creator><![CDATA[BoosterHand Lab]]></dc:creator><pubDate>Wed, 02 Dec 2026 14:44:06 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6af82ebb222a4e60c481db6b/19429428-50a5-4305-9614-687a655787e4.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Black, black, black, black, black. Five in a row, so red has to come next, right? That feeling has a name, the gambler's fallacy. Instead of arguing about it, I spun a simulated European roulette wheel 1,000,000 times and checked what actually happened after every streak.</p>
<h2>The setup</h2>
<p>A European wheel has 37 pockets: 18 red, 18 black and one green zero. Every pocket is equally likely, so red should win 18/37 = 48.6% of spins, with or without a streak before it.</p>
<p>The test is simple: find every place in the sequence where black came up k times in a row, and look at the very next spin. If red were ever "due", the red share would climb as k grows.</p>
<h2>The code</h2>
<p>A rolling sum over a boolean array finds every streak at once, no loops over a million spins:</p>
<pre><code class="language-python">import numpy as np

rng = np.random.default_rng(707)
N = 1_000_000
RED = np.array([1, 3, 5, 7, 9, 12, 14, 16, 18, 19, 21, 23, 25, 27, 30, 32, 34, 36])
spins = rng.integers(0, 37, N)                     # European wheel: 0..36
red = np.isin(spins, RED)
black = (spins != 0) &amp; ~red
print(f"red {red.mean():.1%}  black {black.mean():.1%}  green {(spins == 0).mean():.1%}")

for k in (1, 3, 5, 8):
    # windows where the previous k spins were all black -&gt; look at the next spin
    run = np.convolve(black.astype(int), np.ones(k, int), "valid")[:-1] == k
    nxt = np.flatnonzero(run) + k
    print(f"after {k} black(s) in a row: {nxt.size:&gt;7,} cases, red next {red[nxt].mean():.1%}")
</code></pre>
<p>Output:</p>
<pre><code>red 48.6%  black 48.7%  green 2.7%
after 1 black(s) in a row: 486,619 cases, red next 48.5%
after 3 black(s) in a row: 115,917 cases, red next 48.4%
after 5 black(s) in a row:  27,712 cases, red next 48.3%
after 8 black(s) in a row:   3,317 cases, red next 48.0%
</code></pre>
<h2>What the numbers say</h2>
<p><strong>Red never gets more likely.</strong> After one black, red came next 48.5% of the time. After eight blacks in a row, 48.0%. Both are just 48.6% plus noise, and the sample shrinks fast: only 3,317 cases of eight blacks in a million spins.</p>
<p><strong>The wheel has no memory.</strong> Each spin is a fresh draw from the same 37 pockets. Long-run balance comes from old streaks being diluted by everything after them, not from the wheel "correcting" itself.</p>
<p><strong>Streaks are normal.</strong> The longest run of one colour in this million spins was 18 in a row. A doubling system that started at $10 on red would have needed $2,621,430 in total bets to get through it.</p>
<p><strong>Waiting does not help.</strong> "Wait for 5 blacks, then bet red" returned 96.6 cents per dollar in this run, against 97.2 cents for betting red every spin. Both are the 1/37 house edge plus noise.</p>
<h2>Things to try</h2>
<ul>
<li>Replace the wheel with <code>rng.integers(0, 38, N)</code> and a double zero to model an American wheel.</li>
<li>Count streaks of red instead of black, or of "any colour", and look at the distribution of streak lengths.</li>
<li>Compute the binomial confidence interval for each row. The 8-black row is wide enough that 48.0% and 48.6% are indistinguishable.</li>
</ul>
<p>Full write-up with charts: <a href="https://boosterhand.com/lab/gamblers-fallacy-1-million-roulette-spins/">Gambler's fallacy tested: is red ever due?</a>. All the simulation code is on <a href="https://github.com/AndrewCharov/casino-math-simulations/tree/main/gamblers-fallacy-1m-spins">GitHub</a>.</p>
<p><em>18+. A probability exercise, not betting advice.</em></p>
]]></content:encoded></item><item><title><![CDATA[I Tested the "Win $300 a Day" Strategy on 10,000 Players for a Year (Python)]]></title><description><![CDATA[The pitch is simple: "Stop the moment you're up $300. Do it every day and that's $109,500 a year." It sounds disciplined, and most days it even works. I…]]></description><link>https://boosterhand.hashnode.dev/i-tested-the-win-300-a-day-strategy-on-10-000-players-for-a-year-python</link><guid isPermaLink="true">https://boosterhand.hashnode.dev/i-tested-the-win-300-a-day-strategy-on-10-000-players-for-a-year-python</guid><category><![CDATA[Python]]></category><category><![CDATA[probability]]></category><category><![CDATA[Data Science]]></category><category><![CDATA[numpy]]></category><dc:creator><![CDATA[BoosterHand Lab]]></dc:creator><pubDate>Sat, 14 Nov 2026 09:59:36 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6af82ebb222a4e60c481db6b/0273e5b5-e35b-4095-a5eb-26cda0ffd102.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The pitch is simple: "Stop the moment you're up $300. Do it every day and that's $109,500 a year." It sounds disciplined, and most days it even works.</p>
<p>I wanted to know what a year of it actually looks like, so I simulated the plan for 10,000 players over 365 days, spin by spin. It's a nice excuse to use one of the oldest results in probability: the gambler's ruin.</p>
<h2>The rules</h2>
<ul>
<li>A fresh <strong>$1,000</strong> every day</li>
<li>Flat <strong>$50 bets on red</strong>, European roulette: 18 of 37 pockets win (48.6%)</li>
<li>Stop at <strong>+$300</strong>, or when the day's $1,000 is gone</li>
</ul>
<p>So every day ends one of two ways: <strong>+$300</strong> or <strong>−$1,000</strong>.</p>
<h2>Exact answer first: the gambler's ruin</h2>
<p>Measured in bets, each day is a random walk that starts at 20 (= $1,000 / $50) and stops at 0 or 26. The probability of hitting the top first has a closed form. With <code>r = q / p</code>:</p>
<p><code>P(win) = (1 − r^i) / (1 − r^n)</code>, where <code>i</code> is the start and <code>n</code> the target.</p>
<p>Then the Monte Carlo version as a cross-check. Vectorizing across <em>days</em> instead of players keeps it fast: all 365,000 days advance one spin per loop, and finished days drop out of the <code>active</code> index.</p>
<pre><code class="language-python">import numpy as np

def p_reach_target(bet, p, bank=1_000, target=300):
    """Gambler's ruin: chance to go from bank to bank+target before 0, flat bets."""
    i, n = bank // bet, (bank + target) // bet
    r = (1 - p) / p
    return (1 - r**i) / (1 - r**n)

print(f"exact: {p_reach_target(50, 18/37):.1%} of days end at +$300")

# Monte Carlo: 1,000 players x 365 days, every spin simulated
rng = np.random.default_rng(1919)
PLAYERS, DAYS, BET, P = 1_000, 365, 50, 18 / 37
start, goal = 1_000 // BET, 1_300 // BET          # positions measured in bets
pos = np.full(PLAYERS * DAYS, start)
active = np.arange(pos.size)
while active.size:                                  # each loop = one spin for every unfinished day
    pos[active] += np.where(rng.random(active.size) &lt; P, 1, -1)
    active = active[(pos[active] &gt; 0) &amp; (pos[active] &lt; goal)]

won = (pos == goal).reshape(PLAYERS, DAYS)
year = np.where(won, 300, -1_000).sum(axis=1)
print(f"simulated: {won.mean():.1%} winning days")
print(f"median year: {np.median(year):+,.0f} USD, players ahead: {(year &gt; 0).sum()} of {PLAYERS}")
</code></pre>
<p>Output:</p>
<pre><code>exact: 63.3% of days end at +$300
simulated: 63.2% winning days
median year: -64,700 USD, players ahead: 0 of 1000
</code></pre>
<h2>The results for 10,000 players</h2>
<p>The full run (10,000 players, 3,650,000 days, about 479 million spins) gave the same picture:</p>
<table>
<thead>
<tr>
<th>After one year</th>
<th>$50 on red</th>
</tr>
</thead>
<tbody><tr>
<td>Promised</td>
<td>+$109,500</td>
</tr>
<tr>
<td>Winning days</td>
<td>63.3%</td>
</tr>
<tr>
<td>Median player</td>
<td>−$64,700</td>
</tr>
<tr>
<td>Best player</td>
<td>−$21,800</td>
</tr>
<tr>
<td>Players ahead</td>
<td><strong>0 of 10,000</strong></td>
</tr>
</tbody></table>
<p>After day 1, 63% of players were ahead. After day 30, 3.9%. After day 180, nobody.</p>
<h2>Why winning 63% of days still loses</h2>
<p>The days are not the same size. A green day adds $300, a red day takes $1,000, so one red day erases 3.3 green ones. Break-even needs 1,000 / 1,300 = <strong>76.9%</strong> winning days. The plan delivers 63.3%, and the luckiest of 10,000 players reached 264 of 365.</p>
<p>The house edge doesn't care about the stop rule either. Each player wagered about $2.39 million in the year. The expected loss on a single-zero wheel is 1/37 of every dollar bet, and the simulated loss came out at 2.71%. The stop-win rule only changes <em>when</em> you stop betting, not what each bet costs.</p>
<p>A nice sanity check: on a perfectly fair game (p = 0.5) the same rules win exactly 76.9% of days, which is exactly break-even. The stop rule can't create money; it only packs losses into fewer, bigger days.</p>
<h2>Things to try</h2>
<ul>
<li><code>p_reach_target(100, 18/37)</code>: bigger bets reach +$300 on 70.4% of days (fewer spins exposed to the edge), but still lose over a year.</li>
<li><code>p_reach_target(25, 18/37)</code>: smaller bets are worse, 49.2%.</li>
<li>Set <code>P = 0.4975</code> to model a game with a 0.5% edge. About 16% of players finish ahead, and the average still loses 0.5% of everything bet.</li>
</ul>
<p>The full write-up with charts (one player's calendar, all 10,000 bankroll lines, a player who won 27 days in a row and still lost $58,200) is here: <a href="https://boosterhand.com/lab/win-300-a-day-strategy-simulation-365-days-10000-players/">I tested the "win $300 a day" strategy for 365 days</a>. The complete simulation code is on GitHub in <a href="https://github.com/AndrewCharov/casino-math-simulations/tree/main/win-300-a-day-365-days">casino-math-simulations</a>.</p>
<p><em>18+. A probability exercise, not betting advice: no daily goal turns the house edge around.</em></p>
]]></content:encoded></item></channel></rss>