Hacker News new | ask | show | jobs
by Nursie 1836 days ago
No, it's a 2/3 chance at that point.

When you choose initially, you have a 1/3 probability of getting the right one, leaving a 2/3 probability that the car is on one of the other two.

The host reveals one of the other two. So that 2/3 probability applies to the remaining door. Here is a short C implementation that made it very clear to me...

  #include <stdio.h>
  #include <stdlib.h>

  int doround () {
    int car = rand() % 3;
    int firstchoice = rand() % 3;

    // host reveals one of the goat doors

    if (car == firstchoice) {
      // you changing to the other door after the reveal is a loss
      return 0;
    }

    if(car != firstchoice) {
      // you changing to the other door after the reveal is a win
      return 1;
    }
  }

  int main(int argc, char** argv) {
    int wins=0;
    for (int round=0; round < 1000; round++){
      wins+=doround();
    }
    printf("Worked in %d of %d rounds\n", wins, rounds);
  }