Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,14 @@
|
|||
let experiments = 1000000
|
||||
var heads = 0
|
||||
var wakenings = 0
|
||||
for _ in (1...experiments) {
|
||||
wakenings += 1
|
||||
switch (Int.random(in: 0...1)) {
|
||||
case 0:
|
||||
heads += 1
|
||||
default:
|
||||
wakenings += 1
|
||||
}
|
||||
}
|
||||
print("Wakenings over \(experiments) experiments: \(wakenings)")
|
||||
print("Sleeping Beauty should estimate a credence of: \(Double(heads) / Double(wakenings))")
|
||||
Loading…
Add table
Add a link
Reference in a new issue