// Dors generators: one with car and many with goat int[] getDoors(int doorsCount){ int[] d = new int[doorsCount]; Random rnd = new Random(); int carIndex = rnd.Next(0, doorsCount); d[carIndex] = 1; for(int i = 0; i < doorsCount; i++) if(carIndex != i) d[i] = 0; return d; } // Prepare data Random rnd = new Random(); double winCounterNoChange = 0; double winCounterChange = 0; // Key attributes [!] double rounds = 2; int doorsCount = 100; // Do many games for (int i = 0; i < rounds; i++) { // Next random doors & my random choose int[] d = getDoors(doorsCount); int myDoor = rnd.Next(0, doorsCount); // No change if my choose is right if (d[myDoor] == 1) winCounterNoChange++; // I do change, only two possible results: // I have door with car - I'll lose // I have door with goat - I'll win // Counting if it's win if(d[myDoor] != 1) winCounterChange++; } // Count and probability of the victory Console.Clear(); Console.WriteLine($"Doors = {doorsCount}, total games' rounds = {rounds}"); string R1 = $@"Player don't change the door: {winCounterNoChange} " + $@"wins = {(winCounterNoChange / rounds) * 100}%"; string R2 = $@"Player change the door: {winCounterChange} " + $@"wins = {(winCounterChange / rounds) * 100}%"; Console.WriteLine(R1); Console.WriteLine(R2); Console.ReadKey();