Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,9 @@
|
|||
sb=: {{
|
||||
monday=. ?2
|
||||
if. -. monday do.
|
||||
tuesday=. ?2
|
||||
<monday,tuesday
|
||||
else.
|
||||
<monday
|
||||
end.
|
||||
}}
|
||||
13
Task/Sleeping-Beauty-problem/J/sleeping-beauty-problem-2.j
Normal file
13
Task/Sleeping-Beauty-problem/J/sleeping-beauty-problem-2.j
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
sample=: sb"0 i.1e6 NB. simulate a million mondays
|
||||
#sample NB. number of experiments
|
||||
1000000
|
||||
#;sample NB. number of questions
|
||||
1500433
|
||||
+/;sample NB. number of heads
|
||||
749617
|
||||
+/0={.@>sample NB. how many times was sleeping beauty drugged?
|
||||
500433
|
||||
(+/%#);sample NB. odds of heads at time of question
|
||||
0.4996
|
||||
sample+&#;sample NB. total number of awakenings
|
||||
2500433
|
||||
Loading…
Add table
Add a link
Reference in a new issue