Talk:Bayes' theorem/Archive 3

Cookies example revisited
The continued expansion of the cookies example isn't improving it. The medical test example, presently in Bayesian inference, is no more complicated, and much more compelling. The medical test, incidentally, is a standard example of the application of Bayes' theorem. I'm going to cut the cookies and copy the medical test unless someone can talk me out of it. Wile E. Heresiarch 15:59, 29 November 2005 (UTC)


 * I totally disagree. The cookies example, although rather simple, provides a tangible example of the relationship between conditional probabilities and Bayes' thoerem.  Actually, one of its virtues is the fact that it is such a simple example.  If you don't find it interesting, you don't have to read it.  If you are so advanced in your understanding of Bayes' theorem that this example is trivial for you, then you don't have to read it.  Not all readers of Wikipedia are as smart as you are.  What is the harm in leaving it in the article?  -- Metacomet 16:36, 29 November 2005 (UTC)


 * The medical test example is essentially the same as the cookies: bowl 1 = people with disease, bowl 2 = people without, plain = negative test, chocolate chip = positive; Fred has a plain cookie, which bowl is it from = Fred tests negative, does he have the disease. If the cookies example is simple, then so is the medical test, and the latter has the advantage that people (even ordinary readers) truly care about such problems. Wile E. Heresiarch 23:21, 29 November 2005 (UTC)


 * Furthermore, although the medical example is interesting, it is confusing and too advanced for a first example meant to introduce basic concepts. Again, the audience that we are writing for is not Ph.D. mathematicians;  the audience is a general audience that includes people who do not have the same background that you do.  The goal is to explain the concepts, not to show how smart you are by throwing around a lot of techno mumbo-jumbo that no one understands except the elite few. -- Metacomet 16:42, 29 November 2005 (UTC)


 * That's a nice strawman you have there. If you bothered to check the discussions above, you would see that I've argued against including measure-theoretic stuff (which, I believe, counts as "technical mumbo-jumbo"). More recently, I revised the introduction to remove the technical stuff and make it entirely verbal. Wile E. Heresiarch 23:21, 29 November 2005 (UTC)


 * Good. I am glad you agree.  BTW, I think the revisions that you made recently to the introduction are excellent.  I realize that most people above the age of 12 don't care much about bowls of cookies.  Nevertheless, I think it illustrates the concepts very well and in a very straightforward way.  Finally, I think the term I used was "techno mumbo-jumbo," not "technical mumbo-jumbo".  ;-) -- Metacomet 04:32, 30 November 2005 (UTC)


 * One more thing: if any of the examples in this article should be removed, it is Example #2 on Bayesian inference and not the cookies example.  I have a pretty strong background in math, and I don't have the first clue what this example is all about.  What benefit does it provide other than to confuse the reader? -- Metacomet 16:49, 29 November 2005 (UTC)


 * Agreed. In fact I've argued the same point (item 3 in my edit of July 11, 2004, at the top of the page). Wile E. Heresiarch 23:21, 29 November 2005 (UTC)

I agree with Metacomet. The cookie example is clear and relates to a simple tangible situation. Everyone can easily imagine drawing cookies from a bowl. This makes it an excellent medium to explain Bayes' Theorem. The example is complete, and clearly and accurately illustrates the Theorem. It is explained in plain and simple terms, so that anyone can understand it. Furthermore, it does not require any background knowledge from the reader in any other domain, and does not needlessly take on another topic like medicine or polling, something that only serves to confuse readers. I see no reasons to cut it; quite the opposite, it is the perfect example for the page and should definitly be kept. -- Ritchy 20:01, 29 November 2005 (UTC)

Cutting the cookies
Why did the cookie example get cut? There was only one person who didn't like it, and the discussion here clearly highlighted why it was necessary to keep it. You can't possibly think that this medical example is simpler!


 * I didn't say that it is simpler; I said the medical test example is no more complex than the cookies example. Wile E. Heresiarch 00:11, 3 December 2005 (UTC)

The cookie example explained Bayes' Theorem much more clearly, and using a situation everyone is familiar with. Unless someone comes up with a good reason why it should be cut today, I'll restore it tomorrow. -- Ritchy 15:23, 2 December 2005 (UTC)


 * I'd like to know in what sense the cookies example is clearer. Try to steer away from repeated assertions of the conclusion this time. Wile E. Heresiarch 00:11, 3 December 2005 (UTC)


 * I agree 100 percent with Ritchy. The cookies example is far better than the medical example as a simple way to illustrate the basic concepts.  I think it should be restored.  I invite others to voice their opinions on this issue.  -- Metacomet 21:32, 2 December 2005 (UTC)

The main point of the Medical Example
Read the medical example again. Do you know what the main point of this example is? It is not meant as an example to illustrate the fundamental concepts of Bayes' Theorem. The main purpose of the medical example as written is to illustrate an important and common fallacy in probability theory. As it turns out, Bayes' theorem is particulary useful as a way of uncovering this fallacy and demonstrating the correct inference. So if you accept my premise that we should use Example #1 as a means of illustrating the fundamental concepts, then you would conclude that the medical example is not the appropriate vehicle for that purpose. On the other hand, if you want to use the medical example, then it needs to be completely re-written so that it illustrates the basic concepts, and not as a device for discussing an incorrect logical inference that people commonly make.

I am not interested in re-writing the medical example, because the cookies example is perfectly fine as written, and it serves the desired purpose more than adequately.

Also, I am tired of this discussion. I have more important things to worry about. So I am done. Mr. Wily, please do whatever you want. -- Metacomet 06:36, 3 December 2005 (UTC)


 * You know, it is truly remarkable. I just compared the medical example that you added to this article with the original medical example as it appears in the Bayesian inference article.  You ripped the guts right out of the example!  So we are left with the Readers Digest abridged version, or if you perfer, the Medical Example Lite.  No wonder it's so difficult to understand this example.  There is no there there.  -- Metacomet 06:55, 3 December 2005 (UTC)


 * There is some discussion in the medical test example as it appears in Bayesian inference which is related to issues that aren't relevant in Bayes' theorem, so I omitted that discussion. I carried over just what's needed to illustrate the machinery of Bayes' theorem. Wile E. Heresiarch 18:44, 3 December 2005 (UTC)

Cookies are contrived
The question "from which bowl is the cookie" is entirely contrived, and that is the major difficulty with the cookie example. While cookies are familiar, the question posed is not, and that obscures the point of the example. On the other hand, the question "Does Fred or doesn't he have such and such a disease" is posed in real life in the same way as in the example; it doesn't take some kind of cognitive readjustment to comprehend it. You & Ritchy may wish to consider why the medical test is a standard example of Bayes' theorem, while cookies are not. Wile E. Heresiarch 00:11, 3 December 2005 (UTC)


 * Of course the cookies example is contrived. It is meant as a bit of a tongue-in-cheek, overly-simplified, and slightly whimsical example.  The idea is to make it simple enough to demonstrate the basic concepts of the theorem and the related definitions, but not deadly dull and boring.  Lighten up!  -- Metacomet 06:16, 3 December 2005 (UTC)


 * The medical test example is serious, but far from boring. Wile E. Heresiarch 18:40, 3 December 2005 (UTC)


 * Like I said, lighten up. -- Metacomet 20:44, 3 December 2005 (UTC)

Arguments
The arguments for the cookie example are all in the previous text, but as requested by Heresiarch, I will once again list them all for some reason.
 * 1) The example is complete, in the sense that it illustrates all the necessary steps to apply Bayes' Theorem.
 * 2) The example is written in clear, non-technical English.
 * 3) The example is limited to Bayes' Theorem, and doesn't try to address other issues such as medical testing or polling.
 * 4) The example is simple, in that it doesn't require the user to have background knowledge of another field to be understood. Everyone knows what a cookie in a bowl is. Not everyone knows what a false-positive medical diagnostic is, or what binomial distributions are.
 * 5) Wikipedia should be accessible to everyone, regardless of instruction level and academic background. Thus, simple examples using common household items such as cookies are very useful to explain advanced mathematical concepts such as Bayes' Theorem.
 * 6) There has been so far no compelling reasons given to delete the cookie example. Making the page more complicated for the sake of making it more complicated doesn't count. The fact you don't like part of the phrase "from which bowl is the cookie" is a reason to fix that phrase, not to delete the entire example. The fact it's not a standard textbook example doesn't count, because Wikipedia is anything but a standard math textbook.

And after all that, Metacomet beat me to the fun of restoring the example. Dammit. -- Ritchy 18:48, 4 December 2005 (UTC)


 * (1) and (2) apply as well to the medical test. (3) and (4) are true, but that's because the cookies example has zero motivation, while the medical test is strongly motivated. (5) is false; there are plenty of articles which are not accessible to everyone. That said, the medical test is just as comprehensible as the cookies. About (6), I've already spelled it out. In summary, the medical test example is no more complicated, and much more compelling. Incidentally, the fact that the medical test is a standard example of Bayes' theorem shows that many people (not just me) consider it a useful illustration. Wile E. Heresiarch 03:34, 5 December 2005 (UTC)


 * (1) may apply to the medical test, but (2) does not. Even if it applied to both examples, it wouldn't on its own constitute a reason to delete one of them, much less a reason to delete the cookie example and keep the medical example. I'm glad you agree that (3) and (4) are true, because they're also very important. In regard to the cookie thing having "zero motivation", well I'll grant you that in real life, people don't care what bowl they took a cookie from, but that's besides the point. I think it's safe to assume that the motivation of someone reading the Wikipedia entry on Bayes' Theorem is to learn about Bayes' Theorem, and the cookie example fulfills this perfectly. And since you brought up the topic of motivation, what makes you think people reading about Bayes' theorem are also motivated to learn about medical diagnostics and polling? (5) is true. Wikipedia is meant to be accessible to everyone. It's one of the guidelines. Allow me to quote: "Articles in Wikipedia should be accessible to the widest possible audience. For most articles, this means accessible to a general audience. Every attempt should be made to ensure that material is presented in the most widely accessible manner possible. If an article is written in a highly technical manner, but the material permits a more accessible explanation, then editors are strongly encouraged to rewrite it." The bolding and italics is from the Wikipedia guideline by the way, not from me. As for (6), I'll reiterate that I haven't seen a single good reason to remove the example. I'm sorry if you feel you've made the point clearly, but you haven't. Since we've gone through the trouble of giving you a clear numbered list of reasons to keep it, perhaps you'd care to return the favour? --Ritchy 03:55, 5 December 2005 (UTC)


 * And another thing. You (Heresiarch) keep going on and on about how the medical example is a standard textbook example of Bayes' Theorem. Do you actually mean you read it in a math textbook and copied it here? Because you're not allowed to do that. Books are protected by copyright laws (as someone of your unparalleled intelligence probably knows). You don’t have the right to just copy a page from it and post it on a free website for the world to see, unless you have a written legal authorisation to do so. If you just copied the example from a math textbook, we’ll have to delete it, no matter how great you think it is. --Ritchy 16:18, 5 December 2005 (UTC)

More Arguments
Ritchy -- I apologize for stealing your thunder. On the other hand, as they say, great minds think alike. -- Metacomet 18:54, 4 December 2005 (UTC)

Wily -- I agree 100 percent with the arguments made by Ritchy above. I would also reiterate some of the arguments that I have already mentioned in prior discussions: -- Metacomet 18:55, 4 December 2005 (UTC)
 * 1) The cookies example is somewhat fun and whimsical. A little bit of humor every now and then is useful and entertaining.
 * 2) The medical example is not a good example for illustrating the basic concepts related to Bayes' theorem because the main point of the medical example is to discuss a common logical fallacy in probability theory.


 * The reason the cookies example is unhelpful is that each bowl has the same probability of being chosen. This means that somebody who thinks Bayes theroem in general might be $$\Pr(A|B) = \frac{\Pr(B | A) }{ \Pr(B | A) + \Pr(B | A^C) } $$ will get $$ \frac{0.75}{1.25} = 0.6$$, the right answer for the wrong reason.  They then may think they understand, which they will not. So it is a poor example of the use of prior probabilities in Bayes's theorem. --Henrygb 02:55, 5 December 2005 (UTC)
 * Good point. --MarkSweep (call me collect) 04:04, 5 December 2005 (UTC)


 * I think the only people who might possibly be confused by this red herring you've cooked up are those who have not read this article. I think the article spells out the theorem, and the link to conditional probability provides a very clear definition and explanation of the related concepts.  Furthermore, the cookies example takes the reader by the hand and walks through the calculation.


 * Your argument is equivalent to saying that we should not mention to people that two times two is four, because they might be confused by the fact that two to the second power is also four. -- Metacomet 04:53, 5 December 2005 (UTC)


 * Actually it is the same as saying that 16/64 is a bad example for illustrating simplifying factions because some people might cancel the 6s to get 1 6 / 6 4 = 1/4. But uninformed some people do this. Another bad example would be calculating the derivative of ex at x = e as some people would get x ex&minus;1 = ee. --Henrygb 10:25, 5 December 2005 (UTC)


 * I'm with Metacomet here. Sure, there are other ways of mixing the numbers of the cookie example and getting the right answer. If we just provided the problem statement and the correct answer it would lead to confusion. But we don't. We give every step of the reasoning, and lay out the correct equation as $$\Pr(A|B) = \frac{\Pr(B | A) \Pr(A)}{\Pr(B)} = \frac{0.75 \times 0.5}{0.625} = 0.6.$$. I just don't see how anyone who reads the example could mess up the equation to the extent you described in your post. --Ritchy 16:26, 5 December 2005 (UTC)


 * Agreed w/ Henrygb on this point. The medical test has interesting and relevant prior information; the cookies example doesn't. Wile E. Heresiarch 06:41, 5 December 2005 (UTC)


 * I'm sure I could mix and match the numbers of the medical example in a way to get the right answer in a completely wrong way, like MarkSweep did for the cookie example. The medical example isn't superior on that point. [snide remarks deleted] --Ritchy 16:26, 5 December 2005 (UTC)


 * The equal prior probabilities of the two bowls makes the cookies example susceptible to the error mentioned by Henrygb. The prior probabilities in the medical test example aren't equal. Wile E. Heresiarch 02:35, 6 December 2005 (UTC)

For what it's worth, I've taught Bayesian inference to incoming Freshmen in the University of Texas' Plan II honors program five times. I find the students much more receptive to real examples (like the medical example) than to the artificial ones (like the cookie example, but I use chocolates). The "hook" is that people do get medical exams, and many of my students have personal experience, if not in their own life, then in the lives of close relatives. So my experience leads me to prefer the medical example to the cookie example.

I do not agree that "the main point of the medical example is to discuss a common logical fallacy in probability theory." That's not how I use it. Bill Jefferys 18:16, 5 December 2005 (UTC)


 * For the record, I was talking about the medical example as it is written here in Wikipedia (refer to the article), and not the medical example as a general class of examples. As I have said, in order to use the medical example as a simple illustration of the basic concepts of conditional probability and Bayes' Theorem, I believe that it would need to be re-written with that purpose in mind.  I still maintain, that in its current form, it is useful in illustrating the fallacy related to false positives, because that is what the writer has chosen to emphasize.  Unfortunately, it does not, in my opinion, emphasize the basic calculations and definitions related to Bayes' Theorem.  -- Metacomet 02:03, 6 December 2005 (UTC)


 * For the record, I don't object to keeping both the cookie example and the medical example. While I personally prefer the cookie one, I recognise that the medical one also has merit, and both can be useful in helping people understand Bayes' Theorem. In fact, I'd consider it preferable to keep both examples; in my experience, there's no such thing as giving too many examples to illustrate a mathematical theorem. Most of the current debate stems from Heresiarch's fanatical devotion to deleting one of the examples. Given the choice (or rather, being forced to choose), I'll go with the cookie example. But my first preference would be to keep both. --Ritchy 18:37, 5 December 2005 (UTC)

I have no objection to including both. Bill Jefferys


 * To set the record straight, if you look back at the history, you will see that I did not delete your signature on your posting. You forgot to include your identity when you originally made the posting.  But I am glad that you have now identified it as yours. -- Metacomet 19:56, 7 December 2005 (UTC)

Actually, what happened was that I had a two paragraph entry, and you split it when you added the new section. Purely unintentionally I am sure. I don't blame you, but it left my first paragraph orphaned without the signature that I had put at the end of the second paragraph. Go check the history, you'll see that this is what happened. No problem, I just went back and put my sig on the first paragraph when I realized what had happened, so people would know that I wrote it. It's a lesson to all of us to be careful when we edit. Bill Jefferys 22:52, 7 December 2005 (UTC)

Hi, I find one part of the cookies example unclear. I think the example would be more valuable if it were explained that "Fred" does not first choose a bowl, then a cookie from the bowl, but rather chooses one of eighty cookies at random. I'd actually propose changing the example to include the process of first choosing a bowl, then a cookie from that bowl. This ambiguity doesn't currently affect the problem because each bowl has the same number of cookies, but I think the example would be stronger if it were eliminated. --Cortland Setlow 76.8.64.166 (talk) 16:12, 9 January 2008 (UTC)

Using actual data in the medical example
As a matter of pedagogy, I would prefer that the numbers in the medical example correctly correspond to an actual disease. For example, for colorectal cancer, the prior is that 0.3% of individuals have undiagnosed colorectal cancer. The hemoccult test will come up positive 50% of the time for patients that have the cancer and 3% of the time for patients that do not have the cancer. (Data from Gerd Gigerenzer, Calculated Risks.) Other examples could be found easily. Bill Jefferys 19:09, 5 December 2005 (UTC)


 * I think this is an excellent idea, worthy of further consideration. Putting your data into the same notation as the current example:


 * $$P(D) \ = \ 0.003 $$
 * $$P(D^C) \ = \ 0.997 $$
 * $$P(T|D) \ = \ 0.500 $$
 * $$P(T|D^C) \ = \ 0.03 $$


 * where event D is having the disease and event T is testing positive for the disease.


 * So, using Bayes' Theorem, we have


 * $$P(D|T) \ = \ \frac{P(T|D)\,P(D)}{P(T|D)\,P(D) + P(T|D^C)\,P(D^C)} $$


 * $$ = \ 0.04776 $$


 * or about 4.8 percent (if I did the math correctly). So the rate of false positives is approximately 95.2 percent.


 * On the other hand, what is also really scary is that the rate of false negatives is 50 percent!


 * -- Metacomet 02:20, 6 December 2005 (UTC)

Yes, but the probability that one has the condition, given that you test negative, is 0.2%. The test is still useful in that it will detect about half the cancers in the general population. And (my medical spies tell me) the next year when you go in to take the test, the data will be nearly independent of what you had the year before. So about half the cancers that were missed the first time around will be detected the next year. Ditto for the next year. The fortunate thing is that these cancers are generally slow-growing, so regular testing will turn up a significant fraction of them. I have been told that at my age (I am on medicare) I need have the "gold standard" colonoscopy only once in ten years, and take the hemoccult test once a year. This gives a very significant margin of safety with little risk (the risk of colonoscopy is of the order of a percent or so...perforated bowel, bleeding, other complications). As with all invasive medical tests, one has to balance various different risks as well as costs. All of this makes deciding whether to take a test a matter of decision theory, not just of statistics. Bill Jefferys 03:12, 6 December 2005 (UTC)

Example #1: Conditional probabilities
To illustrate, suppose there are two bowls full of cookies. Bowl #1 has 10 chocolate chip cookies and 30 plain cookies, while bowl #2 has 20 of each. Our friend Fred picks a bowl at random, and then picks a cookie at random. We may assume there is no reason to believe Fred treats one bowl differently from another, likewise for the cookies. The cookie turns out to be a plain one. How probable is it that Fred picked it out of bowl #1?

Intuitively, it seems clear that the answer should be more than a half, since there are more plain cookies in bowl #1. The precise answer is given by Bayes' theorem. But first, we can clarify the situation by rephrasing the question to "what’s the probability that Fred picked bowl #1, given that he has a plain cookie?” Thus, to relate to our previous explanation, the event A is that Fred picked bowl #1, and the event B is that Fred picked a plain cookie.  To compute Pr(A|B), we first need to know:
 * Pr(A), or the probability that Fred picked bowl #1 regardless of any other information. Since Fred is treating both bowls equally, it is 0.5.
 * Pr(B), or the probability of getting a plain cookie regardless of any information on the bowls. In other words, this is the probability of getting a plain cookie from each of the bowls.  It is computed as the sum of the probability of getting a plain cookie from a bowl multiplied by the probability of selecting this bowl.  We know from the problem statement that the probability of getting a plain cookie from bowl #1 is 0.75, and the probability of getting one from bowl #2 is 0.5, and since Fred is treating both bowls equally the probability of selecting any one of them is 0.5.  Thus, the probability of getting a plain cookie overall is 0.75&times;0.5 + 0.5&times;0.5 = 0.625.
 * Pr(B|A), or the probability of getting a plain cookie given that Fred has selected bowl #1. From the problem statement, we know this is 0.75, since 30 out of 40 cookies in bowl #1 are plain.

Given all this information, we can compute the probability of Fred having selected bowl #1 given that he got a plain cookie, as such:


 * $$\Pr(A|B) = \frac{\Pr(B | A) \Pr(A)}{\Pr(B)} = \frac{0.75 \times 0.5}{0.625} = 0.6.$$

As we expected, it is more than half.

Tables of occurences and relative frequencies
It is often helpful when calculating conditional probabilities to create a simple table containing the number of occurences of each outcome, or the relative frequencies of each outcome, for each of the independent variables. The tables below illustrate the use of this method for the cookies:

The table on the right is derived from the table on the left by dividing each entry by the total number of cookies under consideration, or 80 cookies.

Another poor teaching example
What happens to the tables if Bowl #2 has 30 Chocolate Chip cookies and 30 plain cookies, so there are 100 cookies in total?

So this suggests the answer of 0.3/0.6=0.5, which is wrong for this question (though might work if the cookies were chosen at random without the plates being chosen first). So greater evidence of a bad example. --Henrygb 20:00, 5 December 2005 (UTC)


 * As Ritchy already pointed out, anyone can generate numbers for the cookies example so that it becomes ambiguous and not appropriate as a teaching example. That's easy.  The challenge is to come up with numbers so that it is a good example for teaching and illustrating.  Remember, the whole idea here is to try to help people understand this stuff.  Oh yeah, I almost forgot.  Any idiot could do the same thing for the medical example as for the cookies example.  It has nothing to do with whether you use cookies or medical testing.  It has to do with whether you want to make it work or you want to make it fail.  -- Metacomet 04:33, 11 December 2005 (UTC)


 * What I don't get is why you are spending so much time and energy trying to devise inappropriate examples for illustrating this theorem instead of investing your time and energy into something positive and useful, like trying to improve the medical example for instance, or trying to improve the cookies example instead of attacking it. -- Metacomet 04:35, 11 December 2005 (UTC)