17 lines
427 B
Text
17 lines
427 B
Text
#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>
|