Sleeping Beauty problem: Difference between revisions

Content added Content deleted
m (→‎Excel LAMBDA: Updated (reformatted) output.)
mNo edit summary
Line 6: Line 6:
subject, named Sleeping Beauty, agrees to an experiment as follows:
subject, named Sleeping Beauty, agrees to an experiment as follows:
Sleeping Beauty volunteers to be put into a deep sleep on a Sunday. There is then a fair coin toss.
Sleeping Beauty volunteers to be put into a deep sleep on a Sunday. There is then a fair coin toss.
If this coin toss comes up heads, Sleeping Beauty wakes once (on Monday) and asked to
If this coin toss comes up heads, Sleeping Beauty wakes once (on Monday) and is asked to
estimate the probability that the coin toss was heads. Her estimate is recorded and she is
estimate the probability that the coin toss was heads. Her estimate is recorded and she is
then put back to sleep for 2 days until Wednesday, at which time the experiment's results are tallied.
then put back to sleep for 2 days until Wednesday, at which time the experiment's results are tallied.
Line 27: Line 27:


Given the above problem, create a Monte Carlo estimate of the actual results. The program should find the
Given the above problem, create a Monte Carlo estimate of the actual results. The program should find the
proportion of heads on waking and asking Sleeping Beauty for an estimate, as a percentage of the times Sleeping Beauty
proportion of heads on waking and asking Sleeping Beauty for an estimate, as a credence or as a percentage of the times Sleeping Beauty
is asked the question.
is asked the question.


Line 167: Line 167:
end
end


# If tails, we do this again, but add only if tails, so do not add.
# If tails, we do this again, but of course we will not add as if it was heads.
if coin_result == "tails"
if coin_result == "tails"
wakenings += 1
wakenings += 1
Line 232: Line 232:
gotheadsonwaking += 1
gotheadsonwaking += 1


# If tails, we do this again, but add only if tails, so do not add.
# If tails, we do this again, but of course we will not add as if it was heads..
if coin_result == "tails":
if coin_result == "tails":
wakenings += 1
wakenings += 1