Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,20 @@
|
|||
ClearAll[SleepingBeautyExperiment]
|
||||
SleepingBeautyExperiment[reps_Integer] := Module[{gotheadsonwaking, wakenings, coinresult},
|
||||
gotheadsonwaking = 0;
|
||||
wakenings = 0;
|
||||
Do[
|
||||
coinresult = RandomChoice[{"heads", "tails"}];
|
||||
wakenings++;
|
||||
If[coinresult === "heads",
|
||||
gotheadsonwaking++;
|
||||
,
|
||||
wakenings++;
|
||||
]
|
||||
,
|
||||
{reps}
|
||||
];
|
||||
Print["Wakenings over ", reps, " experiments: ", wakenings];
|
||||
gotheadsonwaking/wakenings
|
||||
]
|
||||
out = N@SleepingBeautyExperiment[10^6];
|
||||
Print["Results of experiment: Sleeping Beauty should estimate a credence of: ", out]
|
||||
Loading…
Add table
Add a link
Reference in a new issue