awkward probability anecdote

so i was working on a game. the game has haystacks sometimes. if you set fire to the haystack, there's a one in six chance that when it burns away, it turns out to contain a treasure chest! you can get some loot

i implement this. much later, QA reports a bug: the chance of a treasure chest spawning isn't one in six. uhhh ok. i have a look and can't repro. i look at the code and it's the same "random chance" code used everywhere, so if there was anything wrong with it, this wouldn't be where it came up. i have a bit more of a think and then send it back, CNR.

the bug bounces back and forth for 2 weeks as the tester keeps saying it's still not one in six. i am down a few rabbit holes thinking about, could we be not spawning the chest even though the result comes in true? is some other class destroying chests? are some levels containing instances of the haystack that are busted in some way? much to think about

eventually i'm like, ok, what exactly are you seeing in your repro. old mate says "i burn 6 haystacks. sometimes there's no treasure chest at all. sometimes i burn 6 haystacks and get more than one treasure chest. so that's not a 1 in 6 chance"

i now have a new, much more challenging task: explain this without embarassing anyone

2 Likes