Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,15 @@
Run runs;doors;i;chosen;cars;goats;swap;stay;ix;prices
[1] ⍝0: Monthy Hall problem
[2] ⍝1: http://rosettacode.org/wiki/Monty_Hall_problem
[3]
[4] (⎕IO ⎕ML)0 1
[5] prices0 0 1 ⍝ 0=Goat, 1=Car
[6]
[7] ix,/{3?3}¨runs ⍝ random indexes of doors (placement of car)
[8] doors(runs 3)prices[ix] ⍝ matrix of doors
[9] stay+doors[;?3] ⍝ chose randomly one door - is it a car?
[10] swapruns-stay ⍝ If not, then the other one is!
[11]
[12] 'Swap: ',(2100×(swap÷runs)),'% it''s a car'
[13] 'Stay: ',(2100×(stay÷runs)),'% it''s a car'