well known proba problem

All non-Go discussions should go here.
tj86430
Gosei
Posts: 1348
Joined: Wed Apr 28, 2010 12:42 am
Rank: FGA 7k GoR 1297
GD Posts: 0
Location: Finland
Has thanked: 49 times
Been thanked: 129 times

Re: well known proba problem

Post by tj86430 »

Bantari wrote:
But ok, let me try another approach. Considering what we KNOW the questions gives - to remove misleading details - lets assume we have the boxes in such way that each box has one stone on the top visible, and one stone inside hidden. So our boxes are: Bb, Bw, and Ww - with capitalized letters being the visible stones.

So we are left with Bb and Bw. There is no harm in showing one Black stone - since we KNOW we have picked it. This is the justification for it being visible - why hide it if we KNOW we picked it?

Also - since we KNOW we picked a Black stone, we can eliminate the Ww box - just throw it away.

So, the whole question, paraphrased, simplified, and without confusing and unnecessary details, boils down to this:

- You have TWO boxes, Bb and Bw.
- Pick one at random.
- What is the chance of having picked Bb? (since this is the only scenario in which the second/hidden stone is also B)

The answer is clearly 50%.

Notice - in the above simplification - it does not matter if the boxes are (Bb Bw) or (Bbbbb Bw) or (Bb Bwww) or whatever - the answer is the same, as it should be. As long as the hidden stones are all of the same color per box.

That is a different problem. The one originally presented can not be simplified like that.
Offending ad removed
tj86430
Gosei
Posts: 1348
Joined: Wed Apr 28, 2010 12:42 am
Rank: FGA 7k GoR 1297
GD Posts: 0
Location: Finland
Has thanked: 49 times
Been thanked: 129 times

Re: well known proba problem

Post by tj86430 »

I know there are people who are knowledgeable in programming. I can later provide a sample java code that simulates the problem, I believe I have it around somewhere (and if not, it's easy to write). Perhaps that will at least convince some of you that the right answer indeed is 2/3, even if I'm unable to explain to you why.
Offending ad removed
User avatar
ez4u
Oza
Posts: 2414
Joined: Wed Feb 23, 2011 10:15 pm
Rank: Jp 6 dan
GD Posts: 0
KGS: ez4u
Location: Tokyo, Japan
Has thanked: 2351 times
Been thanked: 1332 times

Re: well known proba problem

Post by ez4u »

Bantari wrote:...

But this is NOT the question. You KNOW you picked a Black stone. The question is - which box did you picked it from: BB or BW? Because this determines the remaining stone unequivocally.

...

Let's look only at this last choice. What do we know about our handling of BB and BW if we did this 100 times with only the two boxes? About 50 times we are holding BB in our hands. We choose a B stone and sure enough there is another B stone inside. The other ~50 times we are holding BW in our hands. However, about 25 times we reach in, draw a W stone - and abandon the box(!) since we have just failed the part about drawing a B stone. The other ~25 times we draw a B stone and then discover W stone remaining in the box. So in the 75 or so cases where we draw a B stone, we find another B stone ~50 times, i.e. 2/3 of the cases where we complete the whole process.
Dave Sigaty
"Short-lived are both the praiser and the praised, and rememberer and the remembered..."
- Marcus Aurelius; Meditations, VIII 21
tj86430
Gosei
Posts: 1348
Joined: Wed Apr 28, 2010 12:42 am
Rank: FGA 7k GoR 1297
GD Posts: 0
Location: Finland
Has thanked: 49 times
Been thanked: 129 times

Re: well known proba problem

Post by tj86430 »

Here's the simulation code:

Code: Select all

package bertrandparadox;

public class BertrandParadox {

    private static final int NUM_LOOPS = 100000000;
   
    public static void main(String[] args) {
        java.util.Random rnd = new java.util.Random();
        int numOtherIsWhite = 0;
        int numOtherIsBlack = 0;
        int numBlackPicked = 0;
        int numWhitePicked = 0;
       
        for (int i = 0; i < NUM_LOOPS; i++ ) {
            // we have six stones:
            // 0 & 1 are white in bowl A,
            // 2 is white in bowl B, 3 is black in bowl B and
            // 4 & 5 are black in bowl C
            int stone = rnd.nextInt(6); // we pick a random stone btw 0 and 5
            if (stone == 0 || stone == 1) {
                // we picked a white stone from bowl A
                // so nothing happens
                numWhitePicked++;
            } else if (stone == 2) {
                // we picked a white stone from bowl B
                // again nothing happens
                numWhitePicked++;
            } else if (stone == 3) {
                // we picked a black stone from bowl B
                // now the other must be white
                numOtherIsWhite++;
                numBlackPicked++;
            } else if (stone == 4 || stone == 5) {
                // we picked a black stone from bowl C
                // now the other must be black
                numOtherIsBlack++;
                numBlackPicked++;
            }
        }
        System.out.println("Out of total " + NUM_LOOPS + " attempts:");
        System.out.println("- A white stone was picked " + numWhitePicked
            + " times (" + (double)numWhitePicked / (double)NUM_LOOPS * 100
            + "%)");
        System.out.println("- A black stone was picked " + numBlackPicked
            + " times (" + (double)numBlackPicked / (double)NUM_LOOPS * 100
            + "%)");
        System.out.println("  Of these:");
        System.out.println("  - the other stone in the bowl was white "
            + numOtherIsWhite + " times ("
            + (double)numOtherIsWhite / (double)numBlackPicked * 100 + "%)");
        System.out.println("  - the other stone in the bowl was black "
            + numOtherIsBlack + " times ("
            + (double)numOtherIsBlack / (double)numBlackPicked * 100 + "%)");
    }
}


And here is the sample output:

Code: Select all

Out of total 100000000 attempts:
- A white stone was picked 50003102 times (50.003102%)
- A black stone was picked 49996898 times (49.996898%)
  Of these:
  - the other stone in the bowl was white 16658942 times (33.319951169770576%)
  - the other stone in the bowl was black 33337956 times (66.68004883022944%)
Offending ad removed
User avatar
Magicwand
Tengen
Posts: 4844
Joined: Wed Apr 21, 2010 5:26 am
Rank: Wbaduk 7D
GD Posts: 0
KGS: magicwand
Tygem: magicwand
Wbaduk: rlatkfkd
DGS: magicwand
OGS: magicwand
Location: Mechanicsburg, PA
Has thanked: 62 times
Been thanked: 504 times

Re: well known proba problem

Post by Magicwand »

TJ well done.
kirby's first post should be sufficient reasoning to solve this problem.
edit:
wow...i was wrong??? it is not 50 50?
"The more we think we know about
The greater the unknown"

Words by neil peart, music by geddy lee and alex lifeson
User avatar
Bantari
Gosei
Posts: 1639
Joined: Sun Dec 06, 2009 6:34 pm
GD Posts: 0
Universal go server handle: Bantari
Location: Ponte Vedra
Has thanked: 642 times
Been thanked: 490 times

Re: well known proba problem

Post by Bantari »

perceval wrote:
Bantari wrote:
Too tired to follow all that at the moment, I take your word for it, especially since you seem to support my point.


actually i do not think i support your point ,just the fact that indeed adding B stones in the "all B" box should not change the outcome, and I showed that indeex if you are careful you can recover a proba 2/3.


My point in the post you mentioned was that you cannot say "2 Black and 1 White stones are left therefore its 2/3." I see what you say as supporting this since you argue that the value of 2/3 is independent of the number of stones in Black box - which is what I gave as an example as well.

Overall you disagree with my other posts when I speak about 50% rather than 2/3, but this was not the point of the post you answered.
- Bantari
______________________________________________
WARNING: This post might contain Opinions!!
User avatar
Bantari
Gosei
Posts: 1639
Joined: Sun Dec 06, 2009 6:34 pm
GD Posts: 0
Universal go server handle: Bantari
Location: Ponte Vedra
Has thanked: 642 times
Been thanked: 490 times

Re: well known proba problem

Post by Bantari »

tj86430 wrote:Here's the simulation code:

Code: Select all

package bertrandparadox;

public class BertrandParadox {

    private static final int NUM_LOOPS = 100000000;
   
    public static void main(String[] args) {
        java.util.Random rnd = new java.util.Random();
        int numOtherIsWhite = 0;
        int numOtherIsBlack = 0;
        int numBlackPicked = 0;
        int numWhitePicked = 0;
       
        for (int i = 0; i < NUM_LOOPS; i++ ) {
            // we have six stones:
            // 0 & 1 are white in bowl A,
            // 2 is white in bowl B, 3 is black in bowl B and
            // 4 & 5 are black in bowl C
            int stone = rnd.nextInt(6); // we pick a random stone btw 0 and 5
            if (stone == 0 || stone == 1) {
                // we picked a white stone from bowl A
                // so nothing happens
                numWhitePicked++;
            } else if (stone == 2) {
                // we picked a white stone from bowl B
                // again nothing happens
                numWhitePicked++;
            } else if (stone == 3) {
                // we picked a black stone from bowl B
                // now the other must be white
                numOtherIsWhite++;
                numBlackPicked++;
            } else if (stone == 4 || stone == 5) {
                // we picked a black stone from bowl C
                // now the other must be black
                numOtherIsBlack++;
                numBlackPicked++;
            }
        }
        System.out.println("Out of total " + NUM_LOOPS + " attempts:");
        System.out.println("- A white stone was picked " + numWhitePicked
            + " times (" + (double)numWhitePicked / (double)NUM_LOOPS * 100
            + "%)");
        System.out.println("- A black stone was picked " + numBlackPicked
            + " times (" + (double)numBlackPicked / (double)NUM_LOOPS * 100
            + "%)");
        System.out.println("  Of these:");
        System.out.println("  - the other stone in the bowl was white "
            + numOtherIsWhite + " times ("
            + (double)numOtherIsWhite / (double)numBlackPicked * 100 + "%)");
        System.out.println("  - the other stone in the bowl was black "
            + numOtherIsBlack + " times ("
            + (double)numOtherIsBlack / (double)numBlackPicked * 100 + "%)");
    }
}


And here is the sample output:

Code: Select all

Out of total 100000000 attempts:
- A white stone was picked 50003102 times (50.003102%)
- A black stone was picked 49996898 times (49.996898%)
  Of these:
  - the other stone in the bowl was white 16658942 times (33.319951169770576%)
  - the other stone in the bowl was black 33337956 times (66.68004883022944%)


Sweet...
But - isn't the premise of the problem that the White stone should NEVER be picked on the first pick?
Your scenario includes cases of picking White stone from bowl WW as well as picking White stone from bowl BW. But according to the problem wording this DOES NOT HAPPEN. The problem wording ENSURES that Black stone is picked on the first pick, no?

The question clearly states:
This Coin turns out to be a Gold coin. What is the probability that the second coin in the box is also Gold ?

So we can simply dismiss all the cases when White/Silver coins are picked and should not include them in the calculation. Since this is now within the parameters of the problem.

To me, your code, while nice, solves a different problem than the one originally posted. Or the wording was messed up somewhere along the line....
- Bantari
______________________________________________
WARNING: This post might contain Opinions!!
Horibe
Lives with ko
Posts: 206
Joined: Thu Jul 01, 2010 8:02 am
GD Posts: 248
Has thanked: 33 times
Been thanked: 60 times

Re: well known proba problem

Post by Horibe »

This is not my strong suit, and when I left this thread earlier today, I still could not see it. After all, you are either in one bowl or the other, so its 50/50.

But you are not in one bowl or the other, you are already in a bowl. And, since two of the three chances for your first pick were in one bowl, then there is a 2/3 chance you are in that bowl and the next coin/stone/annoying item will be the same.

Hope this helps.
tj86430
Gosei
Posts: 1348
Joined: Wed Apr 28, 2010 12:42 am
Rank: FGA 7k GoR 1297
GD Posts: 0
Location: Finland
Has thanked: 49 times
Been thanked: 129 times

Re: well known proba problem

Post by tj86430 »

Bantari wrote:But - isn't the premise of the problem that the White stone should NEVER be picked on the first pick?
Your scenario includes cases of picking White stone from bowl WW as well as picking White stone from bowl BW. But according to the problem wording this DOES NOT HAPPEN. The problem wording ENSURES that Black stone is picked on the first pick, no?

The OP says:

This Coin turns out to be a Gold coin


In the go stone context the stone turns out to be black. In other words, you pick one, look at it and see that it is black. It could have been white, but it wasn't. It happened to be black. And now and only now, after you have seen that it happened to be black, you are asked how likely it is that the other stone in the same bowl is black too.
Offending ad removed
tj86430
Gosei
Posts: 1348
Joined: Wed Apr 28, 2010 12:42 am
Rank: FGA 7k GoR 1297
GD Posts: 0
Location: Finland
Has thanked: 49 times
Been thanked: 129 times

Re: well known proba problem

Post by tj86430 »

Magicwand wrote:TJ well done.
kirby's first post should be sufficient reasoning to solve this problem.
edit:
wow...i was wrong??? it is not 50 50?

Yes, I'm sorry to say that you were wrong.
Offending ad removed
Bill Spight
Honinbo
Posts: 10905
Joined: Wed Apr 21, 2010 1:24 pm
Has thanked: 3651 times
Been thanked: 3373 times

Re: well known proba problem

Post by Bill Spight »

Bonobo wrote:I don’t get it.

Choices at first:

- BB
- BW
- WW

I choose a box and take out a B stone, so the WW option has just been eliminated, hasn’t it? How should then a 2/3 chance remain? There is no /3 anymore, so it should be 2/2 -> 1:1 chance, no?

OK, I’m slightly dyscalculic, meaning I have to take of my shoes when counting to 20 ;-)

Please just disregard if I’m simply too stupid.


Suppose that we rearrange the order of operations. First, we eliminate the WW box. Then, we choose one of the other boxes. Question 1. What is the probability that the box we chose has two Black stones in it? Then we draw a stone from the box, and it is a Black stone. Question 2. Now what is the probability that the box had two Black stones in it?
The Adkins Principle:
At some point, doesn't thinking have to go on?
— Winona Adkins

Visualize whirled peas.

Everything with love. Stay safe.
Bill Spight
Honinbo
Posts: 10905
Joined: Wed Apr 21, 2010 1:24 pm
Has thanked: 3651 times
Been thanked: 3373 times

Re: well known proba problem

Post by Bill Spight »

Kirby wrote:
This reminds me of the monty hall problem. Intuition says that it's a 50% chance, but intuition didn't serve me well with the monty hall problem, either. ;-)

My rationale:
Two possible events: first box or third box.


Monty Hall was interviewed after he retired, and the interviewer gave him the Monty Hall problem as it is usually posed. (That's important.) Monty had never heard of the problem, but he gave the correct answer. He said that he could manipulate contestants to make the wrong guess. ;)

To get the standard answer to the Monty Hall problem you have to restrict Monty's choices.
The Adkins Principle:
At some point, doesn't thinking have to go on?
— Winona Adkins

Visualize whirled peas.

Everything with love. Stay safe.
User avatar
EdLee
Honinbo
Posts: 8859
Joined: Sat Apr 24, 2010 6:49 pm
GD Posts: 312
Location: Santa Barbara, CA
Has thanked: 349 times
Been thanked: 2070 times

Post by EdLee »

perceval,

I borrow the "The little green woman" from Monty Hall Problem:

(0) 3 bowls: ( :white: :white: ), ( :black: :black: ), and ( :white: :black: ).
(1) Suppose you randomly pick a bowl, then take one of the 2 stones out from the bowl.
(2) This stone turns out to be :white:.
(3) What is the probability that the second stone in the bowl is also :white: ?

Between (2) and (3), I now insert two important steps:
(2a) We get rid of the 2 un-chosen bowls;
(2b) a little green alien appears from a UFO.
She did not see (0), (1), or (2). In fact, we don't even tell her anything about what's inside the (singular) bowl.
From her perspective, this is what she sees:

(3) We take something out from the bowl (OUR perspetive: the same bowl in (1); HER perspective: the ONLY bowl).
(Remember, she has no knowledge of what's inside the bowl -- we could've picked a cow out of it, as far as she knew.)

This is the crux of the matter: if we repeat this thought experiment 1 million times --
that is, we invite the same little green alien to do this 1 million times --
for the little green alien, she will see :white: approx. half a million times; and :black: approx. half a million times.
If we ask her, what is the probability of seeing :white: come out of the bowl based entirely on what she has seen,
she would say approx. 50%.

So perceval, my question is, in your original wording of (3), what do you mean by "what IS the probability..." ?

(And clearly, this is NOT what TJ's code simulated -- the perspective of the little green alien.)
Bill Spight
Honinbo
Posts: 10905
Joined: Wed Apr 21, 2010 1:24 pm
Has thanked: 3651 times
Been thanked: 3373 times

Re: well known proba problem

Post by Bill Spight »

Bantari wrote:So, the whole question, paraphrased, simplified, and without confusing and unnecessary details, boils down to this:

- You have TWO boxes, Bb and Bw.
- Pick one at random.
- What is the chance of having picked Bb? (since this is the only scenario in which the second/hidden stone is also B)

The answer is clearly 50%.


If you pick one of those two boxes at random, indeed, the probability is 50% that one of the boxes has two Black stones in it. But we have not used all the information that we got from drawing a Black stone from a box. :) Suppose now that you draw a stone from the box that you picked, and it is Black. Now what is the probability that the box has another Black stone in it?
The Adkins Principle:
At some point, doesn't thinking have to go on?
— Winona Adkins

Visualize whirled peas.

Everything with love. Stay safe.
User avatar
EdLee
Honinbo
Posts: 8859
Joined: Sat Apr 24, 2010 6:49 pm
GD Posts: 312
Location: Santa Barbara, CA
Has thanked: 349 times
Been thanked: 2070 times

Post by EdLee »

Bill Spight wrote:But we have not used all the information that we got from drawing a Black stone from a box. :)
Bill, exactly -- this is also my question (confusion): P = X/Y. In the original wording of " (3) What is the probability of...? ",
I want to know what is X and what is Y for that wording of (3) ?

( Because, from the perspective of the little green alien, X ~= half a million, and Y = 1 million exactly; so for her P ~= 50%. )
Post Reply