3 ms·
> 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
by 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."
- lutusp 12y agoDo you actually think the point is to argue with people who actually know things, like a lawyer instead of a scientist? Using a modulo operator is the obvious solution to the original question, and cowardly anonymous downvotes can't erase simple facts -- but they eventually make them have so little contrast on the display that they become unreadable. What an achievement.
- DanBC 12y agoNearly everytime you mention downvotes: the reason is tone and attitude. I don't know if you are aware just how much your tone influences the downvotes.
- lutusp 12y ago> Nearly everytime you mention downvotes: the reason is tone and attitude. Look -- I posted the obvious solution to a common problem. Everything else depends on those who can't stand the unwelcome intrusion of simple, easily stated facts. My "attitude" is that this problem is easily solved, using simple arithmetic. Imagine you're a scientist -- as such, do you object to a useful result because of its source?
- DanBC 12y agoI say this to help you, feel free to ignore it. When you get a downvote, ignore it. It's probably accidental or meaningless and these tend to self correct over a day. When people downvote a bunch of your posts in a thread IGNORE THE DOWNVOTES. Vindictive downvote sprees are usually corrected over the course of the day. Mentioning the downvotes will usually prevent those corrective upvotes. Me tioning the downvotes in the unpleasant way that you do will attract downvotes. You may wish to consider how you're presenting the information. If the first table of numbers gets downvotes posting the same table again without more information is going to get the same downvotes. You could argue that it should not be this way, but it is.
- lutusp 12y ago> You could argue that it should not be this way, but it is. Indeed it is. State facts, back up what you say with evidence, get downvoted. As certain as sunrise. > If the first table of numbers gets downvotes posting the same table again without more information is going to get the same downvotes. The alternative is to adopt the standards of religion instead of science. In religion, if you start losing followers, you change the mythology. In science, evidence is evidence, and how people feel about it has no standing. > When you get a downvote, ignore it. It's probably accidental or meaningless ... Easily proven false. My downvotes inevitably accompany anything I post that has evidence and/or links to references. If I offer an uncorroborated opinion or philosophical remark, however irrelevant or baseless, it's treated neutrally. This is how science works -- you observe things dispassionately and don't let yourself to be swayed by what people think is true.