Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,15 @@
|
|||
sub sleeping-beauty ($trials) {
|
||||
my $gotheadsonwaking = 0;
|
||||
my $wakenings = 0;
|
||||
^$trials .map: {
|
||||
given <Heads Tails>.roll {
|
||||
++$wakenings;
|
||||
when 'Heads' { ++$gotheadsonwaking }
|
||||
when 'Tails' { ++$wakenings }
|
||||
}
|
||||
}
|
||||
say "Wakenings over $trials experiments: ", $wakenings;
|
||||
$gotheadsonwaking / $wakenings
|
||||
}
|
||||
|
||||
say "Results of experiment: Sleeping Beauty should estimate a credence of: ", sleeping-beauty(1_000_000);
|
||||
Loading…
Add table
Add a link
Reference in a new issue