3 ms·
> random 0 to 9 mod 4 does not have an even distribution over 0-4. That's true, but only because 4 never appears in the result. The possible results for modulo
by lutusp 12y ago
> random 0 to 9 mod 4 does not have an even distribution over 0-4.
That's true, but only because 4 never appears in the result. The possible results for modulo 4 are 0 - 3.
The first child is numbered zero. Shall I explain it in more detail?
n n % 4
-----------
0 0
1 1
2 2
3 3
4 0
5 1
6 2
7 3
8 0
9 1
10 2
11 3
12 0
13 1
14 2
15 3
> It's also more difficult to explain to children.
And rewarding, unless you want your children to grow up innumerate.
- aeosynth 12y agoif the stopwatch uses base 10, the last digit will be in the range [0, 9], making n >=10 irrelevant. in this range, 0 and 1 appear 3 times; 2 and 3 appear 2 times. if the stopwatch uses hex, then 0-3 will appear equally often in this case
- lutusp 12y agoThe second digits on my digital watches extend to 59, and if a precocious youngster were to correctly object that a limit of 59 produces a bias, I would extend the range by multiplying the minute digit by 60 and adding it to the seconds (thus reducing the bias). We are, after all, most likely using a calculator to produce the result. > if the stopwatch uses hex ... I think we're safely in the red herring zone now. :) EDIT: Yes, of course -- when confronted by a correct and reasoned reply, downvote it to discourage any such mistakes in the future.
- aeosynth 12y agoi think you're confused on what a 'last digit' is. the seconds digits (plural) contain two digits, which range from 0-59; the last digit (singular) ranges from 0-9
- lutusp 12y ago> i think you're confused on what a 'last digit' is. Digits, not digit, please, and do try to limit the anti-intellectualism and adversarial posture.
- valleyer 12y agoThe last digit on the clock can only be 0 through 9. If you truncate your chart accordingly, 0 and 1 are represented more than 2 and 3. Or do you mean “the entire seconds value” (for which this idea would work with four children) instead of “the last digit”?
- lutusp 12y agoTo avoid confusion, I used the expression "last digits".
- baddox 12y agoIt actually doesn't matter how many options are in your random number generator. You only get a normal distribution if the number of children you have divides the number of options in your generator. Even if you're using the seconds of a clock, it doesn't work for 7 children.
- lutusp 12y ago> It actually doesn't matter how many options are in your random number generator. It certainly does -- the larger the random number, the fairer the outcome is. > Even if you're using the seconds of a clock, it doesn't work for 7 children. For a digits range of 0 - 59? Plus the fallback in the face of a precocious child of adding the number of minutes * 60?