Boards Index › Chat rooms – the forum communities › Chat forum three boards › Basic IQ / Maths question
-
AuthorPosts
-
26 July, 2017 at 2:19 pm #1062491
Needless to say, the only person likely to be able to answer is possibly drac
26 July, 2017 at 2:25 pm #1062493Well first of all, people who go to University, take higher education etc are very intelligent people who have some amazing knowledge.
I’m not sure how much I agree with this. From my experience most people who go to university are of average or below average intelligence. And if they already had knowledge then there is no purpose in them attending a university course.
If people could live long enough, there would probably be people from hundreds of years ago alive still and still debating whether the earth is flat even though the evidence is plain to see today that it’s not. They just don’t want to believe it.
There are still people who believe that today.
26 July, 2017 at 2:29 pm #1062495I’m in a fairly heated debate with someone on a football forum over probability and it’s an old age argument you may have encountered. To summarise , there are three doors, one has a car behind it and two have goats. The contestant picks one door and the host picks a door with a goat behind it leaving the door the contestant has picked and one more door. The host then offers the contestant the option of switching. My argument is it is now a 50/50 chance of having a car or a goat and switching doors is irrelevant but common opinion amongst PHD maths graduates is theprobability benefit of switching increasing the chance of getting to the car to 2/3 … how so?
Switching doors doesn’t statistically improve your chances of winning the car, the Monty Hall problem is a good example of how raw probabilities can be misleading.
The easiest way to demonstrate this would be to write two computer programs that randomly select doors. The first program always switches doors, the other will always keep it’s door. On average across many attempts each program will win roughly the same number of times.
This isn’t a difficult task, and I could write this for you if you wanted.
26 July, 2017 at 3:07 pm #1062505I’m interested in mafia’s reply to this……
26 July, 2017 at 3:09 pm #1062507Turns out I recalled the solution inncorectly. I wrote a simulation to test the problem, swapping doors idoes mprove your chances of winnining.
Copy the following text into https://www.compilejava.net/ to run the program in your browser
import java.util.Random;
public class MontyHall
{
public static float calculateProbability(int doors, boolean swap)
{
Random rand = new Random();
int repeats = 1000;int wins = 0;
for(int i = 0; i <= repeats; i++) {
// Place the car behind a random door
int car = rand.nextInt(doors);// Chose a random door
int choice = rand.nextInt(doors);// Provide an alternate door at random
int option;
if(choice == car) {
option = rand.nextInt(doors);
}else {
option = car;
}// Swap doors
if(swap) choice = option;// Check if the chosen door wins
if(choice == car) ++wins;
}return ((float) wins / (float) repeats) * 100.f;
}public static void main(String[] args)
{
int doors = 3;
System.out.println(“Simulating the Monty Hall problem with ” + doors + ” doors”);
System.out.println(“Probability of winning when not swapping is ” + calculateProbability(doors, false) + “%”);
System.out.println(“Probability of winning when swapping is ” + calculateProbability(doors, true) + “%”);
}
}26 July, 2017 at 3:20 pm #1062514I made a slight mistake in the progam, where if you initially select the car, it can give you the same door you selected as the option to swap to. I haved fixed it here :
public class MontyHall
{
public static float calculateProbability(int doors, boolean swap)
{
Random rand = new Random();
int repeats = 1000;int wins = 0;
for(int i = 0; i <= repeats; i++) {
// Place the car behind a random door
int car = rand.nextInt(doors);// Chose a random door
int choice = rand.nextInt(doors);// Provide an alternate door at random
int option;
if(choice == car) {
while(option == car) option = rand.nextInt(doors);
}else {
option = car;
}// Swap doors
if(swap) choice = option;// Check if the chosen door wins
if(choice == car) ++wins;
}return ((float) wins / (float) repeats) * 100.f;
}public static void main(String[] args)
{
int doors = 3;
System.out.println(“Simulating the Monty Hall problem with ” + doors + ” doors”);
System.out.println(“Probability of winning when not swapping is ” + calculateProbability(doors, false) + “%”);
System.out.println(“Probability of winning when swapping is ” + calculateProbability(doors, true) + “%”);
}
}26 July, 2017 at 3:24 pm #1062516Turns out I recalled the solution inncorectly. I wrote a simulation to test the problem, swapping doors idoes mprove your chances of winnining.
This is why you shouldn’t rely on memory, and analyse things properly every time.
26 July, 2017 at 6:30 pm #1062538Hi drac, hope you are keeping well,
I will bow to your superior knowledge of computer programming rather than trying to enter one myself, as it will probably end up with a pork sandwich being revealed at the door. To clarify, are you saying that after testing this, the end result is a negligible /no benefit from switching the door as Mister Q and I have stated?
26 July, 2017 at 6:38 pm #1062540Well first of all, people who go to University, take higher education etc are very intelligent people who have some amazing knowledge.
I’m not sure how much I agree with this. From my experience most people who go to university are of average or below average intelligence. And if they already had knowledge then there is no purpose in them attending a university course.
If people could live long enough, there would probably be people from hundreds of years ago alive still and still debating whether the earth is flat even though the evidence is plain to see today that it’s not. They just don’t want to believe it.
There are still people who believe that today.
It depends on the university as some polytechnics masquerading as universities offering a degree in ” media studies ” have an entry standard so low that practically writing your own name correctly would enable you to enroll. My father taught history at Cambridge and whilst it’s difficult to quantify intelligence, find it hard to believe isn’t a collection of extremely bright people by any measurable standard in attendance. Personally I think most universities are a complete waste of time with many offering generic degrees leading nowhere so the key is reduce the number attending, raise the bar of entry level requirements and tailor make degrees to specific jobs. My sister for eg has an English degree, bar teaching what use is it in the real world?
26 July, 2017 at 6:49 pm #1062545I will bow to your superior knowledge of computer programming rather than trying to enter one myself, as it will probably end up with a pork sandwich being revealed at the door. To clarify, are you saying that after testing this, the end result is a negligible /no benefit from switching the door as Mister Q and I have stated?
Running the simulation with 3 doors staying with the initial door gives ~33% chance of winning, switiching doors gives a ~77% chance of winning.
If you run the simulation with 100 doors instead, staying with the initial door gives ~1% chance of winning, switiching doors gives a ~99% chance of winning.
-
AuthorPosts
Get involved in this discussion! Log in or register now to have your say!