Tuesday, June 02, 2009

Edible Statistics

All last year I helped myself get through evening classes of Systematic Theology through a combination of stimulants, spaced out over the course of 3 1/2 hours: caffeinated diet soda, regular coffee with cream, and M&Ms (one bag of plain and one of peanut).

When I opened each bag of M&Ms, I instinctively sorted them all into colors and observed the distribution. My a priori assumption was that it uniform across all six (red, blue, green, orange, yellow, brown). But as the year rolled on, it seemed to me that the underlying distribution of colors wasn't uniform at all. I thought there was more orange (my favorite) than anything else, and it seemed like fewer reds and browns.

My fellow students often remarked on what I was doing, asking why I sorted the colors (and why I ate them in sequential pairs of varying colors), and complaining that I ate them so methodically in class!  
Watching me indulge so intently made them go out on break and buy their own, they said - like it's my fault they yield to "the lust of the eyes", (1 John 2:16)!  So I guess I may be guilty of tempting the weaker brother to sin.  Oh well.  Tough!  This is science, where there are no moral issues....  

As to the methodology, I had to admit to them that I was a statistician by trade. Not to mention a person who instinctively looks for patterns in things, and needs an explanation as to why things are the way they are.

I think it's part of my INTJ makeup, and sometimes it annoys people who prefer to just "let things be" the way they are, and not always be asking why. ;)

But, determined as I can be on these things (some might call it obsessive), I decided that this academic year I would conduct a controlled experiment where I construct a sample set of data built from my weekly observation (and consumption) of M&Ms in class. And as I began it last Fall, a girl in my Hermeneutics class said that M&M's website used to have stats published there on what mix of colors went into their bags. Woo! Really?

Well, no. Not anymore. But I did write to them and they replied with the actual distribution (which varies by product), so.. I know the truth! :) But so that I wouldn't bias my research, I didn't look.
All year. Imagine! The self-discipline...

So, were my initial observations that first year were on the mark?
Yes! Orange dominates (as it should). Although green is close.

(that is one pairwise combination I never fail to hold in my palm for a second before I eat them. I love the way green and orange look together. So complimentary...)

My 22 week trial suggests the following relationships in the candy:

Percentage of Bag

Color    Plain   Peanut

Orange 22.9%   21.1%

Blue     21.4    17.7

Green  16.3    20.8

Yellow 13.7    19.7

Brown   13.2    11.7

Red       12.5       9.0

Orange also had the lowest Coefficient of Variation (CV) as well, meaning that it was the most stable from week to week.  Green was much less predictable.  Hm.  And by the way, on average there were 56 plain M&Ms in a bag compared with 22 peanut, a ratio of just over 2.5 to 1.

So, okay.  I was right; lots of orange and few reds and browns.  That held true for both kinds.  The middle colors were more mixed up in order.  BUT!  This was just sample data, and a measly 22-observation dataset besides.  What is the distribution of the population?  

How close was my sample set to predicting the true distribution?
Here's the same data but with the actual distribution next to it.  

Percentage of Bag

Color      Plain   True  Peanut True

Orange   22.9%  20%   21.1%   23%

Blue       21.4   24    17.7    23

Green    16.3   16     20.8    15

Yellow   13.7    14     19.7    15

Brown    13.2   13     11.7   12

Red       12.5   13        9.0   12

In every case my sample was well within one Standard Deviation of the mean (with more variation in the peanut group, since there are fewer pieces per bag and therefore fewer observations).  Overall, though, a good representation of the real thing.  And if I carry on the experiment again next academic year, no doubt the results will converge toward the population mean, with orange falling out of the lead and green shrinking a bit, too.  :(

So I probably won't do it.  :)  I'll switch to Skittles.


1 comment:

Future Urban Planner said...

Mna, only a statistician could take the fun out of eating M&Ms- lol

Have you considered gummi bears? I always find their dispersal totally arbitraty i.e. there are never enough of my favorites- the white and green ones and too many red ones- Mom's, er D1's favorite.

Perhaps you could write to Mars and ask them if perhaps it has to do with the cost of their food dye, which I doubt as everything seems to have Red05 in it nowadays, but remember when they took out the tan ones and added blue?

The universe has more questions than answers. Hmmm

Who links to my website?