How to pick a random number from 1-10(torvaney.github.io) |
How to pick a random number from 1-10(torvaney.github.io) |
1. Ask your participant to write down a random number. 2. After they've written that number down, inform them you will guess at their number, and give them a dollar if you guess wrong. 3. Ask if they'd like to change their random number. 4. Allow them to write down their new number.
The before/after would probably change the distribution, and pretty much demonstrate that people can be more random when motivated.
This is effectively the same as the person proposing sampling tuples.
https://docs.google.com/spreadsheets/d/1Dh0wiTCRkBhckWGXtjZg...
(Amusingly, "69" is an over-represented response...)
https://en.wikipedia.org/wiki/Middle-square_method
It can be trivially calculated with pencil and a paper and will be random enough. You just need to pick a seed and off you go.
If it was good enough for Von Neumann it is good enough for you.
That said, I still thought this was an interesting article and I loved the animated bar graphs.
There is nothing exclusive about using this forum. You aren’t the first or the last random person to exist here.
Don’t let your own supposition of your intelligence get to your head. There is even a theory for that.... Dunning Kruger.
Divide all the people into groups of 10. Have the members of a group play each other at whatever, e.g. arm wrestling, to produce a rank from best to worst. Their rank becomes their answer.
Now everyone will reply with a number as close to uniform as the total number of people is divisible by the number of choices.
As a result, a new TI-85 equivalent is only trivially upgraded from what I used 25 years ago and costs exactly as much minus inflation.
From this, you have a sequence of uniformly random bits, from which you can construct a uniformly random number between 1 and 10. A simple way (although, again, likely leaving entropy on the table) is to break these bits into groups of 4; interperate them as 4 bit unsigned integers, and discard any result that is not in the range 1-10.
EDIT: Not quite that many, more like around 9, 18, 27 or so, see below.
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 misunderstand the rule, just the upshot of the process.
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 short-range, because it would be interesting to make something like that and nail them to telephone poles with notes asking people to press a button. You'd have to control for people doing things like hammering the same button repeatedly for a laugh, but it would be fun to see what happened.
Would you be allowed to use HAM bands in the US for that sort of thing if you made them like beacons which sent a callsign after the number value and device ID?
[0] http://people.ischool.berkeley.edu/~nick/aaronson-oracle/ind...
This has the property that if even a single person answers uniformly at random, then the final number you compute will be uniformly random, regardless of how everyone else answers.
Here the input space has a only one dimension. The model has 10 parameters. There are 8500 samples. So, the author safely assumes that no over-fitting occurs.
Seven factorial is way bigger than 10. Just kidding, sorry.
But what I was actually going to say was, when I read the title of the post, before clicking through, I decided to think of a number myself and I chose the number seven. So it was fun to see that same number in the article.
10% chance in theory and in reality it’s about 25% likely for someone to pick the specific number I did. If only the odds in the lottery were this good.
Why, by the way, is it that seven is so popular?
Choose a 2-digit number, say 23, your "seed".
Form a new 2-digit number: the 10's digit plus 6 times the units digit.
The example sequence is 23 --> 20 --> 02 --> 12 --> 13 --> 19 --> 55 --> 35 --> ...
and its period is the order of the multiplier, 6, in the group of residues relatively prime to the modulus, 10. (59 in this case).
The "random digits" are the units digits of the 2-digit numbers, ie, 3,0,2,2,3,9,5,... the sequence mod 10. The arithmetic is simple enough to carry out in your head.
This is an example of my "multiply-with-carry" random number generator, and it seems to provide quite satisfactory sequences mod 2^32 or 2^64 , particularly well suited to the way that modern CPU's do integer arithmetic.
You may choose various multipliers and moduli for examples of random selection of the types you ask about.
A description of the multiply-with-carry method is in the postscript file mwc1.ps, included in
The Marsaglia Random Number CDROM with
The DIEHARD Battery of Tests of Randomness,
available at
http://stat.fsu.edu/pub/diehard/
George Marsaglia
reasonably random
Obviously this is not really something you could automate and if you were to use a clock on an ongoing basis you might be able to predict likely numbers, but that was not in the original scenario.
As I ask each person I cycle a secret number through 0-9 in my head. (I increment mod 10 after I ask each person)
When I ask I get their answer, I secretly add my secret number modulo 10 (and consider 0 === 10) and record this in secret.
Then record a tally for each number, the one with the most wins.
This assumes the asked people will not know or guess my internal number. So I seed based on the first person's number (OK they know!) but everyone else wont.
Edit: someone came up with a simpler solution: https://news.ycombinator.com/item?id=20315835
https://en.wikipedia.org/wiki/Alias_method
but they don't seem to reduce each choice (1-10) to just two options.
This re-maps everyone’s choices so they actually have no idea what number they are actually choosing and efficiently redistributes the bias in their choices without massively complicated functions. It is also robust to changes in the distribution pattern. However it would only work well if you had at least 10 people and the number of people is divisible by 10.
Yes. The above answer just obfuscates the issue. Consider ten people overwhelmingly biased towards 7. The suggested approach in all likelihood gets you 1, 2, 3, 4, 5, 6, 7, 8, 9, 10. Then what? You're clearly not much closer to getting a single random number without a random way of picking one of them.
No, because that ordering can be chosen by someone not in the sequence.
For example height, or age, or distance from the door to the room, or how much I like them, or where in the sequence I arbitrarily decide to put them in. As long as that does not a priori influence their number choice we’re good.
edit: the first person labels the 10 in a jumbled up way, then the 10 people not knowing how they are labeled then jumble themselves up
I see two possible sources of bias:
1. The way in which a person labels the others won't be random. And multiple people may exhibit the same pattern. For example, let's say that people are biased towards trying to label an "average" person as #1. This might be based on height, weight, attractiveness, etc. Then a given person may have an uneven distribution of labels attached to them. Further compounding this could be that the most "average" person is the one most likely to be chosen by the second person.
2. You would need to come up with a random way to pair up the first and second person. The worst case might be that the same two people are always paired with each other, and each person always chooses the same person in the room. Then you would end up with a series of 10 digits repeating themselves.
edit: but then it gets to where you may as well just put the numbers in a hat :P
odd/even or heads/tails: is the seconds odd or even?
For binary selection, keep the watch and tell them to make an indication (say something) in a few seconds. Note down whether the seconds were even or odd, then hand them the clock and swap roles. Keep the watch hidden until the moment you need to inspect it; record the time as soon as you can see the watch. Merge the two notepads to get the final stream of randoms.
For last digit of seconds, wait a few minutes between each query (making sure they can't see the clock during the rest period). "A few minutes" is imprecisely measured by you, who does not have access to a clock. They delay would foil any attempts at them keeping track of the time in their head. Bonus for distracting them to help with that. And instead of asking them for the last digit, have them flip the watch and then record the time that you [both] first saw.
https://cs.haifa.ac.il/~ronen/online_papers/ICALPinvited.pdf
https://people.seas.harvard.edu/~salil/pseudorandomness/extr...
The problem being solved is trying to obtain a distribution arbitrarily close to uniform from sampling a known random distribution.
1 liner.
--
EDIT: I lied, this doesn't work, it biases towards 1-5. I guess you could convert to decimal, and divide by (FFFFFFFFFFFFF / 10)
Can you do a SHA1 in your head?
http://www.righto.com/2014/09/mining-bitcoin-with-pencil-and...
99% of the time the job calls for engineers who can come up with the second type of solution.
EDIT: and don't forget to add 1.
I'm curious whether this technique could be applied to my original problem!
Build a 10^n lookup table with an entry for each of the possible (ordered) n-tuples of values, give each entry a weight of the product of the probabilities of each of the n values making the entry.
Create a set of probabilities for each output and initialise to zero, run through each of the generated tuples in descending order of weight, set the lookup value to the output with the current lowest probability (or the first, or feed in another PRNG - but you have to stop somewhere) and increase the probability according to the weight associated with the tuple.
At the end of this process you'll have a PRNG that's at least as good as the input (and generally better) - although you'll need to query the seed PRNG n times per result. The higher the value of n the better the output (Although the lookup table will become quite large).
It was pretty much uniform.
I was thinking through the post that this sounds like a straightforward problem and it is: https://stackoverflow.com/a/5953133/86433
Except the introduction of an "ideally" optimization condition turns it from a straightforward transform into something requiring a linear programming solver. I wonder if the resultant algorithm is actually any simpler though...
Hair.
Cut (or pull) off a chunk of hair from everyone in the room. Put in a big pile. You'll have hundreds of thousands of hairs. It will be a glorious mess :)
Now ask people in the room to grab a handful of the hairs and count them. Take the last digit of the each count - there's your random number. You could maybe get multiple digits from a single handful - just be aware of Benford's law.
What if the people were primed by the first person saying 7? What if the first person had said 3?
So really you'd need to get your 'random' numbers, check the distribution, than redistribute your 'random' numbers. Which doesn't seem random or 'random' to me.
Fairly slow algorithm. And only good for 8500 random numbers. But I think it would give a good distribution.
In a room of 8500 people, it is likely that there is someone in the room smarter than you and knows a better way to pick random numbers. Come into the room and tell everyone that your objective is to pick a random number from 1-10. Maybe even go as far as to tell them your mod 10 idea. Wait a bit to let them to think about it, then start asking for the random numbers. It is likely that someone will have come up with a better way to pick a random number than your mod 10 solution, and thus their answer will be more uniformly random that what your solution can produce. And thus your solution becomes at least as uniformly random as theirs.
This is how my board game groups pick the first player.
Has any human ever proven they're capable of this? Generating truly random sequences is more or less impossible for humans AFAIK. (E.g., see https://news.ycombinator.com/item?id=19336754 which challenges you to do just that. Spoiler: you will probably fail miserably.)
It's an interesting idea, but in practice I think relying on the assumption that "even" one person is truly answering randomly (let alone uniformly at random) is a non-starter. But perhaps if there are enough people, the resulting sequence blends enough entropy together to get something that looks almost like a uniform random variable anyway? It would be interesting to test empirically.
Philosophically, no it is not possible, though neither can any natural phenomenon for which we reasonably rely on for randomness.
Practically I suppose your goal is just to generate numbers such that the next number cannot be predicted given only the previous numbers but also without considering any outside knowledge. Potentially possible. Potentially impossible to test. If you can beat the test, it probably just means your method beats that specific test
But if you do have independence, the proof is easy! Let S be the sum of everyone else and X be the discrete uniform random in [0, 9]. Then:
Pr(X + S mod 10 = i)
= \sum_j Pr((X + j) mod 10 = i | S = j) Pr(S = j)
= \sum_j Pr(X = i | S = j) Pr(S = j)
= \sum_j Pr(X = i) Pr(S = j)
= Pr(X = i) \sum_j Pr(S = j)
= Pr(X = i)
Due to total probability, symmetry, independence, and total probability again respectively. The handwaved part is the mod where you can imagine the histogram columns in the pmf getting rotated/shifted around but ending up looking exactly the same afterwards since all columns are symmetrical."Can't have the evens, they aren't random. 1 and 9 are too close to the outside. 5 isn't random, it's right in the middle! 3 is too low. Leaving 7"
It does feel like the type of biased logic that would run through your mind in the moment — interesting to think, if we have such 'fallacies' on simple stuff, what level of blindspots do we have on more complex split-second decisions.
Personal guess for why it’s a favorite... 1. I want to signal that I’m creative. If you say “random, between 1-10” picking 5 feels amateur. 2. You said “between 1-10”, which is inclusive of 1 and 10, but you positioned me to not choose the poles with the word “between.”
3. It feels random to iterate through options and settle on one. I iterate by counting up. Since 5 is out, that leaves 6,7,8,9 in my big pile’o’random.
From there, for whatever reason 7 tends to stand out.
Crazy how predictable we are.
Ok so I thought of the same. Let me think of a number before clicking.
Then I thought let me try something fancier, I know I would go around 6-8 so let’s switch it up. Let’s put the scale like 5 6 7 8 9 10 1 2 3 4 5 in my mind. Ok now let’s pick from a weird place, like the first half, say the middle of it. What’s that number. Oh it’s 7. I arrived to the same number while trying not to. Different kind of “randomness” I guess.
Humans are weird! :p
> "Now me," said Mr. Vandemar. "What number am I thinking of?"
> "I beg your pardon?"
> "What number am I thinking of?" repeated Mr. Vandemar. "It's between one and a lot," he added, helpfully.
> "Seven," said the marquis. Mr. Vandemar nodded, impressed.
When I encountered the question the first number that popped into my head was also seven. This was immediately followed by the thought that if I were the one picking a number I should explicitly avoid seven. Does this question and answer pair give anyone else a strong feeling of déjà vu? I think this interaction is a meme [0].
It's also interesting that most people will limit their choice to a (whole number | positive integer). The best choice is probably an irrational number like the square root of two (√2) or pi (π). Although those are still relatively predictable since most people would probably make their selection from the small set of well-known irrational numbers, so you should go one step further and add to or multiply the value.
I was actually surprised to see 3 wasn't the second-most-common for a number from 1 to 10.
I predict you thought of (rot13) Ryrcunag.
Not exactly the same trick, and not guaranteed to work, but this one impressed me at a young age.
The OP says that the model should be built with people in the same room than him, and then the human RNG should be executed with the same people.
As a consequence, OP has to capture the bias of the people in his room to make his RNG work.
The model would break only if the people in the sample change their strategy to pick random numbers after some time.
The data from Reddit is just used as an example of how to make a human RNG from redditer random picks.
As long as the training and testing are done from the same group of people, there is no issue, even if this group is biased.
Moreover, I don't see any prior reason to believe that redditors and HN readers would have different biases. That would be an interesting experiment, though. However, the predominance of the number 7 in article's data might be a western culture thing.
Now try asking for an animal whose name starts with U.
Heck, even granted you have an unsynchronized watch, your "random" numbers are easy to predict, I'll ask you for a random number once per second and after a few answers I don't need to ask any more to know your answer.
You know that we aren't computers right? We don't need any fancy software to detect that kind of attack.
Thus, I recant "around 20, 40, 60 or more" and replace it by "around 9, 18, 27 or more" numbers. Probability that you have to reject any resulting hex digit is obviously 3/8.
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.
Well, if you're really interested in generating random numbers using a group of people, then yes, this may be a problem.
But you should take this as an illustration of the more general problem of generating uniform random numbers from a distribution that is not.
If you think about it this way, author's solution can be applied in a number of practical scenarios. For example, if you want to generate a hash values for objects using properties that are not uniformly distributed. Or if you want to generate random numbers from a physical artifact that is not perfectly uniform.
We could test by asking people to pick numbers less than 100. I bet people would focus on odd numbers, especially those greater than 50, not ending in 5 or not having both digits the same.
That’s a characteristic of the original formulation of the question, not specifically in my solution. It’s implicit in the article that you can choose an arbitrary person in the room without bias.
>The easy thing to do is to ask someone “Hey, pick a random number from 1 to 10!”. The person replies “7!”. Great! Now you have a number. However, you start to wonder, is the number uniformly random?
So the problem reduces to transforming one form of randomness (picking a person) to another form (a uniform numeric distribution. That's implicit in the whole rest of the article.
>If you've got a random way of picking one of ten people, then you've already got a random number between one and ten.
You've got a source of randomness, but you still need to turn that into a number. The article gives one method and I've given another. You could also assign the people numbers from a stack of shuffled numbered tiles, then pick a person although that requires you have the tiles which is not really part of the setup. The conceit is that you have to use people's ability to pick numbers pseudo-randomly. There are probably numerous ways.
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.
Data and light analysis is here: https://docs.google.com/spreadsheets/d/1Dh0wiTCRkBhckWGXtjZg...
I definitely overpaid on Mechanical Turk per response, given how lightning quickly the data came in. (I decided to pay $0.10/HIT for 50 responses and got 68 responses in 8m26s.) I suspect that offering a nickel would have gotten the survey filled in under half an hour still...