Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,27 @@
F sleeping_beauty_experiment(repetitions)
Run the Sleeping Beauty Problem experiment `repetitions` times, checking to see
how often we had heads on waking Sleeping Beauty.
V gotheadsonwaking = 0
V wakenings = 0
L 0 .< repetitions
V coin_result = random:choice([heads, tails])
// On Monday, we check if we got heads.
wakenings++
I coin_result == heads
gotheadsonwaking++
// If tails, we do this again, but of course we will not add as if it was heads..
I coin_result == tails
wakenings++
I coin_result == heads
gotheadsonwaking++ // never done
print(Wakenings over repetitions experiments: wakenings)
R Float(gotheadsonwaking) / wakenings
V CREDENCE = sleeping_beauty_experiment(1'000'000)
print(Results of experiment: Sleeping Beauty should estimate a credence of: CREDENCE)