# How to mentally flip a coin?

If you've ever played rock-paper-scissors, and you are reading this on math.stackexchange, you probably know that always playing $1$ of the $3$ choices at random (more precisely: uniformly at random and independently of previous choices) guarantees even chances of victory against any opponent.

But "playing at random" is harder than it looks, particularly if you have no tools - from old-fashioned dice to tech accessing thermal noise. In fact, I've seen a little piece of code that marginally, but consistently over time, beats most humans at rock-paper-scissors simply by looking at biases in how they've been playing so far, and predicting future throws accordingly. For example, humans tend to to play long sequences of identical throws with the "wrong" frequency.

I was wondering if anyone knows good ways to produce reasonably random bits without tools; say, enough to compete with even or as-even-as possible odds against a computer trying to predict one's choices. I realize "good" and "reasonably" (and even "tools") is a bit fuzzy, but I'm sure folks will understand the spirit of the question... I don't want to simulate a Mersenne Twister in my head (though a pseudorandom generator with a reasonable balance of randomness and simplicity would definitely be a possibility), nor use the painful method a friend of mine suggested: pull a random hair from one's head, and check if it's white (for most people it's a biased toss, but as long as one's hair is salt-and-pepper one can trade hair for fairness in the toss).

Buried in the comments below, there's a link to a web page allowing you to test any such scheme!

• Your middle paragraph is throwing me off. Are you trying to win at rock-paper-scissors, or are you trying to produce numbers out of your head uniformly at random and independently? If the latter—you might be able to do so, but you won't be able to prove it! :) – Wildcard Jan 12 '17 at 4:35
• @Razin the question is this: suppose I ask you to come up with a sequence of heads and tails that looks random, enough to ideally fool a computer. But you are not allowed to check your own computer, use dice and whatever. Just use your head. Can you do it? It's harder than it looks. – Anonymous Jan 12 '17 at 4:56
• Just wait 'till you're as old as I am and short-term memory is totally shot, then each thought that pops to mind is random and...what was the question again? – BruceET Jan 12 '17 at 7:55
• What I would suggest is to choose a sequence and a number $n$ at random (to the best of your ability). Then the bit produced is each number in the sequence module 2 until you reach the $n$th number. Rinse, lather, repeat. – Noah May Jan 19 '17 at 5:34
• You could precompute a long sequence of random numbers, then memorize them. Each time you need a random number use the next one in the sequence. People are able to memorize tens of thousands of digits of pi and e. You could do it once then be set for life – Nick Alger Jan 20 '17 at 7:33

1. I have freckles. I just encircle with thumb and forefinger a “random" portion of my arm, count the freckles, and take the parity. It takes about 3-5 seconds. I guess that someone who is fairly hairy could do the same counting hair.

2. Talking of counting hair, I take a small lock of my hair (I have long hair), and then try to split it as evenly as possible in two “half locks”, each with half the hair. I repeat the same process on one of the half locks, and then on one of the quarter locks, until I’m left with a single hair. The parity of the number of halvings is my random bit. It takes me about 5-10 seconds to produce it. I’ve found this to be quicker than the more obvious method of just counting the hairs and taking their parity.

3. I play a really fast paced word association game: I think of a word, the very first word associated to it, the second, third and fourth (using my hand’s fingers to count the five words helps). My random bit is the order of the third last letters of the last two words. It’s easier to do than to say, it takes no more than $3$ seconds.

4. This is somewhat general, though I guess everyone should make it specific to one’s interests in life. I let my mind wander and pick $3$ artists (musicians, bookwriters, painters, etc.) and think of how many of the pieces of each I’ve heard/read/seen. I add the numbers and take the parity. A programmer friend of mine says for him it works really well with examples of some obscure software categories I can’t quite remember. I guess a gourmet could use types of food: how many vegetable soups. omelettes, and bottles of red wine he’s had in the last two weeks.

5. I pick a number that strikes my fancy, and play the $3n+1$ game (halve it if even or triple it and add $1$ if odd, and then repeat) for $20$ steps, using the (parity of) the second last digit. I've not tried this extensively enough to detect any bias, which instead affects the last digit, but I guess one could correct it with the method the OP suggests for white hair counting. This is slowish (about $20-30$ seconds), but still a bit faster than the congruential generator another poster suggested, at least for me.

6. If you are good at remembering phone numbers of people, their least significant digits are a good source of randomness against people who know relatively little of your contacts. You can always scramble them a little, like reversing them and skipping every other digit.

• Wow, 6 answers :) And some of them are quite good, I have to say; the phone numbers one would work very well for me, for example (on koaning.io/human-entropy.html, taking the last 4 digits, discarding any that is 8 or 9, and using the the 3 bits of every other, I generated without much effort about 1 bit/second, and the result was undistinguishable from that of a pseudorandom generator). The 3n+1, on the other hand, seems to works terribly (I tried starting with 123); there's a lot of correlation between consecutive "second last" digits. – Anonymous Mar 2 '17 at 10:17
• It was not an easy choice, because I got a number of really good answers, but after thinking a lot about it, I decided to award the bounty to this one! – Anonymous Mar 2 '17 at 19:01

This is one strategy that seems to work for me (36). I talk to myself (11). And for every sentence, I just count the letters in my head (46). Then, I can use the least significant bit, or maybe two, as "random" bits (50). It's a game I used to play as a pasttime for its own sake ... (43) and if I add the numbers wrong, well, it doesn't really seem to affect the randomness (76)! The numbers in parentheses are, if you haven't guessed, the letter counts of each sentence (71).

• I don't really mind the downvote (in fact, I'd rather not have my answer as the top scoring one) but ... would anyone who downvoted care to explain why? Do you think it's an answer that does not work? Do you think it's wrong for me to provide an answer to my own question? – Anonymous Jan 23 '17 at 21:13

You could precompute a long sequence of random numbers, then memorize them. Each time you need a random number use the next one in the sequence.

People are able to memorize tens of thousands of digits of $\pi$ and $e$. You could do it once then be set for life.

(This is a conversion of a comment to an answer)

Think of a five digit number. Add its digits. If it produces an even number, say it counts for heads. If it produces an odd number, say it counts for tails.

I base this on the fact that while there might be some bias on the numbers you would chose on a smaller scale (of less digits), five-or if you can/or the situation allows, even more digits-provides a sufficient "random hedge". i.e-your brain will not pre-compute the result (even or odd).

It also looks much faster than other methods proposed, particularly if you are involved in some form of fast paced game.

• One problem is that mentally odd digits seem more "random" to many people and may be overrepresented. Then odd digit sums would also be overrepresented. Maybe take the congruence class mod 3 of the digit sum. That is unbiased with respect to even vs odd digit choice and still easy enough to do in your head. (Add the digits; if the result has multiple digits add them; when you get to the range 1..9 take congruence mod 3.) – q.t.f. Mar 2 '17 at 10:14

a pseudorandom generator with a reasonable balance of randomness and simplicity would definitely be a possibility

Well, then let's pick a small multiplicative linear congruential generator.

Let $m=251$ $a=33$

Starting from a initial random (well..) value x[0] in the range $1 \cdots 250$ in each iteration we do mentally the following (pseudocode):

x[n] := x[n-1] * 33 ;
x[n] := x[n] % 251 ;
y[n] := x[n] % 2 ;


Ok, the second statement is not very easy to do mentally, but it can be slightly easied by substracting, for example:

while ( x[n] >= 251) {
if(x[n] >= 2008) x[n] -= 2008;
else if(x[n] >= 1004) x[n] -= 1004;
else if(x[n] >= 502) x[n] -= 502;
else x[n] -= 251;
}


Possible ideas:

1. Look around you and identify an object that stands out to you (not the sky, clouds, etc.). Then, count the letters in one word (or words) you could use to describe that object. Based on the letters in that word (odd or even; 0,1,or 2 mod 3, etc) you can make your random decision. (I wasn't able to find the percentage of English words with an odd or even number of letters, but this should be somewhat random.)

2. Clear your throat. If the number of sounds you make is odd, flip heads. If the number of sounds you make is even, flip heads. The logic is that (at least for me) I clear my throat in two "coughs" and three "coughs" about half the time each. (I rarely clear my throat in one "cough" or in four "coughs".)

3. Jump (or even make a small hop) into the air. As you do, start counting integers from 1 as fast as possible inside your head. As soon as you land, stop counting. Then you can take the integer you ended on and take that mod 2, mod 3 etc. for whatever purpose you wish.

Hope this helped :)

• I like 1! Even if it does produce some bias in the number of letters being odd or even, one can always erase that with a few extra tosses. Thanks! – Anonymous Feb 26 '17 at 0:15
• Yes, that is true. The throat-clearing trick and the jump&count idea are probably even less random (I tried the jumping trick a few times and I was never able to get past 10 - but that may be just because I am no athlete to say the least). Glad you liked it! – Michael Wang Feb 26 '17 at 5:49

What I would suggest is to choose a sequence and a number $n$ at random (to the best of your ability). Then the bits produced is each number in the sequence module 2 until you reach the $n$th number. Rinse, lather, repeat. Then append the sequences together.

For example, we could start with the number of partitions (A000041) and $n=6$.

1, 2, 3, 5, 7, 11
1, 0, 1, 1, 1, 1  (mod 2)


Then move on to the Thue-Morse Sequence (A010060) with $n=18$.

0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0 (already mod 2)


And so on.

Of course you should use relatively small integers for $n$ - say between 1 and 25 - and make sure to avoid or at least use sparingly "useless" sequences such as the even numbers (A005843 just in case you needed it).

• I don't see how to produce this sequence without using resources comparable to that needed to simulate a PRNG :). Also, a large part of this problem is probably the need to extract pure random bits from an entropic sequence. The partition function for instance has obvious biases in residue classes. – Erick Wong Jan 19 '17 at 20:40
• @Erik Wong, Look at Anonymous's first reply comment to Razin. As for the biases in sequences, I would assume that the majority of them would balance out. – Noah May Jan 19 '17 at 21:52
• I've looked at Anonymous's comments. It explicitly says that you are not allowed to check a computer, just mental calculation. How do you propose to implement this suggestion using just your head? If it requires precomputation and looking up web pages, I'm not sure how this works better than just browsing a web site that generates random bits. Anonymous requested making this into an answer, so I will refrain from downvoting. – Erick Wong Jan 20 '17 at 0:40
• Think of a 'random' color (does not need to be too random).
• Look in a 'random' direction (again ,, ,, ).
• Choose the first object that you notice with that color.
• Close your left eye, and open you right eye.
• Now open you left eye and close your right eye.

You have a slightly different perspective with both eyes. If the object is better visible with your right eye (covers a slightly larger solid angle) the answer is HEAD. Otherwise the answer is TAIL.

• I've tried this, but there seems to be a small but definite bias. Apparently I tend to centre my view on my left eye. However, one can correct this in the usual way (toss two coins, if HH or TT repeat, if HT declare H, if TH declare T), and it seems a fun and reasonably effective way to do it (though of course you need to be immersed in some scenery). Thanks! – Anonymous Feb 24 '17 at 14:08

If you can use the environment - that is, not strictly mentally only - there are a few things I often do. And a lot more similar you can figure

• Use the seconds from a nearby watch, modulo N - or minutes if low frequency or some correlation is OK. Great for N up to 6 (and 10 and 12 and... but those are rarer)
• If playing cards, memorise some of the cards from your previous hand. Use red/black, or face value.
• Pick a number/digit/letter from wherever you can. As in, 4th letter, 3rd word, 2nd line in this text: "o". Or, the first digit of the licence plate of the next red car. Or...

I have posted a very similar answer to a very similar question "Mentally generating a pseudo random $\{0,1\}$ sequence with uniform distribution"....

as per @Nick Alger's answer, When I was young I memorized the first 100 or so digits of π. I did it for a fun challenge at the time, and for many years (decades?), I did not encounter any 'useful' application of this.

However, as my career has moved away from physics/engineering and more towards statistics, I have found that this knowledge is extremely useful as a source of unbiased random sampling.

For example, given that π=3.1415926535897932384626433832795028841971693993751058209749...

if I need to find a random sample of coin flips $\{0,1\}$, I consider the successive digits (after the decimal point) of π modulo 2. That is, if the digit is even, the outcome is $0$, and if it is odd, the outcome is $1$. Thus, the sequence is: $$\{1,0,1,1,1,0,0,1,1,1,0,1,1,1,1,0,1,0,…\}$$

One can also set a different ('random seed') by skipping the first $x$ digits.

It should be obvious that this technique works for sampling when 2, 5 or 10 options are required. However, what is awesome is that with only a minor modification it can works just a easily if 3,4,6,7,8 or 9 options are required.

For example, if you need to model a roll of a die where 6 options are required, go through the digits one at a time, and if the digits is 0,1,2,3,4, or 5 than 'accept' that as the outcome and if it is 6 or higher than 'reject' / skip that digit. This method of sampling is called rejection sampling.

Thus the sampling would be: $$\{1,4,1,5,x,2,x,5,3,5,x,x,x,x,3,2,3...\} \rightarrow \{1,4,1,5,2,5,3,5,3,2,3…\}$$