Paradox can mean many things, such as in my discrete math class, where it defines a particular logical statement to be impossible. A paradox can also describe something that is counter-intuitive (you would think the opposite of the actuality). Today at work I listened to RadioLab (a cool NPR/WNYC podcast I recently found) titled "Numbers." While it wasn't quite as good as "Lost & Found", it is definitely up there...along with basically every other episode (http://www.radiolab.org/2009/nov/30/).
You should always switch because when you originally picked the 1st door you only had a 33% chance of picking the Porsche and now between the two doors that are left, there is a 50% chance. I found this interesting, but didn't quite understand (and you are probably still scratching your head too I suppose? ^_^). This is why I decided to put my Java programming skills to use to write a program to test this out. When writing I realized there were several possibilities (going under assumption that you always switch):
1) I originally picked the ONE door with the Porsche and when I switch I will get crap.
2) I picked one of the other TWO booby prize doors and when I switch I will get the Porsche.
Ok, point proven...but if you are still unsatisfied you can try it yourself or run my java source code:
import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;
/**
*
* @author JT Newsome
* Demonstrates the Monty Hall Paradox and theory of probability.
*
*/
public class MontyHallTester {
public static int forMonty = 0;
public static int againstMonty = 0;
public static int min = 0;
public static int max = 2;
public static int timesToLoop = 1000000;
public static void main(String[] args) {
for(int i = 0; i < timesToLoop; i++){
montyTest();
}
System.out.println("forMonty: "+forMonty);
System.out.println("againstMonty: "+againstMonty);
System.out.println("Ratio: "+ (forMonty/againstMonty));
}
public static void montyTest(){
ArrayList
boxes.add(0);
boxes.add(1);
boxes.add(2);
Collections.shuffle(boxes);
Random rand = new Random();
int randomNum1 = rand.nextInt(max - min + 1) + min;
if (boxes.get(randomNum1) == 2){
againstMonty++;
}
else forMonty++;
}
}
Ok, well that was fun! Happy days until we meet again!
No comments:
Post a Comment