by svat · 7y ago · 0 comments
> Révész in [Strong theorems on coin tossing] tells the following amusing story attributed to T. Varga: “A class of high school children is divided into two sections. In one of the sections, each child is given a coin which he throws two hundred times, recording the resulting head-and-tail sequence on a piece of paper. In the other section, the children do not receive coins, but are told instead that they should try to write down a ‘random’ head-and-tail sequence of length two hundred. Collecting these slips of paper, [a statistician] then tries to subdivide them into their original groups. Most of the time, he succeeds quite well.”
> The statistician’s secret is [...] in a randomly produced sequence of length 200, there are usually runs of length 6 or more: the probability of the event turns out to be close to 97%. On the other hand most children (and adults) are usually afraid of writing down runs longer than 4 or 5 as this is felt as strongly “non-random”. The statistician simply selects the slips that contain runs of length 6 or more as the true random ones. Voilà!
----
Obviously, the way to beat this site (or the above classroom trick) would be to use "true" random numbers. But if one doesn't have access to coins or computers, it raises the question: what is a good way to generate a long sequence of reasonably random coin flips in one's head? For example, if you've memorized many digits of pi or e or some such "believed to be normal" constant, you could use whether each digit is odd or even (or maybe even something like throw away 8 and 9, and read each remaining digit in octal to get 3 random bits). But that only gets you so far...
Doing it in your head is hard, but if you a great memory or can write things down on paper, then you could:
1. Generate a bunch more "random" coin flips than you need and write them down. Do your best to be unbiased, but don't sweat it.
2. Start a new separate list of results.
3. Go through the original results a pair at a time. If the pair is "head, tail", write "head" in the new list. If it's "tail, head", write "tail". If it's "tail, tail" or "head, head", discard it.
This is basically Neumann's "fair coin from a biased coin" trick:
https://en.wikipedia.org/wiki/Fair_coin#Fair_results_from_a_...
In theory, since you know the trick, it might influence the way you generate your initial random sequence. In practice, most of us probably aren't that smart. If you are, repeating the whole process using the results of the previous run a few times should guarantee enough complex mixing that your brain isn't clever enough to back-propagate the trick into how you generate the initial random coin flips.
[1] I have a program that calculates e to some arbitrary number of digits.
I tried the modulo 2 length of the words in the text on the site.
This was effective enough; at the end of three paragraphs the guesser had 50% correct and I had a positive balance. It's also pretty broadly applicable, there's a lot of texts in the world one could choose to use (anyone with a nearby bookshelf or internet connection is set, anyone who can memorize song lyrics, bible passages, poetry, etc doesn't even need that).
There's a reasonable question of whether this distribution is itself biased. If you take one list of the 500 most common English words (https://docs.google.com/spreadsheets/d/1qh3MvdKLfTadXWZMIsaq... ), it turns out that there are 278 with an even length and 222 odd, so that's an indication there may be an exploitable bias. There's also the question of whether relevant N-gram patterns confound that beyond recognition ... or add another layer of predictability.
But then again, there's such a wide variability in potential text choices and the function is so lossy (while being simple enough that most anyone could use it) that it seems like it's a pretty good choice for generating difficult to predict coin flip sequences.
In a pinch I was just choosing left/right depending on vowel or consonant, and flipping the rule every word or so. but the distribution is still a bit too tight.
It feels easier to ditch some of my biases generating a sequence this way.
When poker players need a random source (for instance, deciding when to bluff) they can look at the current or previous tabled cards (or their own cards).