Join the Car Talk Community!

Discussion Rules

Welcome to the Car Talk Community!

Want to ask a question or join the discussion? Great! Join now.

Sign In Register

puzzler of 02/18/2012: use Bayes' theorem: P(A|B) = P(B|A) * P(A) / P(B)

245

Comments

  • "In less then a year dear, you'll be on your own without mommy or daddy to hold your hand. Start preparing".
    dagosa--I agree with you 100%. Unfortunately, in too many classes today (and this includes college courses), there is too much memorization required with little application. I have had students ask "What should we memorize for the test?" My answer to this: "You will see problems on the test that you didn't see in class. If you have kept up with the outside work, you should be able to do these problems". What I found disturbing, particularly in my last ten years of teaching, is that I had younger colleagues who never picked up assignments. One colleague complained to me that his linear algebra students, when asked if any had questions over the assigned work, none had a question. Yet, when it came to a test, these students did poorly. I asked him if he picked up the assignments and the answer was NO. He didn't think that one should have to pick up and grade assignments.
    In my last years of teaching, our classrooms were equipped with digital camera devices. We could place an object under the camera and it would be projected on a screen. One of the funny, but sad experiences I had was just before class started, a group of students were snickering and one told me that I wasn't teaching the way I should. I asked how I was supposed to teach. The student responded, "You are supposed to project the textbook onto the screen and read it to us. That is what our other professors do". I responded, "I'm not your other professors. I think you are all able to read for yourselves". During a free period, I walked down the hall and I had colleagues that were teaching just the way the students described. My students weren't really critical of me--they knew what a couple of other faculty were doing was a joke.
    There is a book that came out a year ago titled "Academically Adrift--Limited Learning on College Campuses". Roughly 4000 students were tested in critical thinking, problem solving and writing skills on 20 different college campuses. The conclusion was that students were making little or no gains in their first two years of college. As a nation, we are going through the mortgage crisis. I am afraid that the next big hit will be public higher education. With college loan debt exceeding credit card debt and many college graduates not employable, there is a big problem on the horizon.


  • Another quick way to see the solution: no matter which color turns up, the con man will bet you that the unseen side of the card is the same color. The only way you would win is if you had picked the red/green card, and you have only a 1 in 3 chance of having done that. So his odds are twice as good as yours.
  • edited February 2012
    Trie...."there is a big problem on the horizon". Being the wide eye, flower child of the 60s, I feel we tackle education ( as well as healthcare) head on. Everyone gets it free from cradle to grave. I don't think many will believe me if I said it's the cheapest way to go. Bottom line, a single payer in both determines the cost and quality of the product. My logic is different then others. But then, I would like to see single payer Vette ownership too.
  • @Dsorgnzd:
    Here is a similar problem: The cowboy turns his back and the gambler lays out the three cards on a table. He peaks under each card and knows the colors that are face down. The cowboy turns around and is asked to select the card with the opposite color on the reverse. The cowboy points at the card he guesses is oppositely colored, say #1. His odds in winning are 1 in 3. The gambler picks another card, say #3, and flips it over, showing that it has the same color on both sides. The gambler now gives the cowboy the option of switching his selection to card #2, or staying pat with his original selection of card #1.

    The question: What now are the cowboys odds of winning if he stays with his original selection of card #1? What are the cowboys odds of winning if he switches to card #2? Explain your reasoning.

    Bayesian statistics are a large component of financial analysis algorithms. Those who are knowledgeable in Bayesian statistics and graduate from a prestigious GSB school can almost write their six-figure ticket to a firm on Wall Street.

    Jon Corzine graduated in my class in 1975. He was a whiz in Bayesian statistics. Too much of a whiz in other things as it worked out.
  • That's the Monte Hall problem and it's been done to death.

    "Time is based on the rotation speed of the earth with 24 hours equal to one trip around the earth at the equator."
  • I'm an old geizzer. I can't possibly remember my probability classes and definitely not Bayes Theorem. I just listed out all the possible combinations for the three cards. Then it was easy to see a certain number of the combinations had a red card showing. And a certain subset of those had what the questions asked, and the other ones didn't. It's just a questions of whether the set of red card ups that had what the question asked, was that greater than the set of red card ups that didn't? Does that sound correct?
  • Sounds good to me. That's how probability starts out, making a list of all possible combinations.
  • GeorgeSanJose"I can't possibly remember my probability classes and definitely not Bayes Theorem. I just listed out all the possible combinations for the three cards. ... Does that sound correct?"
    I don't know ... you lost me somewhere in the middle of your post.

    The cowboy has two strategies: When asked to make a choice after the gambler flips a red/red or a green/green card, he can either stand pat with his first decision, or switch and point to another card.

    If he stands pat, his odds of winning are 1/3, the same as it was before the gambler flipped the card.

    If he always switches his selection, his odds of initially picking a red/red or a green/green card on the first selection are 2/3. But now he wins because the gambler must flip the remaining red/red or green/green card and the cowboy wins after switching has selection to the remaining card, which must be the card with differing face colors.

    So the cowboys strategies and odds of winning are —
    • Stand pat and win one out of three; or
    • Always switch picks and win two out of three.
    This could be solved by a modification of Bayes' theorem using three variables, but I don't think it's worth the effort.

  • OMG.
    yes! take the bet.

    To Click and Clack:

    I disagree with your published answer
    > TOM: So you're saying the chances of winning are two to one in favor of
    > red?

    about dependent probabilities:
    Multiplication Rule 2:
    When two events, A and B, are dependent, the probability of both
    occurring is:
    P(A and B) = P(A) * P(B | A)

    A = picking a card with red on either side
    B = probability of a card with red on one side is also red on the other
    P(A) = 2/3
    P(B) = 1/2
    P(A and B) = 2/3 * 1/2 = 1/3

    (at the bottom I'll directly respond to Mechaniker's reponse).

    I imagine you'll get a lot of other people also writing to
    tell you.
    The odds are that the con man is wrong. it's only 1/3 likely that
    the other side of the card is red.
    run a simulation. you'll see.

    > RAY: Believe it or not. You can believe it because what
    > you're dealing with is not cards--
    > you're dealing with the sides. When you see the red side
    > up,
    > you could be seeing one or the other face of the red card.
    > That's what most people don't grasp

    It's true that you don't know if a card showing red has red on the other side.
    That's the point of the question.
    Your conclusion is wrong.
    You seem to conclude that because there are more red sides, it's more likely
    to see red on the other side.

    To help you visualize, consider a situation with 1000 cards.
    Let's say 500 are green on both sides; 499 have both red and green;
    and 1 has red on both sides.

    As in your puzzler, there are more red sides than green sides.
    given that it's not a green/green card
    green sides = 499
    red sides = 499 + 2

    Here, P(A) = 1/2
    P(B) = 1/500
    P(A and B) = 1/2 * 1/500 = 1/1000

    Alternatively, consider only 1 card out of 1000 that have red on both sides
    What do you think your chances are of picking that card?
    Doesn't it seem to you that it would be unlikely. say 1/1000.
    Given that it's not a green/green card, there are more red sides possible,
    but do you really think you'd have been more likely to pick that 1 card in 1000
    instead of one of those cards with red and green ?

    This is similar to the "Monty Hall" situation. shown 3 doors, all closed.
    the contestant picks one.
    Monty opens a door, showing a booby prize, and asks if you should switch.
    The answer is yes. Your chances are 2/3 that the door you didn't pick is the
    winner.

    To visualize, again consider 1000 doors.
    only one good door.
    you pick a door.
    Monty opens 998 doors with bad prizes.
    Should you switch ?
    yes.
    The chances are 1/1000 that you picked the good door.
    The chances of the other door you didn't pick is 999/1000 of having
    the good prize behind it.

    The fact that doors were opened doesn't increase your original odds.
    But, you now have more information, and you know that 998 doors were wrong.
    Chances were 999/1000 that you didn't pick the right door, and now that
    you know 998 of the other doors were wrong, the one remaining door is
    likely to hide the good prize with a probability of 999/1000
    Switch your choice.

    For the puzzler, take the bet.
    You'll be right 2/3 of the time.

    ---------

    Mechaniker says:
    > use Bayes' theorem: P(A|B) = P(B|A) * P(A) / P(B)
    > Let A be the event: red on both sides before seeing face; P(A) = 1/3
    > Let B be the event: a red face shows up; P(B) = 1/2
    > Let B|A be the event:
    > red face shows up given that red is on both sides; P(B|A) = 1
    >
    > Then A|B is the event: red on both sides given that red face up;
    > P(A|B) = 1*(1/3)/(1/2) = 2/3
    >

    With all due respect, I think this is a mis-application of Bayes' theorem.

    You don't get to pick the side.
    You pick a card.
    you say P(B|A) = 1
    but that assumes you've picked the red/red card.
    You define A to be the event of picking the red/red card.
    Of course, if you pick the card with red/red, the probability of the other
    side being red is 1.
    But you don't know that A has occurred.
    All you know is that red is visible.

    It should be:
    The initial event, A, is picking a card. some have red, some don't.
    It should be that:
    A = picking a card with red on some side.
    P(A) = 2/3

    now that you've picked a card with red showing, what's the probability that
    the other side is red? there are two possibilities, 1/2 are red.
    B = probability that other side is red
    P(B) = 1/2

    using Multiplication Rule 2:
    When two events, A and B, are dependent, the probability of both
    occurring is:
    P(A and B) = P(A) * P(B | A)

    The application of Bayes' theorem should be:
    P(B | A) = 1/2
    P(A) = 1/3
    P(B) = 1/2

    P(A|B) = 1/2 * (1/3) / (1/2) = 1/3

    so the chances of having picked the red/red card are 1/3
    you'd be right 2/3 of the times to take the bet with the con man.

    -----------

    This also is an answer to Mechaniker February 22

    > The question: What now are the cowboys odds of winning if he stays with his
    > original selection of card #1? What are the cowboys odds of winning if he
    > switches to card #2? Explain your reasoning.

    the cowboy should switch his choice.
    just like the Monty Hall situation.

    I agree with your post on Mechaniker February 23
  • edited February 2012
    littlemouse. I suggest you run a simulation and see for yourself.
    we can argue for many days about the theory, but perhaps a little empirical evidence will help you.
    Here. I'll make it easy. Here's a C program to guide you.
    card 0 = green/green
    card 1 = red/green
    card 2 = red/red

    #include "stdio.h"
    #include "stdlib.h"

    #define VM_RANDOM_INT(a,b) \
    ((int)((a)+((b)-(a)+1)*((double)rand()/((double)RAND_MAX+1))))

    int
    main(int argc, char **argv)
    {
    int ii, nLoop = atoi(argv[1]);
    int nRed = 0, nRedRed = 0;
    // nRed means there is red on at least one side of the card

    for (ii = 0; ii < nLoop; ii++) {
    int card = VM_RANDOM_INT(0, 2);
    int side = VM_RANDOM_INT(0, 1);
    if (card) {
    nRed++;
    if (side) {
    nRedRed++;
    }
    }
    }

    printf("%d = nRed = %g %%\n", nRed, (double)nRed / nLoop);
    printf("%d = nRedRed = %g %%\n", nRedRed, (double)nRedRed / nLoop);
    }
This discussion has been closed.