I stopped simulating gacha pulls and computed the exact probabilities instead
I built a gacha calculator a few weeks ago, and the first version was wrong in a way that only showed up under the hood.
Monte Carlo gets the tail wrong
My first pass ran a million simulated pulls and averaged the results. That's the approach most gacha calculators use, and for a rough "about how many pulls" answer it works. But it has two problems I kept running into.
First, the tail. The chance of going all the way to hard pity (90 pulls in Genshin Impact) is small — low single digits. A million samples sounds like a lot, but the tail region only gets a few thousand hits, so the number wobbles by a meaningful amount every time you reload. I wanted "the 99th percentile is pull N" to be a solved number, not a dice roll.
Second, it's slow for no reason. I run a static site with no backend. Burning CPU on a million iterations when the answer has a closed form felt lazy.
So I rewrote it with a recurrence.
The recurrence that replaces simulation
The exact probability is a survival problem. Let r(k) be the chance that pull k produces the rare unit (the base rate, ramping up during soft pity, and 1.0 at hard pity). Let S(k) be the probability you still haven't hit after k pulls. Then:
S(0) = 1 S(k) = S(k-1) * (1 - r(k)) And the chance of hitting on exactly pull k is S(k-1) * r(k). That gives you the full probability mass function in about 90 steps instead of a million samples, and it's exact to the precision of your floating point. The "50% of players get it by pull N" number stops being an estimate.
The 50/50 bug that inflated everything by 33%
This is the part that was actually wrong in v1, and I only caught it because the C6 (max-constellation) number looked too high.
A featured character with a 50/50 works like this: when you pull a 5-star, you have a 50% chance it's the featured one, and a 50% chance it's a "lost" 50/50 — in which case the next 5-star is guaranteed featured.
So to get one featured copy, you expect:
0.5 * 1 + 0.5 * 2 = 1.5 five-stars My first version just did 1 / 0.5 = 2 five-stars. That overestimates every featured-copy cost by 33%. The general form is (2 - upRate): 50/50 gives 1.5, and a 75/25 weapon banner gives 1.25.
Getting this wrong turns a 654-pull C6 into an 872-pull C6. For a calculator whose entire job is telling people what to budget, that's the difference between honest advice and a scare.
Soft pity is a guess, not a published number
Here's the part I can't make exact: soft pity. HoYoverse publishes the base rate (0.6%) and the hard pity (90), but not the soft-pity ramp. The community model — starting around pull 74, adding roughly 6 percentage points per pull until it caps — reproduces the observed ~62.5-pull average almost perfectly, so that's what I use.
I keep it honest in the tool: every game page says the soft-pity step is a community approximation, and to treat the in-game announcement as the source of truth.
The numbers that came out right
Once I fixed the 50/50, everything matched the community consensus:
- Genshin character: expected ~62.3 pulls per 5-star (consensus ~62.5)
- C6 featured (7 copies): ~654 pulls
- 1% drop rate over 100 runs: 63.4% chance of at least one
- 5% drop rate over 50 runs: 92.3% chance of at least one
That last pair is a good gut check — people consistently underestimate how many runs it takes to "guarantee" a rare drop.
Try it
The engine is open source at gfopcadmin-ops/gacha-calculator, and the live calculator — pity, drop rate, and cost across eight banners — is at gachacalc.online. If you've got a gacha habit, knowing the exact "50% of players get it by pull 76" beats hoping.
If I got a mechanic wrong for a specific game, tell me — I'd rather fix a parameter than ship a wrong number.