The Riddle of Randomness

Cross-posted at Geek Girl Con’s blog!

Last year at Geek Girl Con, I had the privilege of participating in the Do-It-Yourself Science Zone teaching kids about probability and randomness.

GeekGirlCon 2014 at Washington State Conference Center in Seattle, Washington, on Saturday, October 11, 2014.
GeekGirlCon 2014 at Washington State Conference Center in Seattle, Washington, on Saturday, October 11, 2014.

However, being The Riddler, I had a secret agenda in mind while doing my demonstrations — I have a trio of ten-sided dice that I use to gamble with my fellow super-villains, and I wanted to figure out which of them, if any, had a bias for or against any particular number. What better way to find out, than to offload the boring task of rolling those dice over and over again onto unsuspecting passers-by?

In order to determine whether a particular die has a bias for or against a number, it takes a lot of rolls. If you gently put a die down on the table, you’re adding no entropy to it, and so you can easily predict what face it’ll land on — probably because you’re the one putting the die down, and can put it on whatever face you want. Shaking the die, throwing it, and throwing it onto a surface that is not particularly smooth, all adds entropy to the throw. Entropy is change, chaos — the opposite of order. It steals energy from the universe and from the precious order that humankind so loves, so shaking the die is putting energy into it to increase the chaos. The more chaotic the roll, the less likely you are to be able to predict where it will land.

Except, not all dice are perfectly smooth or have perfectly sharp corners or are weighted exactly uniformly — the corners are rounded, having been tumbled smooth; the faces are carved with the numbers on them; the materials might have pooled in one side of the die more than others. That means that there may already be a bias in the die, that causes it to land on one face more than others.

Humans really don’t understand randomness. If you ask them to put a bunch of dots on a page completely randomly, they try to space them out, to cover as much of the page as possible. You care where you put your next dot after putting your last, because you have to move your arm mechanically from dot to dot to dot, trying also to stay on the page and trying not to cluster them too much. I had the kids who stopped by draw me some dots on a page in order to show them what randomness really looks like. Real randomness doesn’t care about the position of the last dot when it puts its next, using a computer program that — while not truly random, because it’s a computer — is still way better than humans. With real randomness, you’ll get clusters of dots, big empty white spaces, dots that touch or even overlap the edge of the page, and sometimes even one another. It would look something like this:

Randomly placed blue dots, computer generated
Randomly placed blue dots, computer generated

With a truly random die roll, and with a perfectly fair die, you would expect that over time, every single face has exactly the same probability of coming up as any other face. But since we already know that dice are probably not perfectly fair, any one die might land on one face more often than the others. So I had the kids who came along roll one of three special dice, and I recorded the results in my computer in a little program I whipped up to build graphs. I also built a “virtual die” that let the computer pretend to roll a ten-sided die over and over and over again, in order to show what a “fair die” graph might look like with each bar looking roughly the same height. It looked like this:

Graph of randomized fake die rolls over time - pretty close to exactly even
Graph of randomized fake die rolls over time – pretty close to exactly even

If you look at the numbers that it took to make a graph that looks mostly flat, like the randomly generated rolls, it took more than 200,000 rolls to get to that stage. If it was an unfair roll because of a biased die, you would see an obvious spike or valley on that graph. But even with as many rolls as I’ve done on the simulated die, it still has some slight variation — as you can see, there’s a peak of 21194 rolls landing on 1, and 20786 rolls landing on 3. But if I were to run the simulation with another 200,000 rolls, I would expect that it would look similar — mostly flat, with some small bias against some other random set of numbers, not necessarily 1 and 3 again.

Here are the results I had for each of the three dice I had the kids coming by roll for me. I had a red die, a grey die, and a black die. Each of them got separate graphs.

The Red die's rolls
Red die’s rolls

The Red die was rolled a total of 1314 times, and has a peak of 152 rolls landing on 6, and a trough of 115 rolls landing on 8.

The Grey die's rolls
Grey die’s rolls

The Grey die was rolled a total of 1110 times, and has a peak of 137 rolls landing on 3, and a trough of 86 rolls landing on 9.

The Black die's rolls
The Black die’s rolls

The Black die was rolled a total of 814 times, and has a peak of 87 rolls each landing on 5 and 7, and 68 rolls landing on 8.

My conclusion: I’d need to come back and get many, many more kids to do the demonstration before I could find any sort of bias in any of my dice. I guess gambling Penguin’s umbrella away from him is going to take way more time and careful planning.

If you’re interested in finding out how to determine statistical significance in a study like this, here is possibly the best, most extensive study on dice rolls and entropy. Study up, and maybe one day you too will become a powerful supervillain like me!

{advertisement}
The Riddle of Randomness
{advertisement}
The Orbit is (STILL!) a defendant in a SLAPP suit! Help defend freedom of speech, click here to find out more and donate!

5 thoughts on “The Riddle of Randomness

  1. 1

    I always have trouble thinking about how to define randomness.

    The definition I find to be most useful is: Absence of pattern.

    But that leads to a problem.

    In uni, I worked for a year an a video rental store. New releases would be pressed flush against the wall in big grids, something like 8 high and 6 wide. The case would be empty, as we kept the discs behind the counter. Behind each glossy case was another empty case, this one a photocopy of the original with an “I’m out, ask to book me” label photocopied in.

    When the glossy cases were returned, we would take the discs out, store them behind the counter, then return the glossy cases to their positions.

    This presented an aesthetic problem: What is the most pleasing method for re-stocking the shelves? Left-to-right, top-to-bottom? Top-to-bottom, left-to-right? Checker patterns?

    What I found most aesthetically pleasing was randomness. So I would go out of my way to set a random pattern when refilling the shelves. Knowing a bit about randomness, I would sometimes have big gaps and sometimes have little groups. A nicely random pattern of distribution…

    And that’s where the crossed wire in my brain kicks in. If randomness is the absence of pattern, it should make no sense to talk about generating a ‘random pattern’. But it totally does make sense.

    Randomness is confusing.

  2. 3

    I always have trouble thinking about how to define randomness.
    The definition I find to be most useful is: Absence of pattern.

    This is a common sentiment that I used to hear quite a bit from my students when introducing them to probability theory, but in any finite sample of a random variable, it’s wrong, because such samples are rich with what appear to be nonrandom patterns.

    For example, say you flip a fair coin ten times, and then another ten times. Now say that the resulting sequences of heads and tails for the two ten-flip experiments are as follows:

    #1: HTHHHTHTTT
    #2: HHHHHHHHHH

    Which of the two exhibits “more randomness?” The answer is neither, since they are both equally likely, with the probability of obtaining either of those two sequences being approximately 0.000977. This is the problem with trying to determine whether a random variable has some specific underlying probability distribution with finite trials (in this case, uniform randomness), which is basically what you are doing when you are trying to discern “absence of pattern(s).”

    You can see the same effect in the Grey die’s distribution–it almost even looks Normal (i.e. gaussian), or perhaps bimodal. We humans are experts at discerning patterns where none actually exist, which is part of the reason why probability as a field of mathematics is often so counter intuitive. We are actually really bad at not imposing a perceived pattern on things, as evidenced by how many examples of Jesus or the Virgin Mary appearing in a piece of toast there are.

    Jason struck on this idea explicitly:

    Humans really don’t understand randomness. If you ask them to put a bunch of dots on a page completely randomly, they try to space them out, to cover as much of the page as possible.

    By attempting to make the finite set of dots on the page “completely random,” most humans will actually produce something that follows a uniform distribution quite nicely, and that, itself, represents a pattern.

    In reality, even randomness is ultimately nonrandom, in the sense that if you understand the probability distribution of a random variable, then you can make a confident prediction about what value it might next take on. In fact, this is the basis of the word “stochastic,” which comes from the Greek “stokhos” meaning “aim,” as in to aim an arrow at a target. Assuming that you’re a competent archer, you don’t know exactly where on the target the arrow will land, but you do know that it will be somewhere on the target rather than, say, the dark side of the moon. That is random, but it represents an underlying pattern (the probability distribution). The difference between nonrandomness and randomness, as we like to conventionally think of them, is that the former is deterministic whereas the latter is nondeterministic, but both are governed by some underlying process and, as a result, exhibit patterns.

  3. 4

    Being no expert on theory of probability, I’d like to suggest that randomness is not the characteristic of an event, but a measure for our (dis)ability to predict its outcome. In that sense, random is not the opposite of deterministic but a way to calculate how deterministic something is.

  4. 5

    I think there are quite a lot of different technical definitions of randomness, each meaning slightly different things. It’s really hard for humans to get our heads around probability and statistics.

    Perhaps the best way of understanding randomness is in terms of information theory. Randomness can be quite explicitly measured in information theory (though there are actually quite a lot of separate measures which do not measure the same thing). And then what many people think of as random is actually known technically as “chaos”…. but is deterministic…

Comments are closed.