Skip to content

Instantly share code, notes, and snippets.

View oshock's full-sized avatar

Owen oshock

View GitHub Profile
@oshock
oshock / Gameshow_probability.cs
Created June 16, 2025 18:16
Gameshow probability
// A gameshow host gives you three doors.
// Behind two of the doors are goats, behind one of the doors is a brand new house.
// You pick a door at random. You have a 33% chance to correctly guess the door with the house.
// The gameshow host opens one of the other doors and presents a goat.
// Now two doors remain; one with a goat and one with the house.
// The host now says, 'would you like to stick with your door or change to the other door?'
// Statistically speaking, is it in your interest to stay with your door, or switch to the other one?
var firstGuessWasCorrect = 0;
var changingWasCorrect = 0;