# Applying Bayes' theorem to Sleeping Beauty

Suppose we believe the "thirder" position of the Sleeping Beauty Problem. That is, we believe that `P(Heads | Waking up) = 1/3`.

Applying Bayes' theorem, we get

`P(Heads | Waking up) = P(Waking up | Heads) * P(Heads) / P(Waking up)`

By the definition of the problem, `P(Waking up | Heads) = 1`, and similarly `P(Waking up) = 1` since it is just the marginal over heads and tails.

This leaves us with `P(Heads | Waking up) = P(Heads) = 1/3`. So does that mean the thirder position implies that the prior probability of getting heads is 1/3? I.e. that even before the coin is tossed, we should assign a probability of 1/3 to heads?

-

The difficulty here seems to be that in order to do probability, you need to know what space you're sampling from, and by construction, Sleeping Beauty requires you to pay attention to that space. There are two "intuitive" spaces, and if you mix both, you end up confused. Niel de Beaudrap has already said as much, but given the amount of confusion expressed over this "problem", I'd like to try being more explicit:

What "really" happens is this:

``````p=1/2    heads    awaken
p=1/2    tails    awaken    awaken
``````

The funny thing about this is that you get two outcomes from one of the branches. This not infrequently happens in probability and statistics, and it's no problem at all, but you have to decide what to do about it.

The Sleeping Beauty problem is typically formulated as Miss Beauty essentially conducting an experiment each time she is woken up. (Maybe you'll give her a cookie if she's right.) So half the time you get one experiment, half the time you get two, and by construction in the problem you're supposed to lump all of these together. (If you had an army of Sleeping Beauties and you were tallying all the answers, this is what you'd want to do.)

So now we have three `awaken`s in our sample space:

``````heads-awaken   tails-awaken-1   tails-awaken-2
``````

which are all identical. So if we do your calculation:

``````P(H|awaken) = P(awaken|H)*P(H)/P(awaken) = 1*(1/3)/1 = 1/3
``````

Wait, what was that?

``````P(H) = 1/3
``````

That's pretty weird--but look, we didn't have to go through the calcuation to find that. We have a sample space that by construction has heads only one time out of three (cleverly constructed from a process that has 50% heads!). So this is exactly right: the prior probability of heads is 1/3.

And Miss Beauty and everyone else would agree on this in advance of the experiment ever being run (at least if they were up on their statistics).

Alternatively, if the formulation is such that there actually is an implicit difference between the different awakenings (e.g. because the last one is part of Miss Beauty's permanent experience, or because if she's right once and wrong once on the tails branch you'd want to only give her half a cookie, and you don't want to break cookies, so you only ask her one of the two times on the tails branch), then she (and everyone else) should perhaps do a different calculation:

``````p=1/2    heads    awaken
p=1/2    tails
p=1/4        awaken
p=1/4                   awaken
``````

The logic here is that if you're on the tails branch and you wake up, 50% of the time you'll be on the first instance, and 50% of the time you'll be on the second. In this case, you can calculate things like

``````p(H|awaken#1) = p(awaken#1|H)*p(H)/p(awaken#1) = 1*(1/2)/(3/4) = 2/3
``````

meaning that if you know you're in the midst of the experiment and it's the first time you woke up, there's a 2/3 chance you're on the heads branch. (`p(H|awaken#2) = 0`, and `p(H) = 1/2` by the construction of this sample space.)

This is actually a more flexible framework to use--it is just as true as the other one; it's just a different formulation suited for calculating different things. The key is recognizing how the sample space maps onto what may have actually happened; if your sample space doesn't match the question you're asking, you'll get the wrong answer.

For example, if Miss Beauty wants to maximize the number of cookies she's awarded, and she gets one per correct guess, she will reason:

``````// I can pick only one option: H or T
// I will gain no information later so I may as well pick now

If I pick H:
p=1/2  right!         1 cookie
p=1/2  wrong, wrong!  no cookie
E(cookies) = (1/2 * 1  +  1/2 * 0) = (1/2 + 0) = 1/2
If I pick T:
p=1/2  wrong!         no cookie
p=1/2  right, right!  2 cookies
E(cookies) = (1/2 * 0 + 1/2 * 2) = (0 + 1) = 1
``````

Double the payoff if I pick `T`, even though I think `P(T) = 0.5`.

The real problem comes when one mixes the two sample spaces. First, one thinks that of course the three events are indistiguishable by construction, so that `p(H|awaken)` = 1/3. And of course a coin is fair, so `p(H)` = 1/2. And then `p(awaken|H)` = 1 and `p(awaken)=` and `1/3 != 1/2` and...what the heck?

Know the sample space, stick to it, and probability will make sense, even if you are Sleeping Beauty.

[Note: see also my chat transcript with Xoxarap.]

-
1. Whether or not the coin has been tossed, the probability is just a model of how you expect events to turn out, or to have turned out, based on the information you have. Without having information about the result of the coin, it does not matter whether or not it has been flipped yet. The probabilistic model which assigns probabilities based on different amounts of information remains the same, and so is agnostic of time, in the same way that Newton's equations predict the same behaviour for an apple that is dropped from a height of 1m in similar conditions both for yesterday and tomorrow.

2. Probabilities are best assigned relative to one's experience of the world. In the Sleeping Beauty problem, the princess' experience of the world is biased by the sleeping drug. Although an undrugged observer may experience the coin as being fair, Sleeping Beauty's experience of the frequencies of the coin are different.

At issue is the fact that Sleeping Beauty experiences the events of `heads` and `tails` with different frequencies relative to a control observer. Without additional information, Sleeping Beauty could rationally assign different probabilities to the outcomes of the coin, because we are deliberately skewing her experiences. Furthermore, while Sleeping Beauty knows we are skewing her experiences, this does not affect the experiences she will have as a result of the skewing. She could rationally infer that we perceive the coin to be fair, and also that she would perceive the coin to be unfair. Thus, even before engaging in the experiment she could assign a prior probability of 1/3 to `heads`, at least for her own purposes.

Sleeping Beauty simply experiences a different probabilistic ensemble to ourselves, and so obtains a different frequency, in a manner not totally different to how different observers moving at different speeds will perceive sounds to be at different pitches due to the Doppler Effect. And similarly to shifting pitches of sounds, we can obtain a unifying probabilistic model, which does not assign a definite probability to the event `heads`, but which describes what probability each agent could rationally ascribe to the event depending on what ensemble their conscious experiences will be subject to.

-
"Sleeping Beauty could rationally assign different probabilities to the outcomes of the coin, because we are deliberately skewing her experiences" - but the usage of Bayes' theorem shows that her experiences don't actually skew her probability (i.e. her posterior equals her prior). – Xodarap Feb 21 '13 at 18:14
It is not her experience that skews the results, as I have noted in point #1. It is how her experiences will be structured. If Sleeping Beauty knows the nature of the experiment, she knows that she will be experiencing the skewed ensemble, and therefore should attribute a different prior than we would for what she will experience. – Niel de Beaudrap Feb 21 '13 at 18:20
Let us agree that, before knowing about the experiment, she assigns `p = 1/2`. Now she goes through the experiment, and at the end of it believes `p = 1/3`. At what point did her beliefs change? Was it when they told her she was going to undergo the experiment? – Xodarap Feb 22 '13 at 15:17
@Rex: Fine, `P(Heads | Something) = 1 / (1+n)`. What is that something? It can't be "being informed about the experiment" because that falls to the same argument in my original question. – Xodarap Feb 22 '13 at 17:44
@Xodarap - Let's turn this around. Can you define what a probability is? The entire sleeping beauty "problem" seems like a case of talking and thinking about something that one doesn't actually properly define or understand. Once you say, "By p = ___, I mean _____", the whole problem (to me at least) grows vastly less mysterious. All the confusion ends up being, "Oh! I was thinking X but talking about Y, no wonder it doesn't add up!" – Rex Kerr Feb 22 '13 at 17:59

I take it that the thirder doesn't believe that `P(Heads|Sleeping Beauty waking up at all)=1/3` (although this is suggested/implied by your further argument), but rather that `the/an awake Sleeping Beauty's P(Heads|being awake at the/a moment of evaluation) should be 1/3`. That would imply that the premise of your (further) argument is false ("That is, [...]"). Therefore, everything that follows may be valid, but isn't sound.

-
Hmmm, but isn't a premise of the problem that she can't differentiate between "waking up at all" and "waking up at instant X"? – Xodarap Feb 21 '13 at 22:10
Please note that my answer doesn't address the Sleeping Beauty problem, but only your question/argument, which, in my opinion, doesn't properly represent the thirder's position from its outset. And, regarding your comment, she can differentiate (admittedly in a somewhat abstract way) between "waking up at all" and "waking up at instant X": she knows that she's certain about the former, and she knows that she's uncertain about the latter. Therefore, those are two distinct conditionals (according to the thirder). – user3164 Feb 22 '13 at 7:49
Example. You know that somebody will win tomorrow's lottery, but you're not sure whether it will be you. In your logic that implies that you can't "differentiate" between those events and therefore you might as well assume that (A) you will win the lottery (and therefore start buying champagne today). This logic fails because your logic also can't "differentiate" between "somebody winning the lottery" and "somebody else will win the lottery", implying that you might as well assume that (not-A) you will not win the lottery. – user3164 Feb 22 '13 at 8:04
That's epistemic logic for you: knowing something X to be true is distinct from something X is true. – user3164 Feb 22 '13 at 8:18
Gugg: Yes, I think a premise of the problem is that she can't differentiate between "I woke up once" and "I woke up twice" - in your analogy, she can't differentiate between "someone won the lottery" and "I won the lottery". – Xodarap Feb 22 '13 at 15:13