Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
10
Task/Sleeping-Beauty-problem/Red/sleeping-beauty-problem.red
Normal file
10
Task/Sleeping-Beauty-problem/Red/sleeping-beauty-problem.red
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
Red ["Sleeping Beauty problem"]
|
||||
|
||||
experiments: 1'000'000
|
||||
heads: awakenings: 0
|
||||
loop experiments [
|
||||
awakenings: awakenings + 1
|
||||
either 1 = random 2 [heads: heads + 1] [awakenings: awakenings + 1]
|
||||
]
|
||||
print ["Awakenings over" experiments "experiments:" awakenings]
|
||||
print ["Probability of heads on waking:" heads / awakenings]
|
||||
Loading…
Add table
Add a link
Reference in a new issue