Digits of Pi

Started by
29 comments, last by Postie 10 years, 4 months ago

Will anyone give my problem a try? You can write a simulation, if you can't think of the math...

Fairly sure it's 1/7.

The Trouble With Robots - www.digitalchestnut.com/trouble
Advertisement

Will anyone give my problem a try? You can write a simulation, if you can't think of the math...

Fairly sure it's 1/7.

Yay! This is my favorite way of introducing Bayes' theorem. I tried asking a few non-science types, and I got "1/2" a lot. I bet it's quite correlated with the Monty Hall problem.

That's another good example of mathematics being unreal. The chance of killing yourself in Russian Roulette is known to be considerably less than 1/6 with the first shot.

Why? Because the gun doesn't care that you say it's a 1/6 chance, but gravity makes sure that most of the time the loaded chamber stops at the bottom.

Insofar, the person getting the 3rd shot in row has by far the highest chance of blowing their brain out, if there's a bullet in the gun.

But assuming the gun obeys your math, the chance is exactly 50%. Every time someone pulled the trigger, there was a chance he'd blow out his brain, assuming there was a bullet loaded in one of the chambers. And yes, pulling the trigger three times in a row and still being alive is less likely than only having to pull it once. But whatever, it didn't happen, it's over.

Now there is only one chamber left that hasn't been triggered/tried, and you must use this one. Which means you could just as well use a single-chamber gun (one of those things they use in pirate movies) that has been secretly loaded (or not loaded) by a referee (with a fair coin, if you will).

So, the chance of blowing out your brain is only dependent on whether the referee put in a bullet or not. No matter what nice mathematics you do, it only depends on whether the referee put in a bullet, or not.


I bet it's quite correlated with the Monty Hall problem.

Thank you, samoth, for proving my point.

Oh, let's convince the Erd?s-style thinkers out there:

#include <iostream>
#include <cstdlib>
#include <ctime>

int main() {
  std::srand(std::time(0));
 
  int brains_blown_out_counter = 0;
  int brains_not_blown_out_counter = 0;
  int things_did_not_go_as_described_in_the_problem_counter = 0;
 
  for (int i=0; i<10000000; ++i) {
    bool is_there_a_bullet_at_all = std::rand() % 2;
    int chamber_if_there_is_a_bullet = std::rand() % 6;
    if (is_there_a_bullet_at_all == false) {
      brains_not_blown_out_counter++;
    }
    else if (chamber_if_there_is_a_bullet == 5) {
      brains_blown_out_counter++;
    }
    else
      things_did_not_go_as_described_in_the_problem_counter++;
  }
  std::cout << "Brains blown out: " << brains_blown_out_counter << '\n';
  std::cout << "Brains not blown out: " << brains_not_blown_out_counter << '\n';
  std::cout << "Things did not go as described in the problem: " << things_did_not_go_as_described_in_the_problem_counter << '\n';
  std::cout << "Frequency of brains blown out given that things did go as described in the problem: " <<
    double(brains_blown_out_counter) / (brains_blown_out_counter + brains_not_blown_out_counter) << '\n';
}

Output:

Brains blown out: 834503
Brains not blown out: 4998343
Things did not go as described in the problem: 4167154
Frequency of brains blown out given that things did go as described in the problem: 0.14307

So what have you proven by counting something completely different?

This code tests whether there is a bullet at all. Fair enough. No bullet, no shot, sure thing.

Then it tests whether the bullet is in the chamber 5 (index zero based). Fine. Except if it's not, then someone blew out his brain already. The premise was that you arrive at the sixth chamber without someone having blown out his brain. So you are "proving" me wrong by proving a completely different premise.

Having arrived at chamber no. 6 (or rather no. 5, with a zero-based index like in the code) without someone blowing out his brain means exactly one thing, no more and no less, and no matter what mathematics you apply:

If there is a bullet (which is 50% likely) then it is necessarily in this chamber (100% chance). There is no other way, since all other chambers have been tested (i.e. we have proof that the bullet isn't there). You do not have a 7th chamber where you could have put the bullet. It's irrelevant from which side you try to look at it, or what mathematical trick you try. There simply is no other chamber left.

Of course, that is only true if you don't account for Heisenberg bullets which change the chamber they're in as soon as you look at them... smile.png

The problem asked what the probability is that the sixth chamber contains a bullet given that the first five didn't. That is exactly what Álvaro's code counts: if there is a bullet in one of the first five chambers, then there's nothing to count because the problem didn't ask about that situation.

What is the probability that if we shave all the heads of all women in the world and count the number of hairs removed for each person, 2 or more had exactly the same number of hairs? I say women since there are negligible numbers of completely bald women, and we aren't going to count 0 as a valid number of hairs. Until after our little experiment of course ;)

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

Output:


Brains blown out: 834503
Brains not blown out: 4998343
Things did not go as described in the problem: 4167154
Frequency of brains blown out given that things did go as described in the problem: 0.14307

Nice demo. My method was to substitute the problem for an equivalent one that's easier to reason about:

Suppose there are two guns with six barrels each, and a bullet is put into a randomly chosen barrel of one of the guns. You then play Russian Roulette with just one of these guns, again at random.

This is equivalent to the original problem because there is still a 50:50 chance that you're playing with a loaded gun and the location of the bullet if present is still random and fair. However the intuition is now that there are 12 equally likely places that the bullet can be (2 guns x 6 barrels). Having ruled out five of them (the barrels already discharged) we have seven remaining locations where the bullet could be, no information about which of these is more likely, hence a 1 in 7 chance of blowing our brains out.

That's another good example of mathematics being unreal. The chance of killing yourself in Russian Roulette is known to be considerably less than 1/6 with the first shot.

Why? Because the gun doesn't care that you say it's a 1/6 chance, but gravity makes sure that most of the time the loaded chamber stops at the bottom.

Insofar, the person getting the 3rd shot in row has by far the highest chance of blowing their brain out, if there's a bullet in the gun.

That's interesting, though in this case I think such a practical consideration would further improve your chances on the 6th shot (better than 1 in 7) as it's near the top again. Another practical consideration is that one could possibly detect the presence or otherwise of the bullet by it's weight.

The Trouble With Robots - www.digitalchestnut.com/trouble

The problem asked what the probability is that the sixth chamber contains a bullet given that the first five didn't. That is exactly what Álvaro's code counts: if there is a bullet in one of the first five chambers, then there's nothing to count because the problem didn't ask about that situation.

No. And here is the no-science type's explanation why:

The code first checks whether there is a bullet in the gun at all (50% chance). If there isn't one, you cannot blow out your brain. Quite so.

But now, in the "there is a bullet" branch comes the fallacy, the wrong assumption. The code now determines which chamber the bullet is in. There are 6 chambers, and the bullet could be in any of them, right? Wrong.

We have already pulled the trigger 5 times, and nothing has happened. There are only six chambers, it is known that there is a bullet, and it has been proven that the first 5 chambers are empty. The bullet can therefore only be in one place, there is no way it could be anywhere else.

The likelihood is 1/1, not 1/6. Proof by intimidation (Bayes theorem) does not change the fact that the bullet can only be in one location, even if the other guy is a no-science type like me.

Assuming the bullet could be in any different location simply defies reality.

Together with the 50% chance of a bullet being there at all, the 100% chance of having it in your chamber if there is one gives you a 50% overall chance. No need for complicated proofs or experiments.

Which is what I was saying: Everything with a grain of salt. Mathematics are nice, but they are not necessarily real (or applicable) because they often base on wrong assumptions or ignore important details of reality. As such, they are awesome for mathematical problems where the assumptions hold (see birthday paradox as an example) but they are not necessarily awesome for real stuff.

This topic is closed to new replies.

Advertisement