60 likes | 138 Views
Was this Content Useful? Like Share Comment CodeGround Online Testing Platform is an online assessment and evaluation system that helps Recruiters conduct online screening tests to filter candidates before the interview process. CodeGround Recruitment Tests can be used during Campus Recruitment or screening walk-in candidates. CodeGround supports Aptitude Tests, English Communication Skills Assessments and Online Coding Contests in C, C , Java, PHP, Ruby, Python and JavaScript. CodeGround also supports asynchronous automated interviews.
E N D
TECHNICAL INTERVIEW QUESTION on PUZZLESThe Monty Hall Puzzle CodeGround Online Testing Platform is an online assessment and evaluation system that helps Recruiters conduct online screening tests to filter candidates before the interview process. CodeGround Recruitment Tests can be used during Campus Recruitment or screening walk-in candidates. CodeGround supports Aptitude Tests, English Communication Skills Assessments and Online Coding Contests in C, C++, Java, PHP, Ruby, Python and JavaScript. CodeGround also supports asynchronous automated interviews.
The Monty Hall Puzzle You are the contestant on a Game Show. There are 3 doors – say A,B and C – and behind one door is the prize of a million dollars. The prize is randomly placed and the probability of finding the prize behind any door is 1/3. You get to pick one door and if you’ve picked the right door, you win the prize. There’s a catch. After you’ve chosen a door, the game show host will not immediately open that particular door. The host will open another door that you did not pick and which he knows does not contain the prize. Suppose you had picked door A, and the prize is behind door B, the host will open door C and let you know that there is nothing being door C. At this point, you will be given a choice: Do you want to stick with your original choice (door A in the example above) or do you want to choose the other unopened door (door B in this example)? Would you switch your choice? Do you think that switching doors would have any impact on the probability of finding the prize? C B A
The Monty Hall Puzzle • Do you think that switching doors would have no impact on your odds of winning the prize? • Do you think that the probability of finding the prize behind either door would be the same – 50%? • WRONG!! • This is a bit counter-intuitive but you should switch doors. • Probability of winning the prize: • Sticking to your original choice – 1/3 • Switching to the other door – 2/3 • HOW?
Simulating the Monty Hall Puzzle Stick to your Original Choice Switch your Choice Let us assume without loss of generality that the prize is behind door A. You pick the other unopened door. You lose! You pick Door A The Host opens door B or C You pick Door A. You win! You switch your choice to door A. You win! You pick Door B. You lose! You pick Door B The Host opens door C You switch your choice to door A. You win! You pick Door C. You lose! You pick Door C The Host opens door B Net Odds of winning: 2/3 Net Odds of winning: 1/3
Explaining the Monty Hall Puzzle Let’s the divide the doors into two sets Set 1 : {The door you picked originally} The Probability that the prize is in Set 1 is 1/3 Set 2 : {The other two doors} The Probability that the prize is in Set 2 is 2/3 The Host will open a door from Set 2 that does NOT have the prize, but the probability that the prize is in Set 2 still remains at 2/3. Switching your choice to choose the remaining unopened door from Set 2 maximizes your odds of winning.
Was this Content Useful? Comment Share Like CodeGround Online Testing Platform is an online assessment and evaluation system that helps Recruiters conduct online screening tests to filter candidates before the interview process. CodeGround Recruitment Tests can be used during Campus Recruitment or screening walk-in candidates. CodeGround supports Aptitude Tests, English Communication Skills Assessments and Online Coding Contests in C, C++, Java, PHP, Ruby, Python and JavaScript. CodeGround also supports asynchronous automated interviews.