Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
17
Task/Monty-Hall-problem/Ursala/monty-hall-problem.ursala
Normal file
17
Task/Monty-Hall-problem/Ursala/monty-hall-problem.ursala
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#import std
|
||||
#import nat
|
||||
#import flo
|
||||
|
||||
rounds = 10000
|
||||
|
||||
car_locations = arc{1,2,3}* iota rounds
|
||||
initial_choices = arc{1,2,3}* iota rounds
|
||||
|
||||
staying_wins = length (filter ==) zip(car_locations,initial_choices)
|
||||
switching_wins = length (filter ~=) zip(car_locations,initial_choices)
|
||||
|
||||
format = printf/'%0.2f'+ (times\100.+ div+ float~~)\rounds
|
||||
|
||||
#show+
|
||||
|
||||
main = ~&plrTS/<'stay: ','switch: '> format* <staying_wins,switching_wins>
|
||||
Loading…
Add table
Add a link
Reference in a new issue