
The Cookie Problem: A Mathematical Satire
By Blarney in Fiction Sun Apr 29, 2012 at 01:35:08 PM EST Tags: ogg frog, caltech, starfleet academy, academia, bullshit, satire, schizoaffective disorder (all tags)



There exists an urban legend of how psychiatrists used to differentiate schizoprenia from bipolar by asking the patient how they preferred their carrots  raw or cooked?  and it worked pretty well, actually. However, it sorted 'normal' people into the same categories of insanity, with exactly the same proportions. Any chef will tell you, based on this, that psychiatry is bullshit.
One wonders if someday, psychiatrists will diagnose people based on chocolate chips.






Young Johnny sat in his freshman Probability & Statistics course, fidgeting in his chair in anticipation.
He'd worked very hard to get into the Academy, always gotten A's and the occasional  very occasional  A, always been the smartest kid
in his class. Even his hobbies and volunteer work were carefully chosen in order to appeal to the admissions board at the Academy. Nothing
else had mattered to him, he'd never dated, never had a paying job, never played sports or music, never goofed around sneaking beer, cigarettes, and pot.
Never went to a concert, never got laid, never just blew off school to go ride his bicycle out on county back roads.
He'd just studied, day and night. And
he had made it in, of course he had made it in. It had been his life's dream and now he was here, finally here. He hadn't
really gotten over it, his first few weeks here spent in an excited delirium. For the first time in his life, he wasn't
dreaming of being somewhere else  he was where he wanted to be  for the first time in his life, he felt that he belonged.
And now he was sitting in a room with his true peers, and illuminating the room like a great radiant Jupiter was the eminent
Professor R. F.! The venerable sage made an announcement 
"Pop quiz today!"  he declared. "I'm waiting to see which of you have truly great minds, which of you are truly
worthy of the Academy! Be creative! I will be looking to see which of you has the critical insight to solve them.
I can tell you that out of 254 students last term, none of them saw the breakthrough. But maybe this year one of you
will!"
Lovely Bonnie, shapely in her light floralpatterned sundress with a single bra strap peeking out over her pale freckled shoulder, sitting in front of Johnny as usual, passed him a copy of the quiz.
Her hand briefly brushed his, causing a thrill to shiver up and down Johnny's body, but with difficulty he
controlled his excitement. Only the problem mattered. Only his opportunity to prove his mathematical skill.
WITHOUT USING A CALCULATOR
How many chocolate chips must one mix into the dough used to bake one hundred thousand chocolate chip cookies so that ninetyeight percent of the cookies contain at least two chips?
You may use the Handbook of Mathematical Functions as reference material
Of course, Johnny thought, this was somewhat ambiguous. Of course there was no upper limit on chocolate chips here that would guarantee that 98% of the cookies
had at least 2 chips. There would always be a probability  asymptotically approaching zero, but always positive 
of all the chips ending up in one single cookie. "Would that really be a cookie, or just a melted blob of chocolate?"
thought Johnny. Bonnie's long red hair shone in the glow of the sun from the dusty window behind them. Summoning up
his concentration, Johnny returned to the problem.
As 100,000 was a fairly large number, it would be reasonable to interpret this as a probability p=0.98 that any individual
cookie would possess at least two chips. They had recently covered the Binomial Distribution, and Johnny knew it well
enough that he did not even need to reach for his Handbook but simply wrote down the initial equations.
Pr(0 chips) = (^{N}_{0})x10^{5}*^{0}x(110^{5})^{N}=(110^{5})^{N}
Pr(1 chip) = (^{N}_{1})x10^{5}*^{1}x(110^{5})^{N1}=Nx10^{5}(110^{5})^{N1}
Pr (< 2 chips) = Pr(0 chips)+Pr(1 chip) = (110^{5})^{N} + Nx10^{5}(110^{5})^{N1}
Now it was obvious to Johnny that he wanted to find the smallest value of N which would render Pr(< 2 chips) less than or equal to 0.02, that is, 2%. Meaning
that there would be a 98% probability of the converse, Pr(>=2 chips). Could he simplify this expression? Why yes, he could!
Both terms carried a factor of (110^{5})^{N1} after all.
Pr (<2) = (110^{5})^{N1} [ (110^{5}) + Nx10^{5} ]
= (110^{5})^{N1} [ 1 + (N1)x10^{5}]
Pretty enough, thought Johnny, but how did this help him find N? Perhaps there was some way to break this down
using logarithms? However, he was not hopeful here. All of a sudden he had a glorious insight. As well as the
Binomial Distribution, his class had also been studying the related topic of the Binomial Approximation.
The Binomial Approximation
states, of course, that
(1+x)^{n} ≈ (1+nx). A simple enough formula  for an x that was 'small', close to zero that is, and 10^{5} was certainly a small number.
Carefully noting the signs of the expression within the brackets, Johnny saw an absolutely beautiful symmetry to the problem.
Once again the thrilling feeling he had experienced from the gentle touch of Bonnie's hand came back, only with greater intensity.
And Johnny wrote.
(110^{5})^{N1} ≈ [1  (N1)x10^{5}]
Pr (<2) = [1  (N1)x10^{5}] x [1 + (N1)x10^{5}]
= 1  (N1)^{2}x10^{10} = 0.02
Therefore, (N1)^{2} = 0.98 x 10^{10} = 98 x 10^{8}
A quick check of the Handbook revealed that √98 = 9.8995. Multiplying by √10^{8}=10^{4}, shifting the decimal 4 places,
gave him (N1)=98995. Adding one, he wrote down the final answer.
N=98996
He raised his hand. "What is it?" barked Professor R. F., but Johnny had no fear. "I'm done, Professor," he proudly exlaimed. There was a great windy sound
as the entire class sighed in exasperation, as they were all still busy puzzling over this difficult problem. The great Professor came over to Johnny's desk  the closest that he had
ever been to Johnny  and seized his paper and glared at it with great interest. HIS paper, thought Johnny. And the thrilling feeling came over him a third time as the Professor held the
paper in the air and announced "Johnny here has one of the true great minds here at the Academy. He saw the true insight behind the problem, unlike the rest of you. Congratulations, Johnny!" It was all Johnny
could do, at that moment, not to faint.
While most of his classmates were stunned with jealousy, one of them approached him after class to congratulate him. It was Bonnie, of course, and that night something happened between the two of them which we should be kind enough
not to inquire too deeply into. Neither was very expert, in fact neither had done such a thing before, but both of them had a very enjoyable evening. It was the best day  and night  of Johnny's life, and for the first time he truly experienced
what he had always dreamed of  a life full of joy, made possible by his studies at the Academy he had always wanted to attend.
Time passed
Johnny never, as it turned out, finished his degree at the Academy. He had meant to, had wanted nothing else from his life, but it was not to be. After a certain incident he ended up spending
a substantial period of time in a hospital  and when he returned, 'better' but not unmarked by the experience, neither his classmates nor his professors were able to recognize him as the same person anymore. He had made them uncomfortable  reminded them of their
own mortality, of the fragility of life itself. Even Bonnie couldn't manage to look him in the eye anymore, nor could she regard him with anything but pity. Eventually it was made clear to him that he
was no longer welcome on the Academy campus and so Johnny left.
He built a life for himself eventually, as we all do, at least those of us who continue to draw breath and cheat Death day after day. A life of sorts. But he never forgot the glorious day when he solved the Cookie problem, and knew the love of a woman for the first time. However, as his life went on
he eventually realized that he could not remember, no matter how hard he had tried, how he had solved the Cookie problem. It tormented him day and night, and he gave his friends no peace about it. No answer they could give could ever satisfy him.
Ironically enough, his answer was wrong. It had pleased Professor R. F., but in fact the Professor was wrong as well. The Professor had composed the problem with the specific purpose of
referencing the material on the Binomial Theorem and its consequences. It had been the exact answer that Professor R. F. had wanted. But it was wrong. In fact, many of Johnny's classmates
had come up with the correct answer (or at least a reasonable approximation of such), after spending the entire period sweating over the difficult calculations, only to be marked incorrect.
Johnny's answer was simple, elegant, and wrong.
Although we may not all have the mind of the great Professor R. F., we can all see that there's really no way to
distribute 98,996 chocolate chips among 100,000 cookies such that most of them  let alone 98%  have at least 2 chips.
You'd expect an answer somewhere closer to the 200,000 chips that a naive, unschooled cookie baker might include in his
mathematically unsophisticated recipe.
The mistake was in the Binomial Approximation. (1+x)^{n} ≈ (1+nx) for a small x.
But it's not enough for x to be small relative to 1. nx also has to be small  and in this case, it was not. This small error made a huge difference
in the result of the Cookie problem. Calculating the probabilities without the binomial approximation reveals that, for
98,996 chocolate chips, P(<2) is not 0.02 (2%)  it is very nearly 0.74, or 74%. In other words, only 26% of the
cookies are likely to have 2 or more chocolate chips. About 37% of the cookies will have only 1 chip, and a final 37% will have
no chips at all.
And still Johnny dreams of this day, endlessly seeking to remember his longforgotten answer. Time and tragedy have
ravaged his memories, this is true, but also his own unconscious mind has repressed the answer of 98,996 chips. For,
outside the group setting of the classroom, Johnny would immediately see that this number is not a reasonable answer.
Sadly, Johnny is not ready to face the fact that, although his departure from the Academy was entirely unfair and has
caused him pain all the many years of his life since  that
the Academy, like all academia, despite fostering very real genius and providing a home for all manner of wisdom and insight,
is still an institution. And like all institutions, great and small, necessary and insignificant, it is firmly founded in bullshit.
A thick sedimentary layer of bullshit, a mile deep, on which it bravely floats like a small skiff in the great Pacific Ocean.
Now if any of you were ever young, let's have a sentimental song to remind us all of our youth!


