Live data from Hacker News

How to pick a random number from 1-10

torvaney.github.io

41–50 of 183 posts

Re: How to pick a random number from 1-10

#42
post #26

Earlier quoted context omitted.

That's pretty good, as long as each person can't hear any of the previous numbers! The article has the same issue, and might even be biased by the second person knowing they're the second person.

Maybe have them write their numbers down and put them in a hat? Or hey, this is 2019, have them connect to a website or bluetooth beacon and enter a number on their phone? Ooh, or I bet you could make a 10-digit keypad that wirelessly reports to a nearby Raspberry Pi for $2-5 in parts, sort of like those 'clickers' that universities use to quiz large lecture classes. It's too bad that most cheap radio modules are so…

If you are picking numbers from a hat, why not just put in ten numbers and pick one?

Re: How to pick a random number from 1-10

#43
post #19

Earlier quoted context omitted.

That works and is perfectly uniform (if the people are i.i.d.), but requires quizzing around 20, 40, 60 or more people for a number before you can deliver one, while the algorithm described only requires one or two. EDIT: Not quite that many, more like around 9, 18, 27 or so, see below.

I'm not sure I understand. Humans aren't like weighted dice. For example, it's certainly conceivable that a few pairs of these humans misunderstand the goal such that they have a 0% chance of ever choosing numbers that change the respective ordering. Add to that the higher probability that many of these pairs of humans will just toggle their orders each round. Edit: clarification-- the humans don't even have to misun…

That's a good point, I guess you have to also randomly choose the humans?

Re: How to pick a random number from 1-10

#45
post #42

Earlier quoted context omitted.

Maybe have them write their numbers down and put them in a hat? Or hey, this is 2019, have them connect to a website or bluetooth beacon and enter a number on their phone? Ooh, or I bet you could make a 10-digit keypad that wirelessly reports to a nearby Raspberry Pi for $2-5 in parts, sort of like those 'clickers' that universities use to quiz large lecture classes. It's too bad that most cheap radio modules are so…

If you are picking numbers from a hat, why not just put in ten numbers and pick one?

Here, we see the difference between scientists and engineers ;)

Re: How to pick a random number from 1-10

#46
post #42

Earlier quoted context omitted.

Maybe have them write their numbers down and put them in a hat? Or hey, this is 2019, have them connect to a website or bluetooth beacon and enter a number on their phone? Ooh, or I bet you could make a 10-digit keypad that wirelessly reports to a nearby Raspberry Pi for $2-5 in parts, sort of like those 'clickers' that universities use to quiz large lecture classes. It's too bad that most cheap radio modules are so…

If you are picking numbers from a hat, why not just put in ten numbers and pick one?

Well, each group of two could use their own hat. Or they could just write the numbers down instead of saying it. I dunno, the point is they don't have to say them out loud.

Re: How to pick a random number from 1-10

#49
post #37

Earlier quoted context omitted.

Rejection sampling isn't the best way to go. With b bits you are subdividing the (0,1) interval into 2^b regions, and only need more bits if one of the 9 multiples of 0.1 land in the interval you've picked. As b increases this probability drops exponentially. It's a fair point that the number of "numbers" depends on how low the entropy of the source is, but in the link the probability of collision wasn't massive.

But the original post described rejection sampling (once you got your bits from the larger/smaller trick).

Absolutely! I read the von Neumann extractor and presumed too much. For fun, you can reduce the numbers asked by getting a batch of k people, and if all numbers are dissimilar you get a draw from k!

The OP is silly though; if you know the distribution there are way better techniques. They don't seem to worry about how they measure it.

Post reply on HN