In my last post, I described my new effort to collect enough Kinder Surprise eggs to win all eight Astérix figurines. I’ve done it. What’s more, I managed to do so having only gone through 35 eggs! That’s almost hilariously quickly, if you think about it.
I wish I had kept track of how I was getting the figurines–boulangerie vs. boxes–since I still suspect that the odds are greater from the boulangerie. The above 35 eggs yielded 14 total winners (with only one triple!), giving a p of .4. Given that some of that sample came from the boxes, where we know p is .333, that means that the rate was still good enough from the boulangerie to push the value up.
But enough about how often I get winning eggs. The whole point of the last post was to indicate that I can guarantee a winning egg every time I buy a three-pack at the grocery store. Now the question is, how strange is it that I got all eight characters in just fourteen tries? I wish I remembered how to do this in R, but I don’t, so I decided to just do a random run a million times in perl. I’m assuming here that all eight characters are available with equal probability. With “collect all of ‘em” campaigns in the States, I always assume uneven distribution. Maybe the French are nice.
In any case, here was the code:
#!/usr/bin/perl -w
# there are 8 characters [0-7], and I'll later add 1 to give us [1-8].
$range = 8;
# let's run this a large number of times.
$sim = 1000000;
# and let's keep track of how many times we get all 8 characters
$all_eight = 0;
# do a simulation of $sim runs.
for($j = 1; $j <= $sim; $j++){
local($c, @characters);
# pick 14 eggs.
for($i = 1; $i <= 14; $i++){
push(@characters, int(rand($range)) +1);
}
$c = join(" ", @characters);
# now see if all eight characters are present.
if(($c =~ /1/) && ($c =~ /2/) && ($c =~ /3/) && ($c =~ /4/) && ($c =~ /5/) && ($c =~ /6/) && ($c =~ /7/) && ($c =~ /8/)){
$all_eight++;
}
}
$pct = sprintf("%.2f", 100 * $all_eight / $sim);
print "Out of $sim runs, there were ". $all_eight . " instances where, out of 14
eggs,\n\tall eight characters were won, for a percentage of " . $pct . "%.\n";
So I ran the numbers, and the result was:
Out of 1000000 runs, there were 191828 instances where, out of 14 eggs, all eight characters were won, for a percentage of 19.18%.
In other words, I should only expect to get all eight characters in my first fourteen eggs about 20 percent of the time, meaning it was a little rare that I got off so cleanly!
Tags: Asterix, kinder surprise, statistics

October 14th, 2009 at 11:49
Wow. Is Paris that boring? Or are kinder eggs still made with crack?