tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
17
Task/Probabilistic-choice/HicEst/probabilistic-choice.hicest
Normal file
17
Task/Probabilistic-choice/HicEst/probabilistic-choice.hicest
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
REAL :: trials=1E6, n=8, map(n), limit(n), expected(n), outcome(n)
|
||||
|
||||
expected = 1 / ($ + 4)
|
||||
expected(n) = 1 - SUM(expected) + expected(n)
|
||||
|
||||
map = expected
|
||||
map = map($) + map($-1)
|
||||
|
||||
DO i = 1, trials
|
||||
random = RAN(1)
|
||||
limit = random > map
|
||||
item = INDEX(limit, 0)
|
||||
outcome(item) = outcome(item) + 1
|
||||
ENDDO
|
||||
outcome = outcome / trials
|
||||
|
||||
DLG(Text=expected, Text=outcome, Y=0)
|
||||
Loading…
Add table
Add a link
Reference in a new issue