type Door = Door of Prize
let rand = new Random(DateTime.UtcNow.Ticks |> int)
[| Door Car; Door Goat; Door Goat |]
|> Array.sortBy (fun _ -> rand.NextDouble())
let reveal (doors : Door[]) choice =
|> Seq.filter ((<>) choice)
|> Seq.filter (fun idx -> doors.[idx] = Door Goat)
let play strategy (doors : Door[]) =
let choice = rand.Next(doors.Length)
let revealed = reveal doors choice
let choice = strategy choice revealed
if doors.[choice] = Door Car then Win else Lose
let strategyA choice _ = choice
let strategyB choice revealed =
|> Seq.filter (fun idx -> idx <> choice && idx <> revealed)
let getResults strategy =
|> Seq.filter (fun _ -> newGame() |> play strategy |> ((=) Win))
let resultsA = getResults strategyA
let resultsB = getResults strategyB
printfn "Stay : %d/1000 wins | Change : %d/1000 wins" resultsA resultsB