I'm a game developer trying to set up some random distributions to produce a desired range of possible outcomes, but am getting confused about margins of error when it comes to unlikely events. Probably a simple question for a statistics expert.
For simplicity, say the game has 20 crates, each of which contains a random reward when the player opens it. If the probability of reward A is 50%:
$$P(A) = 0.5$$
Then the expected value would be 10 rewards total (not sure if I'm using the notation right, correct me if not):
$$E(A) = 20\cdot0.5 = 10$$
On different playthroughs, assuming a $2\sigma$ 95% confidence interval, you're likely to get between about 6 and 14 reward A's 95% of the time:
$$\sigma = \sqrt(0.25\cdot20)\approx2.24$$ $$E(A)+2\sigma=14.48$$ $$E(A)-2\sigma=5.52$$
Running random simulations bears that out, the results match the distribution. What I'm confused about is if reward B is rare, say:
$$P(B) = 0.01$$ $$E(B) = 0.2$$
Then the above math doesn't seem to fit:
$$\sigma \approx 2.24$$ $$E(B)+2\sigma=5.48$$ $$E(B)-2\sigma=-3.48 = 0$$
The likelihood of actually getting 5 reward B's on one playthrough, with an only 1% chance per container, would seem to be way less than 5%, so there must be some scale factor here than I'm missing that correlates the +/- margin of error with the actual probability of the event.
If anyone knows what I'm missing let me know!