Pancake Problem

A forum for good logic/math puzzles.

Moderators: jestingrabbit, Moderators General, Prelates

Stev
Posts: 28
Joined: Tue Jul 22, 2008 11:32 pm UTC

Re: Pancake Problem

Postby Stev » Mon Sep 08, 2008 3:06 pm UTC

Stev: Your error came from assuming that which side you see is independent from which side got burned. This is clearly false: the side you see is always the side that gets burned.


I assumed that you take a pancake from the oven and the you randomly put it into the plate.

If that's not the case, then the things are simpler, and that means you always see a black face.

B/B remains B/B
B/W goes B/B with 50% chanche
W/W always goes B/W

Here the first side is the side that you see, so:

you may have (if B/W was baked with white side up):
B/B, B/B, B/W
in which case the probability is 2/3 (remember, you always see a black face)

or (if B/W was baked whith black side up)
B/B, B/W, B/W
and the probability is 1/3

so (1/3 + 2/3) / 2 = 1/2

Buttons
Posts: 858
Joined: Wed May 02, 2007 3:27 pm UTC
Location: Somerville

Re: Pancake Problem

Postby Buttons » Mon Sep 08, 2008 3:11 pm UTC

Ah, I see. Yeah, I'm assuming that you don't flip over the pancake or anything when you pull it from the oven, so the side that was face-up then is face-up on the plate as well.

Notch
Posts: 318
Joined: Tue Dec 12, 2006 5:52 pm UTC
Location: Stockholm, Sweden
Contact:

Re: Pancake Problem

Postby Notch » Wed Sep 10, 2008 2:41 pm UTC

Afaik, the snag here is that you ignore the instances where you would've seen a white upside.

It's very similiar to

A couple has two children. They show you a male child, what are the odds that the other child is female?


Where the response varies depending on if you intended the question to be:

You gather up all couples with two children, and KILL everyone with two female children. You have them show one of their male children. What percentage of those children has a female sibling?

Spoiler:
67%, because there are four possible configurations: FF, FM, MF and MM, and you removed all couples with FF


or

You gather up all couples with two children. You have them show one of their children. What percentage of those children has a sibling of the opposite gender?

Spoiler:
50%, because there are four possible configurations: FF, FM, MF and MM, and two of those has mixed genders.

quaskx
Posts: 1
Joined: Sun Sep 14, 2008 1:26 pm UTC

Re: Pancake Problem

Postby quaskx » Sun Sep 14, 2008 1:36 pm UTC

am i the only one who thinks the answer is 1/3? here is my reasoning: the probability that the other side is black is the probability that you picked a black/black pancake in the first place, which is 1/3. i can see why some would say 2/3 or 1/2 but intuitively, it seems to me that 1/3 is right, since you only pick a random pancake once, which already has 2 given sides.

AvalonXQ
Posts: 747
Joined: Mon Feb 18, 2008 5:45 pm UTC

Re: Pancake Problem

Postby AvalonXQ » Sun Sep 14, 2008 7:37 pm UTC

quaskx wrote:am i the only one who thinks the answer is 1/3? here is my reasoning: the probability that the other side is black is the probability that you picked a black/black pancake in the first place, which is 1/3.


You have two marbles, one black and one white. You pick one marble, which is black. What is the probability that you picked the black marble?
Unless you say "1/2", you should realize that your reasoning above is equally flawed.

When you take the pancake out of the oven, the following possibilities exist:

1/3: Pick the black/black pancake with a black side face-up.
1/6: Pick the black/white pancake with the black side face-up.
1/6: Pick the black/white pancake with the white side face-up.
1/3: Pick the white/white pancake with a white side face-up.

Once you pick the pancake and see that the black side is face-up, you're limited to only two possibilities.
1/3: Pick the black/black pancake with a black side face-up.
1/6: Pick the black/white pancake with the black side face-up.
So, the chance that you picked a pancake with the bottom side black is twice as likely than picking the pancake with the bottom side white. Thus, the answer to the question is 2/3.

Talamor
Posts: 7
Joined: Wed May 14, 2008 3:56 am UTC

Re: Pancake Problem

Postby Talamor » Sun Sep 14, 2008 10:43 pm UTC

What helped me with this one was making a list of all the possibilities.

Spoiler:
B/B (Black-Black, first side up)
B/B (Black-Black, second side up)
B/W (Black-White, Black side up)
W/B
W/W
W/W

So, if the first letter is B, there is a 2/3rds chance the second letter is also B.

User avatar
dragon
"Can I have a Mountain Dew?!"
Posts: 319
Joined: Sat Jun 30, 2007 12:18 am UTC
Location: the darkness

Re: Pancake Problem

Postby dragon » Thu Sep 18, 2008 5:01 pm UTC

Epiphanies are fun, even tiny ones. I understand the danged goat problem now. Thank you, H2SO4
Context? What context?
Sandry wrote:I'm kind of feeling like it'd be a good idea to somehow position a vibrator for hands-free use, then you can legitimately DDR with your feet while knitting and it all works.

Jedaz
Posts: 40
Joined: Wed Sep 10, 2008 2:11 pm UTC

Re: Pancake Problem

Postby Jedaz » Mon Sep 22, 2008 2:03 am UTC

I disagree with the 2/3 solutions, here's why.

Lets show the probability tree for this problem

(B=Black, W=White, M=Mixed, P?= choosing the pancake)

Code: Select all

           P?
          / | \
         /  |  \ 
        B   M   W
       /   / \   \
      B   B   W   W
      |   |   |   |
      B   W   B   W

You can read this tree as selecting a pancake, selecting a random side, and then checking the other side. There is an equal probability off each branch. Now, we want to know Pr(other side black | first side black), this instantly eliminates the white pancake, however it still means that the Black and Mixed pancake have an equal chance of being initially selected. This means the probability is 50%.

The way this differs from the Monty hall problem is that the Monty hall does not modify any of the probability branches based off the information.

Once I'll get time I'll explain the reasoning in more depth.

User avatar
Cytoplasm
Posts: 1310
Joined: Tue Oct 23, 2007 1:00 am UTC
Location: EE.UU.(+ Cheese)

Re:

Postby Cytoplasm » Mon Sep 22, 2008 2:27 am UTC

moopanda wrote:You have three pancakes. The sides of them are colored as followed because you can't cook.

Goat/Goat
Goat/Car
Car/Car

mmmm.... Goat pancakes...



Oh no! Poor Felltir!

:P

It would be Black/White. People grab for the middle..usually...I would.

Oh sorry probability:

P black: (3/6) = 1/2. Whoooh.

Did I answer somewhat right..?
¡No tengo miedo a fantasmas!

Spoiler:
Cytoplasm: I have catoragized some of my family into lolcats.
Felstaff: For a drudging Thursday afternoon, that level of cuteness has really made my day. Can... Can I keep you?

Felstaff wrote:
Cytoplasm wrote:shannonigans

<3

fyjham
Posts: 240
Joined: Wed Nov 21, 2007 1:16 am UTC

Re: Pancake Problem

Postby fyjham » Mon Sep 22, 2008 4:27 am UTC

Jedaz wrote:I disagree with the 2/3 solutions, here's why.

Lets show the probability tree for this problem

(B=Black, W=White, M=Mixed, P?= choosing the pancake)

Code: Select all

           P?
          / | \
         /  |  \ 
        B   M   W
       /   / \   \
      B   B   W   W
      |   |   |   |
      B   W   B   W

You can read this tree as selecting a pancake, selecting a random side, and then checking the other side. There is an equal probability off each branch. Now, we want to know Pr(other side black | first side black), this instantly eliminates the white pancake, however it still means that the Black and Mixed pancake have an equal chance of being initially selected. This means the probability is 50%.

The way this differs from the Monty hall problem is that the Monty hall does not modify any of the probability branches based off the information.

Once I'll get time I'll explain the reasoning in more depth.

Fixed your tree for you.

Code: Select all


              P
          /   |   \
         /    |    \ 
        B     M     W
       / \   / \   / \
      B   B B  W  W   W
      |   | |   | |   |
      B   B W   B W   W

If you're going to tally up the nodes at the bottom as your proof make sure the probability at each split is identical (you have 1 branch for a 100% on the B/B and the W/W, with 1 branch for a 50% on the mixed one ;)

Jedaz
Posts: 40
Joined: Wed Sep 10, 2008 2:11 pm UTC

Re: Pancake Problem

Postby Jedaz » Mon Sep 22, 2008 11:43 pm UTC

fyjham wrote:*snip*
Fixed your tree for you.

Code: Select all


              P
          /   |   \
         /    |    \ 
        B     M     W
       / \   / \   / \
      B   B B  W  W   W
      |   | |   | |   |
      B   B W   B W   W

If you're going to tally up the nodes at the bottom as your proof make sure the probability at each split is identical (you have 1 branch for a 100% on the B/B and the W/W, with 1 branch for a 50% on the mixed one ;)

No, I had it correct, I intended to show that when you select either the white/black pancake you'ld get the same colour. My explanation why was terrible, let me try to explain in better.

When you have Pr(x|y) it means y is a certain event, even if I had y happening as 1 against 1000 it would still happen. We know in this problem that showing the black side is a certain event. What this means is that on the event Pr(first side black) is equal to 1 (certain). What you want to do then is find out from here is Pr(2nd side black).

If we select the black pancake if the first side is black then the 2nd side is black at a 100% chance.
If we select the mixed pancake if the first side is black then the 2nd side is black at a 0% chance.
If we select the white pancake we realize this event cannot have occured as a black side must have been chosen.

Now we have a 50% chance of chosing the black pancake, and a 50% chance of chosing the mixed pancake given that we know the 1st side is black.

Pr(2nd side black|1st side black) = Pr(black pancake AND 2nd side black | 1st side black) + Pr(mixed pancake AND 2nd side black | 1st side black)
Pr(2nd side black|1st side black) = Pr(black pancake | 1st side black)*Pr(2nd side black | black pancake AND 1st side black) + Pr(mixed pancake | 1st side black)*Pr(2nd side black | mixed pancake AND 1st side black)

We fill in the probabilities for the above
Pr(black pancake | 1st side black) = 0.5
Pr(mixed pancake | 1st side black) = 0.5
Pr(2nd side black | black pancake AND 1st side black) = 1
Pr(2nd side black | mixed pancake AND 1st side black) = 0

Pr(2nd side black|1st side black) = 0.5*1 + 0.5*0
Pr(2nd side black|1st side black) = 0.5

Thats a 50% chance.

I may not have explained this thouroughly enough, but I hope it shows you how I came to the answer of 50% chance, which I belive is mathematically correct. If someone can find an error with the proof that I've provided then I'll be happy to hear it.

User avatar
quintopia
Posts: 2906
Joined: Fri Nov 17, 2006 2:53 am UTC
Location: atlanta, ga

Re: Pancake Problem

Postby quintopia » Tue Sep 23, 2008 12:12 am UTC

Yes. Here is the problem:
Jedaz wrote:Now we have a 50% chance of chosing the black pancake, and a 50% chance of chosing the mixed pancake given that we know the 1st side is black.


By specifying that the 1st side is black, we have indeed narrowed ourselves down to two pancakes, but we have by no means a uniform distribution of the two pancakes. In fact, of the two pancakes, we are twice as likely to have picked the all black pancake.

To help you see this, you must realize that each of the two pancakes has two configurations. Thus, the two pancakes together have four configurations. The four pairs (M/B) are:

W/B (up/up)
B/B (down/up)
W/B (up/down)
B/B (down/down)

As you can see, B appears twice as often (4 times) on the B/B pancake as on the W/B pancake (2 times). Given that each of these configurations is equally likely, it is twice as likely that an arbitrary black pancake will be the all-black pancake.

So let us rerun your calculations:
Pr(black pancake | 1st side black) = 2/3
Pr(mixed pancake | 1st side black) = 1/3
Pr(2nd side black | black pancake AND 1st side black) = 1
Pr(2nd side black | mixed pancake AND 1st side black) = 0

Pr(2nd side black|1st side black) = 2/3*1 + 1/3*0
Pr(2nd side black|1st side black) = 2/3

That's a 2/3 chance.

User avatar
phlip
Restorer of Worlds
Posts: 7573
Joined: Sat Sep 23, 2006 3:56 am UTC
Location: Australia
Contact:

Re: Pancake Problem

Postby phlip » Tue Sep 23, 2008 12:30 am UTC

Probability paradoxes can often be made clearer by taking the numbers involved and either reducing or increasing them to extremes (depending on whether they started as big or small numbers).

So, for instance, say we had 3 100-sided dice. One has the numbers from 1 to 100 on the sides, one is all 1s, one is all 100s. We draw a die at random, and roll it, and happen to get a 1. What is the chance that we chose the die with all 1s?

Intuition says that it should be greater than 50%... if we drew the all-1s die, we'd definitely get a 1, but if we drew the 1-to-100 die, it'd be unlikely to show a 1. So seeing a 1 should indicate that it's likely to be the all-1s die. And, indeed, in this case intuition is correct.

The pancakes puzzle is the same, but with d2s rather than d100s.

To be more rigorous, we can use Bayes's formula: P(A|B) = P(B|A) * P(A)/P(B)

We have 4 events: CBB, we chose the black/black pancake; CBW, we chose the black/white pancake; CWW, we chose the white/white pancake; and B, the pancake we chose is black on top.
Now, P(CBB) = P(CBW) = P(CWW) = 1/3, P(B) = 1/2.
P(B | CBB) = 1, P(B | CBW) = 1/2, P(B | CWW) = 0.
Hopefully all those values should be clear.

Now:
P(CBB | B) = P(B | CBB) * P(CBB)/P(B) = 1 * (1/3) / (1/2) = 2/3
P(CBW | B) = P(B | CBW) * P(CBW)/P(B) = (1/2) * (1/3) / (1/2) = 1/3
P(CWW | B) = P(B | CWW) * P(CWW)/P(B) = 0 * (1/3) / (1/2) = 0

That is: because we would be more likely to see a black face on top after drawing the black/black pancake, compared to the black/white pancake, seeing a black side means the black/black pancake is more likely than the black/white pancake.

Code: Select all

enum ಠ_ಠ {°□°╰=1, °Д°╰, ಠ益ಠ╰};
void ┻━┻︵​╰(ಠ_ಠ ⚠) {exit((int)⚠);}
[he/him/his]

fyjham
Posts: 240
Joined: Wed Nov 21, 2007 1:16 am UTC

Re: Pancake Problem

Postby fyjham » Tue Sep 23, 2008 1:25 am UTC

Jedas, ok, now I see what you're making the mistake.

You're saying "Ok, there's 2 possible pancakes I might be holding, if it's one it'll be white, the other it'll be black" right?

But what you should be saying is "OK, there's 3 possible SIDES of pancakes I might be holding, two will be black on the other side, the other white".
To go back to our tree:

Code: Select all

                            P
                      /     |    \
                     /      |     \
Pancake chosen   1/3B    1/3M    1/3W
                    |      / \      |
                    |     /   \     |
Side chosen      1/3B 1/6B  1/6W 1/3W
                    |    |     |    |
Other side       1/3B 1/6W  1/6B 1/3W

The key point being, if you choose a random side of one of the 3 pancakes and it's black, there's a 66.6% chance that it was the burnt one and only 33.3% chance it was the half/half pancake ;)

Jedaz
Posts: 40
Joined: Wed Sep 10, 2008 2:11 pm UTC

Re: Pancake Problem

Postby Jedaz » Tue Sep 23, 2008 3:07 am UTC

Ah, thanks guys. It's been too long since I did any probability :oops: The dice problem really helped illustrate how I was going wrong.

yelly
Posts: 172
Joined: Sun Aug 26, 2007 11:25 am UTC
Location: Jerusalem, The Original One.

Re: Pancake Problem

Postby yelly » Tue Sep 23, 2008 8:09 pm UTC

Well, for those who still don't believe the logic and the math, you should believe the result of experiment.
I wrote the following script in applescript:

Code: Select all

set bCount to 0
set wCount to 0
repeat 10000 times
   set side to random number 5
   if side is 0 or side is 1 then set bCount to bCount + 1
   if side is 2 then set wCount to wCount + 1
end repeat
set result to bCount / wCount

Feel free to run it yourself if you have a mac or translate it into something your computer can run.
As you can see, the script runs a loop 10000 times (the number of iterations doesn't matter, just bigger numbers will improve your result), each time electing a random number between 0 and 5, each number representing a side of a pancake you can see, in the following order:
0. Black side on B/B.
1. Black side on B/B.
2. Black side on B/W.
3. White side on B/W.
4. White side on W/W.
5. White side on W/W.
It then checks if you can see a black side and the other side is black (i.e., if you can see side 0 or side 1), and then check if you can see a black side and the other side is white (i.e., if you can see side 2). It then adds 1 to the black count if the other side is black or 1 to the white count if the other side is white. This obviously also neglects all the cases in which a white side is up.
In the end, it divides the black count by the white count.
All will agree that if the odds are 1/2, then the result will be close to 1 (because the white count would be nearly equal to the black count), and if the odds are 2/3, then the result will be close to 2 (because for every white count, there are 2 black counts). My results were consistently around 2.
I hate to do this, math is far more elegant for these problems, but actual real world probability proof should convince anyone.
...
"So there are 3 guards, one always tells the truth, one always lies and the third answers randomly"
"But I only want to know the fucking time!"

Buttons
Posts: 858
Joined: Wed May 02, 2007 3:27 pm UTC
Location: Somerville

Re: Pancake Problem

Postby Buttons » Tue Sep 23, 2008 8:49 pm UTC

Meh. It's obvious from your code that bcount should be about twice as big as wcount. If someone doesn't believe that cases 0, 1 and 2 should happen with equal probability (which is the fundamental point that most people miss), then they'll just think your code is wrong.


Return to “Logic Puzzles”

Who is online

Users browsing this forum: No registered users and 10 guests