3 ms·
Years ago I challenged you on this and you suggested I write a simulation to check. I did just that and my understanding of the problem improved dramatically. T
by ecdavis 5y ago
Years ago I challenged you on this and you suggested I write a simulation to check. I did just that and my understanding of the problem improved dramatically. That exchange made a pretty big impact on me and is something I think about fairly often, so thanks. :)
https://news.ycombinator.com/item?id=9079260 https://news.ycombinator.com/item?id=9079260
- dllthomas 5y agoThis made my week :)
- hypertele-Xii 5y agoI also wrote a simulation, in PHP, when I first encountered this problem. <?php $wins = 0; for ($i = 0; $i < 1000; $i ++) { $car = mt_rand(0, 2); $choose = mt_rand(0, 2); if ($choose == $car) $wins ++; } echo "stay: " . ($wins / 1000 * 100) . "%<br />"; // switch $wins = 0; for ($i = 0; $i < 1000; $i ++) { $car = mt_rand(0, 2); $choose = mt_rand(0, 2); if ($choose != $car) $wins ++; } echo "switch: " . ($wins / 1000 * 100) . "%";