6 ms·
My parents used the last digit on a stopwatch to decide which of the kids got to pick the radio station in the car and similarly trivial decisions. (If 0-9 cou
by lotharbot 12y ago
My parents used the last digit on a stopwatch to decide which of the kids got to pick the radio station in the car and similarly trivial decisions. (If 0-9 couldn't be divided evenly among the kids present, leftover digits would result in a re-roll.)
This trick takes away two types of pressure:
(1) trying to remember past decisions to be fair. Over a long enough period of time, with a fair coin/die/watch, everyone will get about the same chances. Or you'll walk all the routes about equally. Or you'll equally sample all of the acceptable menu items.
(2) trying to justify which decision was made. There's no need for explaining why Bob got to sit in the front seat, or why you ordered the chicken, or why you walked on 3rd street instead of 2nd. There's no need for second-guessing whether your decision accounted for all of the information and was really reasoned through correctly.
I saw the true value of removing the "justify every decision" step when a friend of mine was suffering from a severe mental illness that made it difficult to make trivial decisions. The result of trying to justify every decision: standing in the kitchen for several minutes because "I want to make a peanut butter sandwich, but I can't decide whether to get the bread or the knife first." By creating an automatic process for making decisions that are only slightly less trivial, we free ourselves to focus on the more important things in life.
- lutusp 12y ago> My parents used the last digit on a stopwatch to decide which of the kids got to pick the radio station in the car and similarly trivial decisions. (If 0-9 couldn't be divided evenly among the kids present, leftover digits would result in a re-roll.) Easily solved by taking the [EDIT: seconds digits] modulo the number of children, but I guess that might be difficult while driving. EDIT: People, please try to think this through before posting an innumerate reply.
- hueving 12y ago>Easily solved by taking the last digit modulo the number of children, but I guess that might be difficult while driving. Well it's not fair. Take 4 children for example. random 0 to 9 mod 4 does not have an even distribution over 0-4. It's also more difficult to explain to children.
- 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.
- cjackson 12y agoUsing modulo would actually bias the results making things slightly less random.
- lutusp 12y agoNot so. If the last digit on the clock is random, then the result is also. 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 EDIT: It must be really, really satisfying to be able to anonymously downvote posts that actually reveal such things as grade-school arithmetic -- thus contributing to the intellectual wasteland that most accurately represents America in the early 21st century.
- phpnode 12y agoyou're getting upset because you're making a terminology error, you say "digit" but mean "digits". A digit is either a finger, or the numbers 0-9, singular.
- lutusp 12y agoI'm getting outraged by the number of brainless cyberlawyers who think downvoting a post constitutes a creative act, on a par with knowing something about the topic of discussion. The pattern is clear and ubiquitous -- if you actually know something, and if you're foolish enough to post a clear exposition, the morons who never post anything coherent will downvote your posts with a probability approaching certainty. The modulo operator is the obvious solution to the original question. And if there were't an atmosphere of pervasive anti-intellectualism at HN, this thread would be much shorted than it is.
- nanofortnight 12y agoWell, you are incorrect. The simple use of modulo does result in a bias. See for instance, modulo 7: 0 % 7 = 0 1 % 7 = 1 2 % 7 = 2 . . . 56 % 7 = 0 57 % 7 = 1 58 % 7 = 2 59 % 7 = 3 From this, you can clearly see that: 0 appears nine times. 1 appears nine times. 2 appears nine times. 3 appears nine times. 4 appears *eight* times. 5 appears *eight* times. 6 appears *eight* times. This is not fair, and is an actual problem in real life: Two examples off the top of my head is when drawing cards in electronic poker games (where slight biases in the PRNG can be exploited by those who notice them) and in cryptography.
- GeneralMayhem 12y agoThat's only fair if you have 2, 5, or 10 kids.
- lutusp 12y agoWhat? Have you thought this through? 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
- huhtenberg 12y agoOnly N first digits are accepted, whereby N is a number of children. Otherwise you re-draw.
- lutusp 12y agoAnother way to say it is that if a glance at the last clock digit turns out to be equal to to less than the number of children, it's accepted as the result, otherwise the operator looks away for a suitable interval and tries again. In other words, digit(s) modulo children.
- deleted 12y ago[deleted]
- baddox 12y agoYou don't want to modulo. You want to multiply the last digit by the number of children and divide by ten.
- lutusp 12y ago> You don't want to modulo. You haven't thought your reply through: 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 > You want to multiply the last digit by the number of children and divide by ten. That doesn't produce the result you think it does. Think a bit harder. If the last digit is 20, and there are four children, the result is 4 * 20 / 10 = 8. There is no eighth child.
- baddox 12y agoYeah, I was joking. The point is that either way you get a non-uniform distribution for n children unless n divides 10. I think the part you are misunderstanding in your responses is that the last digit of a clock has only ten options: 0 through 9. In the tables you have posted, children 0 and 1 each win 30% of the time, while children 2 and 3 each win only 20% of the time. With a single generation, you can't uniformly choose from a set of n options with a random number generator that outputs m options, unless n divides m.
- lutusp 12y ago> I think the part you are misunderstanding in your responses is that the last digit of a clock ... Digits, not digit. I doubt this fact will limit the number of airheads who downvote posts containing useful content.
- baddox 12y agoYour last comment said > If the last digit is 20, and there are four children, the result is 4 * 20 / 10 = 8. Singular "digit."
- vecter 12y agoWhy are you posting examples in base 16? 4 divides 16 evenly, but I bet most people operate in base 10. Say I have 7 children and I get a number 0-9. If the result is 8, how does doing 8 mod 7 help me at all?
- lutusp 12y ago> Why are you posting examples in base 16? I invite you to locate where I posted an example in base 16. > Say I have 7 children and I get a number 0-9. If the result is 8, how does doing 8 mod 7 help me at all? Use both digital watch digits that tally seconds, as in my example.
- nardi 12y agoCan you admit you were wrong yet? Unless the number of kids evenly divides 60, then some kids will have better odds than others. Just some small admission that the odds don't work out perfectly unless N is 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, or 60. Edit: For instance, if there are 59 kids, the first one has twice as good a chance to win as any of the others, because both 0 % 59 and 59 % 59 are 0. In other words, in the set derived from x % 59, for x in {0, 1, ..., 59}, 0 appears twice, and each other number in the range 0-59 only appears once.
- lutusp 12y ago> Can you admit you were wrong yet? I never made the claim you're objecting to. The modulo operator minimizes the bias, it doesn't eliminate it. And it's the most efficient way to solve the problem. My suggestion is that you stop thinking like a lawyer and start thinking like a scientist.
- glomph 12y agoBut the solution you objected to is perfectly fair. How is yours more scientific?
- deleted 12y ago[deleted]
- epi16 12y agoThis is a known problem with C's (and other functions in languages based off C's) "rand" function. http://stackoverflow.com/questions/10984974/why-do-people-say-there-is-modulo-bias-when-using-a-random-number-generator http://stackoverflow.com/questions/10984974/why-do-people-sa...
- lotharbot 12y ago> "Easily solved" It's already solved. If there are 3 kids, 1-3 go to kid A, 4-6 to kid B, 7-9 to kid C, and 0 means try again. There's no bias present in this solution. Since it only takes a fraction of a second to generate a new digit with a stopwatch (using the hundredths of seconds digit) it's no big deal if you have to try five times. Your solution introduces unnecessary arithmetic (what's 47 mod 3?) and unnecessary psychological pressure (will the kids start an argument while you're figuring it out? Will the ones who are better at math start taunting the others?) and it introduces bias in a family as large as ours got (7 or 8 kids can't evenly divide 60; 3, 6, or 7 kids can't evenly divide 100.) A re-roll is simply a superior solution. [Appeal to authority: my dad had a math degree and was valedictorian of his engineering college. I have bachelors and masters degrees in applied math. My oldest brother competed at the national level in Mathcounts. We all agree this is the best practical solution for this problem. Based on the votes, so does the bulk of the technically-minded Hacker News community.]