Monty Hall problem: Difference between revisions

Content added Content deleted
Line 681: Line 681:
#include <time.h>
#include <time.h>
#include <math.h>
#include <math.h>
#define NumSim 1000000000 // one billion of simulations! using the Law of large numbers concept [[https://en.wikipedia.org/wiki/Law_of_large_numbers large numbers]]
#define NumSim 1000000000 // one billion of simulations! using the Law of large numbers concept [https://en.wikipedia.org/wiki/Law_of_large_numbers]


void main() {
void main() {
Line 709: Line 709:
Output of one run:
Output of one run:


<pre> After 1000000000 games, I won 333329011 by staying. That is 33.332902%. and I won by switching 666670989 That is 66.667098% </pre>
<pre>After 1000000000 games, I won 333332381 by staying. That is 33.333238%. and I won by switching 666667619 That is 66.666762% </pre>


=={{header|C sharp|C#}}==
=={{header|C sharp|C#}}==