Sleeping Beauty problem: Difference between revisions
Added Easylang
m (→{{header|Wren}}: Minor tidy) |
(Added Easylang) |
||
Line 307:
print("Wakenings over \(experiments) experiments: \(wakenings)")
print("Sleeping Beauty should estimate a credence of: \(Float(heads) / Float(wakenings))")</syntaxhighlight>
=={{header|EasyLang}}==
<syntaxhighlight>
reps = 1e6
for i to reps
coin = randint 2
wakings += 1
if coin = 1
heads += 1
else
wakings += 1
.
.
print "Chance of waking up with heads: " & heads / wakings * 100 & "%"
</syntaxhighlight>
=={{header|Excel}}==
|