In which Dr. Bias helps Mr. Krackle solve a chocoholic problem by introducing enough, but not too much, cyanide into the Noshey with Almonds candy bar.
If you just want to play with Dr. Bias' Computer, click here
Mr. Krackle Has a Problem
The food scientists at the Noshey Chocolate Factory in Noshey, Pa. were under fire. Kris Krackle of the Public Relations Department had just completed a poll of the chocolate-lovers of America and discovered that chocoholism was "eating into" the profits.
"Those chocolate nuts are bingeing on an average of 20 candy bars in one sitting, and then out of guilt, not touching any more chocolate for a month. If they ate just one candy bar a day, they would eat 30 candy bars a month," he moaned, wringing his hands in despair.
"What are you going to do about it?" he asked his resident staff of brilliant (but more-than-slightly mad) food scientists.
The scientists repaired to their laboratories, and after much thought and many meetings, came up with the following fiendishly simple plan:
Fiendishly Simple Plan
The food scientists knew as a scientific fact that small concentrations of cyanide curb the appetite for chocolate, so "doctoring" (ha-ha) a candy bar with cyanide would achieve the desired effect.
"Furthermore," they noted with glee, "if the chocoholic consumes too many candy bars, he will succumb, thus curing his chocoholism forever!"
"And," the geniuses of Noshey Park added, dancing with delight, "since cyanide has the odor and taste of bitter almonds, we'll be able to introduce it into Noshey's With Almonds and call it the Noshey's Bitter Almond Bar!
Mr. Krackle was delighted with the plan, and gave them the "OK" to go ahead.
The First Problem
The scientists soon realized that all was not well with their plan. The concentration of cyanide needed to curb the chocolate appetite was 5 ppm (parts per million), a concentration that would be added automatically to each batch of Bitter Almond Bars.
"But,"said Dr. Kiss, the head scientist, "we've got to install a testing plan to make sure that we are getting no more than 5 ppm into each batch. I think we need to consult with Dr. Bias, our staff statistician." So they called in Dr. Bias, who was a somewhat rumpled and tired-looking man with formulas scribbled all over the backs of his hands.
Dr. Bias to the Rescue
"Of course … you need to have a zampling plan," Dr. Bias exclaimed (he pronounced "sampling" as though it were spelled with a "z"). "Since the test for the conzentration of cyanide is not completely exact -- in fact, it is normally distributed with a standard deviation of 2 ppm -- you will need to take a certain number of zamples, let's say five, from each batch, measure the conzentration of cyanide in each one, take the average, and if the average is too high, reject the batch!"
"Well, I don't understand what 'normally distributed' and 'standard deviation' are, but how high is too high?" asked Dr. Kiss.
"Let me put it this way," said Dr. Bias. "How many good batches can you afford to throw away zimply due to random variations in the measurement of cyanide?"
"I think 1 in 100 would be acceptable," stated Dr. Kiss.
"Aha," snorted Dr. Bias, " then you want to make a test of significance at significance level .01! Your null hypothesis H0 will be that the mean conzentration is 5 ppm, your alternative hypothesis Ha is that it is greater than 5 ppm. We will design the test so that the probability of rejecting the null hypothesis when it true (that's called Type I error) will be .01; hence, you will only throw away 1 in 100 good batches, as required. Let me show you on my computer."
He sat down at the console, his fingers lovingly caressing the keyboard. Soon he had the following display for Dr. Kiss:
"Now look! You will measure the conzentration C of cyanide in five zamples, and take the average. That will be your sample mean. What I've shown you here is the distribution of a sample mean taken from any normal population whose standard deviation is 2, given that the sample size is 5. This shows us that if we accept a batch when the sample mean is < 7.15 ppm (the cut-off, or p-critical value), and reject it otherwise, we will reject perfectly good batches only about 1% of the time, as required. Isn't it zimple?"
"Well, I've seen simpler," said the befuddled Dr. Kiss, "but maybe if you write down the directions, the quality control folks will be able to follow them. Anyway, I'm curious as to how your computer arrived at that 7.15 ppm cut-off value."
Peering down at the backs of his hands and frowning, Dr. Bias said "Why don't I just write it all down for you, and you can look at the derivation at your leisure."
So Dr. Kiss and his very dazed but somewhat encouraged minions went back to the laboratory to design the cyanide-injecting pump and the chemical test for cyanide.
Another Bombshell
Then another bombshell exploded. "What if," exclaimed the pump engineer "the pump goes bananas and injects 9 ppm of cyanide into a batch, but because of pure chance in the sampling process, the test causes the batch to be accepted?"
"OH-MY-GOSH" cried out the scientists in unison, as they rolled on the floor and frothed at the mouth. "9 ppm is a critical value. At that level or above, one candy bar could be fatal. It could even make somebody awful sick!"
"Well, I think we need to go back to Dr. Bias for another consultation," said Dr. Kiss calmly.
Dr. Bias to the Rescue, Again
"Aha! Type II error has gotcha" rejoiced Dr. Bias, as he gleefully gathered up a stack of papers and scattered them about his office.
"It has?" asked Dr. Kiss, somewhat confused. "Type II error?"
"Yes, don't you zee?" said Dr. Bias, "Type II error means accepting the null hypothesis when in fact, the true value of the parameter you are measuring is something else!"
"Could you please translate that into plain English?" asked Dr. Kiss.
Dr. Bias, his patience wearing thin, explained, "In your case, Type II error means accepting a batch when in fact, the batch has a cyanide concentration of 9 ppm or more! Let me show you another display."
He sat down again at his computer, arriving at the following screen:
Dr. Bias explained: "The blue graph represents the distribution of the zample mean if the concentration is, in fact, 9 ppm. If that were the case, then, according to the acceptance criterion already established, there is a probability of .0179 (the area in black) of accepting such a batch! So 1.79% (about 1 in 50) of such "bad" batches (if any) will escape detection, and poison your candy-lovers! Isn't this amazing!"
"I think 'scary' might be a more appropriate adjective," retorted Dr. Kiss. "I could lose some sleep over killing off a few chocolate-lovers in the interests of corporate profits. Furthermore, there are a few litigious trouble-makers out there that could cause a ruckus if a loved one is murdered by a candy bar. And I might lose my job! By the way, how did the computer come up with that Type II probability, anyway?"
Again, Dr. Kiss consulted his hands, and again, deferred the discussion to a written paper.
"In any event, that 1 in 50 doesn't seem like very good odds! I better look for another job," moaned Dr. Kiss in despair.
"Or," he said, with a sly glint in his eye, "is there some clever way to reduce the probability of Type II error?"
Reducing Type II Error (Way 1)
"Good question," said Dr. Bias, professorily. "If we just increase the probability of type I error to .05 (that is, change the level of significance to a weaker .05), we move the cutoff point to the left, and thus decrease the probability of type II error! "
A few deft strokes at the computer yielded the following display:
"See, the probability of Type II error is now reduced to about .0026, or 3 in 1000!"
Proud of his work, Dr. Bias added "Isn't that just zooper?"
"It's not as zooper as you think," responded Dr. Kiss testily, "because now we will reject 5 good batches out of 100 instead of just 1, and the boys upstairs in the chocolate waste department might get just a little cranky about that! What else do you have for me, besides the help-wanted ads?"
Reducing Type II Error (Way 2)
Dr. Bias thought for a long time, studying the backs of his hands over and over. He suddenly brightened.
"There's just one last thing," he said. "Since the standard deviation of the sample mean is inversely proportional to the square root of the sample size, if we increase the sample size from 5 to, say 7, those distributions that I've been showing you get skinnier, and we simultaneously reduce the probability of Type I and Type II error. Look!"
And he proudly displayed the following:
"Now, Type I = .01 (throw out 1 out of 100 good batches), and Type II = approximately .002 (2 out of 1000 bad batches escape detection). What do you think of that?"
"Now that is absolutely brilliant," exclaimed Dr. Kiss, pumping Dr. Bias's hand enthusiastically. "I can't wait to get back to the lab and get this project finished. And when the first batch of Noshey's Bitter Almond Bars comes off the production line, I will personally see to it that you receive a complimentary case!"
"No, thank you" responded Dr. Bias, "I've given up chocolate; it's bad for your health."
Dr. Kiss departed for the lab, and Dr. Bias carefully closed and locked his office door. He then unlocked his filing cabinet and, after looking around to make sure he was unobserved, selected a Milky Way for his afternoon snack.
Dr. Bias has given us permission to use his computer in order to experiment with Type I and Type II error using a variety of experimental set-ups. His terminal has been set up to provide a laboratory in which you can play with the various experimental parameters.
For example:
Question 1: suppose the original population had a standard deviation of 2.5, we want to do a test of significance at the .02 level, and want P(Type II error) < .01. What is the smallest sample size that will do the job? Enter the appropriate experimental parameters into the following display, make a guess at sample size, and go from there!
Dr. Bias' Computer Terminal
|
|
Calculating
the cut-off (p-critical) value
by Dr. Henry Bias
Theory tells us that the distribution of the sample mean xbar taken from a normal population with standard deviation s and mean m, where the sample size is n, is a normally distributed variable with the same mean (m) but a smaller standard deviation = s/sqrt(n). In our case, our sample mean xbar will have standard deviation:
2/sqrt(5) = .894.
We proceed as follows:
Calculating
Type II error
by Dr. Henry Bias
We assume m = 9, and convert our sample statistic
xbar to a standard normal statistic z:
z = (xbar - 9)/.894
where .894 is the standard deviation of xbar, as already noted.
Solving for xbar, we get xbar = .894z + 9
We want to compute P(xbar < 7.15 ) = P(.894z + 9 < 7.15) = P(z < -2.068).
The latter is (by symmetry) P(z > 2.068), which, since z is a standard normal variable, can be found in the normal table to be .0192 = (approx) the value of .0179 found by the computer.
Go back?