I have a very simple simulation program, the sequence is:
- Create an array of 400k elements
- Use a PRNG to pick an index, and mark the element (repeat 400k times)
- Count number of marked elements.
An element may be picked more than once, but counted as only one "marked element".
The PRNG is properly seeded. No matter how many times I run the simulation, I always end up getting around 63% (252k) marked elements.
What is the math behind this? Or was there a fault in my PRNG?
The point would be to ensure that your test is not always selecting the same 252k 'bins.'
I would expect you should see some results that were only picked 1 or a few times.
If I understand probability correctly, if you run your test enough times, theoretically, every outcome should occur at least once. If not, it's possible your PRNG is faulty.
– MrWonderful Jul 22 '14 at 20:42