# Accounting for Randomness (Part I: Perils of a Small Sample)

Posted by & filed under , .

Randomness (and probability) is one of the more difficult things to understand. In this course we do not go into nearly the detail that most statistics courses go into on randomness. Instead, we are going to try to get across a few main points.

The point we want to get across here about randomness first is this — when the parts are small, the parts do not always look like the whole.

Lets think through an example of this — say you pull a handful of jellybeans out of a gigantic jar of randomly mixed jellybeans (100,000 jellybeans!). In that handful are three red jelly beans, three blue ones, one yellow one, and one green one.

Now here’s the question — what percentage of jellybeans in the big jar are green?

If you said that you can’t properly tell, you’re right.  The handful you grab is not going to magically match the percentages in the larger jar. If that was true, then every handful would give you the same number of red, yellow, blue and green jellybeans, and you know that that isn’t true.

But here’s a question. Say you grab 10 handfuls from the jar and then count them out. And there are 30 red ones, 30 yellow ones, 10 green ones and 10 blue ones.

Your one handful sample tells you are likely to have far more blue jellybeans than yellow ones. But your ten handful sample tells you the opposite. Which sample should you believe?

All things being equal, the larger sample gives you a better idea of how many jellybeans of each type are in the larger jar.

Event Sequences Are Prone to Randomness Too

Ok, one more candy metaphor before we move onto more authentic examples.

Imagine instead of reaching in and grabbing a handful of jellybeans we had a giant gumball machine that spit out gumballs one at a time. So you start plugging your money in, and buying gumballs.  You get eight gumballs in the following order: red, red, blue, yellow, red, blue, green, green.

Again, assuming that the gumballs are well mixed and the machine is very large, your sequence of gumballs functions in the same way as the handful — that is, your eight gumball sequence is not going to tell you nearly as much about the contents as an 80 gumball sequence.

All major manufacturing plants have quality control measures in place. These measures are constantly monitored to see if accuracy in production is going up, down, or being maintained at the current level.

All processes operate at some level of failure.  High availability computer servers might operate at what has been called the “5 nines”, or 99.999%. At this level of accuracy, only one out of 100,000 time units will display a specific fault — and in the server space, this usually means a given server will be down for less than 5.26 minutes a year (5.26 minutes is 0.0001% of a year).

Likewise, a manufacturing process may accept that one out of every 100 devices it manufactures maybe flawed in a certain way. At a high rate of failure like that, you might check every device for the flaw.

Consider, for example, a company that makes a smartphone. Perhaps in this case, one out of every 100 devices arrives at the end of the manufacturing line with a cracked screen. You make some changes to the assembly process to try to reduce the crack rate, and your assumption is it should reduce the crack rate to 1 out of every 200.

The day after you make the changes, the assembly line starts running. However, not 50 phones into the process, you find that one is cracked.

So question — have the changes you made actually increased cracking to 1 out of 50 phones? Should you shut down the line now and go back to the old process before you lose more money?

The answer is that it’s too soon to know. It’s like the gumball problem: you’ve watched 50 gumballs some out of the machine, and you’re trying to guess what the composition of the whole set of items is.

It’s not *no* information — it certainly looks bad for your process. But it could also be that the next 2,000 phones come out fine.

The important piece to remember right now is this — just as with the gumball machine, you have a better idea of the composition of the whole after 50 items than you do after 10, and a better idea after 5,000 items than you do after 2,000.

Retrospection

Cluster Effects

Let’s lay on one more concept (we’ll deal with other elements of randomness later).

The last concept is about dependence. When we roll dice, or spin a roulette wheel, each roll or spin is independent of the last one. In other words, if we get a 23 on a roulette wheel, we are no more or less likely to get a 23 next time.

Most things in life don’t work like that. The chance of someone catching a cold in your class on any given day may be one in five. But if one person catches a cold, the chance of a second person catching it is much greater. The chance of any one person in your dorm getting brought up on drinking charges on any given day might be low, but a single large party being busted might result in 30 people being written up in a night. In both of these cases, the existence of one event makes the existence of surrounding events more likely.

It can work the other way, too. If you are speeding on a particular road, there may be a close-to-random chance that you will be pulled over. However, if the person three cars up from you is pulled over, your chance falls, since the police officer can only pull one person over at a time.

You can apply this to your assembly line issue as well. There are three possibilities when you see a broken screen:

• It is more likely the next screen will be broken.
• It is less likely the next screen will be broken.
• It is exactly the same chance the next screen will be broken.
Which case it is depends on how the screen got cracked. If it is a completely random error — say, the result of an unpredictable tumble down a chute — each event is independent of one another, and the next phone is no more or less likely to be broken.
But what if it is a function of a worker being inattentive or falling behind? In this case, given the nature of attention, if they lose track of what they are doing, that lack of attention might effect three or four phones before they regain attention. That would make it more likely than average that the second screen was broken.
Conversely, the breaking of a screen might trigger an automatic Quality Control process. Maybe after a screen is broken, the machines are checked and re-calibrated. This might make a second breakage less likely.

Randomness Abides in Short, Retrospective Time Spans

Consider the following story from April 22, 2012:

### New Hampshire sees 15 violent deaths in 13 days

By John Toole jtoole@eagletribune.com

Thirteen days, 13 possible homicides and two suicides.

That horrific, bloody scorecard is for April in New Hampshire, which the FBI reports averaged 13 murders a year from 2005 through 2010.

“It seems like something is wrong,” said retired judge J. Albert Lynch of Pelham. “It’s too much. It’s too crazy.”

Don Vittum, the director of the state’s police academy, said he can’t remember a similar stretch in 40 years in law enforcement.

“We’re hoping this never happens again,” Vittum said.

Officials aren’t sure exactly what to make of this deadly month.

“Well, it is too early to tell if this is a temporary spike or a new trend,” Rockingham County Attorney Jim Reams said.

“It is clear that New Hampshire is not immune to the type of violence generally seen elsewhere.”

But, some caution, it’s too soon to read too much into it.

Let’s do a small mental experiment. Let’s assume that all of those average years of 13 murders, the murders were unrelated to one another and always happened on separate days.  What is the chance of there being a murder on any given day, assuming this is a completely random occurrence?

It would be 13/365, or about a 3.6% chance per day of a murder occurring. This is a little bit more probable than rolling a pair of ones on two dice.

So what is the chance of 13 murders happening in a row, one a day?

Initially, it looks astronomically small, as if it can’t be due to just chance. It would be the equivalent of the same number coming up on a roulette wheel 13 times in a row.

Except it wouldn’t. First of all, this is retrospective, falsely limiting the time we’re looking at to thirteen days. Given Don Vittum’s comment, a better question might be what is the chance in 40 years of a thirteen day pattern like this happening once?

But even then there are issues. Three of the deaths were the result of a single incident. A police shooting the day after was possibly related to nervousness after the death of a cop in the shooting the day before. The other events are clustered as well. Notice, too, how the reporter groups in possible homicides into the 13 day count, comparing them against actual murders.

Here is the list of deaths:

• A man run down and killed April 7 in Claremont.
• A murder-suicide claims two lives in Dalton on April 12.
• Five officers are gunned down while serving a warrant in Greenland April 12; the police chief is killed. Their assailant and his friend die later in a murder-suicide.
• A 9-year-old boy dies from a gunshot would in his Hollis home on April 13. The incident remains under investigation.
• One man is dead, another wounded in a shooting in Chesterfield on April 14.
• Three people are found dead in Lancaster on April 17 — one from a gunshot wound, two others found in a burning pickup truck.
• A Massachusetts man is shot to death fleeing Keene police after an attempted burglary on April 17.
• Two bodies are found in a shed in Springfield on April 19.
• A man’s body is found in a home on April 19 in Londonderry.

In truth, there are only two confirmed murders here, with the rest being suicides, homicides, or unsolved cases. We are not comparing like to like — we cite 13 murders a year as a baseline statistic, but compare it to any violent or unexplained death in the past 13 days.

That’s not to say that isn’t a depressing couple of weeks for New Hampshire. It is.  Is something larger at work? Possibly. But is “thirteen homicides in thirteen days” anywhere close to what we should expect as the “new normal”? Not even close. The chances that this sort of pattern would emerge over a couple decades is actually pretty good.

So, in conclusion:

• Beware of small samples, whether of items, subjects, events, or time.
• Watch out for cluster effects.
• Understand the difference between retrospective and forward looking odds.
• Pay attention, as always, to how group definition is being manipulated.

Tags: