It is currently Thu May 15, 2025 2:51 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 132 posts ]  Go to page Previous  1, 2, 3, 4, 5 ... 7  Next
Author Message
Offline
 Post subject: Re: well known proba problem
Post #21 Posted: Tue Feb 12, 2013 6:19 am 
Gosei

Posts: 1348
Location: Finland
Liked others: 49
Was liked: 129
Rank: FGA 7k GoR 1297
Bantari wrote:
daal wrote:
Now that I've been told the answer, I think I can explain it. First, take off your shoes.After having taken out a black stone, you are right in saying that the WW box is eliminated. So, how many stones are left? 3. How many of them are black? 2. Chance of one of them being black? 2/3. Now put your shoes back on.


By this logic, if the initial boxes were WW, BW, and BBBBB - then the result would be 4/5? But it clearly should not matter how many Black stones are in the Black-only box

Why should it not matter?

The question is not what is our chance of picking a black stone to begin with. The question is about a probability AFTER WE HAVE PICKED A BLACK STONE.

See if percevals other example makes you rethink. Use WWWWW, BWWWW and BBBBB if it makes you happier (you can add any number of white stones to any of the bowls, it doesn't matter, since WE ALREADY PICKED A BLACK STONE). Or, try removing the white stones altogether: lets say we have three bowls with no stones/one black stone/five black stones and you pick a black stone - what is the probability that there are more black stones in the bowl?

_________________
Offending ad removed

Top
 Profile  
 
Offline
 Post subject: Re: well known proba problem
Post #22 Posted: Tue Feb 12, 2013 6:30 am 
Lives in gote
User avatar

Posts: 312
Liked others: 52
Was liked: 41
Rank: 7K KGS
KGS: tictac
Bantari wrote:
daal wrote:
Now that I've been told the answer, I think I can explain it. First, take off your shoes.After having taken out a black stone, you are right in saying that the WW box is eliminated. So, how many stones are left? 3. How many of them are black? 2. Chance of one of them being black? 2/3. Now put your shoes back on.


By this logic, if the initial boxes were WW, BW, and BBBBB - then the result would be 4/5? But it clearly should not matter how many Black stones are in the Black-only box... we have the same chance of picking black Stone from this box regardless of how many there are (provided there are more than 1 and all are Black.) No?


Its an excellent question.
The simple demonstration above used the fact that you have an equal chance to pick any stone.

Here you are breaking this asumption that you have an even chance to pick each stone. and we must compute carefully.

The actual chance to pick a given stone is 1/M *(1/N) where N is the number of stones in the box where the stone is and M is the numbe of boxes.
Here in my formulation M= 3 and N = 2 for each box so the proba was uniform at 1/6.

In your example, you have 1 black stone with proba 1/6 of being chosen (the one in the BW box), and 5 black stones with proba 1/3*1/5 = 1/15.

So if you know you have 1 black stone , the proba you get the one in the BW box is:
1/6/(1/6+5*(15)) = 1/(1+2) = 1/3 , so proba is indeed not modified if you add B stones in the all B stone box, but still its 2/3 :)(you got 2/3 of getting a stone in BBBBBB).

This more general formulation allows to compute proba for any number of boxes with any number of stones

[Edited for clarity and typos]

_________________
In theory, there is no difference between theory and practice. In practice, there is.


Last edited by perceval on Tue Feb 12, 2013 6:39 am, edited 2 times in total.
Top
 Profile  
 
Offline
 Post subject: Re: well known proba problem
Post #23 Posted: Tue Feb 12, 2013 6:33 am 
Gosei
User avatar

Posts: 1639
Location: Ponte Vedra
Liked others: 642
Was liked: 490
Universal go server handle: Bantari
tj86430 wrote:
Bantari wrote:
daal wrote:
Now that I've been told the answer, I think I can explain it. First, take off your shoes.After having taken out a black stone, you are right in saying that the WW box is eliminated. So, how many stones are left? 3. How many of them are black? 2. Chance of one of them being black? 2/3. Now put your shoes back on.


By this logic, if the initial boxes were WW, BW, and BBBBB - then the result would be 4/5? But it clearly should not matter how many Black stones are in the Black-only box

Why should it not matter?

The question is not what is our chance of picking a black stone to begin with. The question is about a probability AFTER WE HAVE PICKED A BLACK STONE.

See if percevals other example makes you rethink. Use WWWWW, BWWWW and BBBBB if it makes you happier (you can add any number of white stones to any of the bowls, it doesn't matter, since WE ALREADY PICKED A BLACK STONE). Or, try removing the white stones altogether: lets say we have three bowls with no stones/one black stone/five black stones and you pick a black stone - what is the probability that there are more black stones in the bowl?


It does not matter because we only draw TWO stones, and if we draw from this particular box, the second stone will be Black regardless if there is only one B left or 100 B left.

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.

_________________
- Bantari
______________________________________________
WARNING: This post might contain Opinions!!

Top
 Profile  
 
Offline
 Post subject: Re: well known proba problem
Post #24 Posted: Tue Feb 12, 2013 6:41 am 
Tengen
User avatar

Posts: 4844
Location: Mechanicsburg, PA
Liked others: 62
Was liked: 505
Rank: Wbaduk 7D
KGS: magicwand
Tygem: magicwand
Wbaduk: rlatkfkd
DGS: magicwand
OGS: magicwand
am i missing something?
it has to be 50/50
i can not understand why everyone think otherwise

_________________
"The more we think we know about
The greater the unknown"

Words by neil peart, music by geddy lee and alex lifeson

Top
 Profile  
 
Offline
 Post subject: Re: well known proba problem
Post #25 Posted: Tue Feb 12, 2013 6:43 am 
Gosei
User avatar

Posts: 1639
Location: Ponte Vedra
Liked others: 642
Was liked: 490
Universal go server handle: Bantari
perceval wrote:
Bantari wrote:
daal wrote:
Now that I've been told the answer, I think I can explain it. First, take off your shoes.After having taken out a black stone, you are right in saying that the WW box is eliminated. So, how many stones are left? 3. How many of them are black? 2. Chance of one of them being black? 2/3. Now put your shoes back on.


By this logic, if the initial boxes were WW, BW, and BBBBB - then the result would be 4/5? But it clearly should not matter how many Black stones are in the Black-only box... we have the same chance of picking black Stone from this box regardless of how many there are (provided there are more than 1 and all are Black.) No?


Its an excellent question.
The simple demonstration below used the fact that you have an equal chance to pick any stone.

Here you are broking this asumption that you have a neven chance to pick each stone.

The actual chance to pick a stone is 1/M *(1/N) where N is the number of stones in the box where the stone is and M is the numbe of boxes.
Here in my formulation M= 3 and N = 2 for each box.

In your example, you have 1 black stone with proba 1/6 of being chosen (the one in the BW box), and 5 black stones with proba 1/3*1/5 = 1/15.

So if you know you have 1 black stone , the proba you get the one in the BW box is:
1/6/(1/6+5*(15)) = 1/(1+2) = 1/3 , so proba is indeed not modified (you got 2/3 of getting a stone in BBBBBB).

This more general formulation allows to compute proba for any number of boxes with any number of stones


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

Just a general though, not really related to the above:

It seems to me that the question/answer is confused by the fact that you/people seem to care which of the two stones in the BB box has been picked, as if they were different. But for the purposes of this given problem - it does not mater which exact Black stone you picked, only if you picked one from the BB box (any of the two) or one from the BW box. The answer should have less to do with stones and more to do with boxes - since it is the CHOICE OF THE BOX which decides what the second pick will be, not necessarily the exact choice of the first B stone.

For example - if we label the the stones in boxes (B1,B2) in box BB and (B3,W1) in box BW - then why do we really care if we picked B1 or B2 and why should this distinction influence the result? As long as we picked from box BB the second pick will be a Black stone, regardless.

_________________
- Bantari
______________________________________________
WARNING: This post might contain Opinions!!

Top
 Profile  
 
Offline
 Post subject: Re: well known proba problem
Post #26 Posted: Tue Feb 12, 2013 6:58 am 
Lives in gote
User avatar

Posts: 312
Liked others: 52
Was liked: 41
Rank: 7K KGS
KGS: tictac
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.
Magicwand wrote:
am i missing something?
it has to be 50/50
i can not understand why everyone think otherwise


This problem is really magic, you have a guaranteed controversy every time you explain it :clap:

_________________
In theory, there is no difference between theory and practice. In practice, there is.

Top
 Profile  
 
Offline
 Post subject: Re: well known proba problem
Post #27 Posted: Tue Feb 12, 2013 7:00 am 
Oza
User avatar

Posts: 2414
Location: Tokyo, Japan
Liked others: 2351
Was liked: 1332
Rank: Jp 6 dan
KGS: ez4u
Bantari wrote:
tj86430 wrote:
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.

I don't know if I can explain it any more clearly than it has already been explained, but:

1. originally there are three black stones, right? (lets call them A, B and C, and let's also say that A & B are in the same bowl)
2. If 1. is correct, then you can take any one of those three with equal probability, right?
3. If 2. is correct, then there is 1/3 chance that you have taken the stone we decided to call A; 1/3 chance that you have taken B and 1/3 chance that you have taken C, right?
4. If 3. is correct, then there is 2/3 chance that there is another black in the same bowl (1/3 if you had taken A + 1/3 if you had taken B) and 1/3 chance that there is a white in the same bowl (in case you had taken C)


I dunno, its late and I am drunk, but....

The argument (and the result) you give is the same as if (after agreeing that the WW box is eliminated) you had all the stones in the same box. So, after pulling out a B stone, you are left with BBW in the box, and then indeed the chance of pulling another B is 2/3.

However - this is not the case that we have all the remaining stones in the same box. We have only one stone left in the box, and we are set on this particular box, right? Intuitively, it seems to me that this should make a difference in the result, no matter how we twist the math.

Here is what I think.

The chances are:
- either we have initially picked from the box BB - in which case the chance to pick another B stone is 100% or
- we have initially picked from box BW - in which case the chance to pick another B stone is 0%

Since the chances of initial pick from BB and BW are the same (given 3 boxes they are 33% each, but since we KNOW per the assumption we did not picked box WW, the chances are 50% each BW and BB.) Either way - given that BB and BW have the same chance of being picked - it seems to me that the result should be 50% (100% + 0% / 2)

Or am I just too drunk to think?....

If I understand this correctly, we must remember that we have done two things so far:
- Chosen a box from among BB, BW, and WW (1/3 probability for each).
- Chosen a B stone from the box (100% prob from BB, 50% prob from BW, and 0% prob from WW)
As a result, the probability that we are holding a BB box after drawing a B stone is 2/3 = 100% / (100% + 50% + 0%) and this is the probability that there is another B stone waiting inside the box we are holding.

_________________
Dave Sigaty
"Short-lived are both the praiser and the praised, and rememberer and the remembered..."
- Marcus Aurelius; Meditations, VIII 21

Top
 Profile  
 
Offline
 Post subject: Re: well known proba problem
Post #28 Posted: Tue Feb 12, 2013 7:15 am 
Gosei
User avatar

Posts: 1639
Location: Ponte Vedra
Liked others: 642
Was liked: 490
Universal go server handle: Bantari
ez4u wrote:
If I understand this correctly, we must remember that we have done two things so far:
- Chosen a box from among BB, BW, and WW (1/3 probability for each).


Not really. Since we KNOW we picked either BB or BW, we cannot say the WW enters into probability calculations.
The confusing part is - we DID NOT REALLY PICK THE BOX AT RANDOM OUT OF 3 BOXES.
We actually picked a box at random out of TWO boxes: BB and BW.

ez4u wrote:
- Chosen a B stone from the box (100% prob from BB, 50% prob from BW, and 0% prob from WW)


Disregarding the fact that we have already dismissed the box WW - what I think you are looking at here is the probability if picking a Black stone if you picked at random from the two boxes BB and BW, or something similar. And if this was the question - you might be correct, 2/3 might be the chance of picking a Black stone in such scenario.

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.

ez4u wrote:
As a result, the probability that we are holding a BB box after drawing a B stone is 2/3 = 100% / (100% + 50% + 0%) and this is the probability that there is another B stone waiting inside the box we are holding.


Hmm.... ;)

_________________
- Bantari
______________________________________________
WARNING: This post might contain Opinions!!

Top
 Profile  
 
Offline
 Post subject: Re: well known proba problem
Post #29 Posted: Tue Feb 12, 2013 7:24 am 
Oza
User avatar

Posts: 2508
Liked others: 1304
Was liked: 1128
Howsabout this. Instead of saying that we have (BB), (BW) and (WW), let's say that we have (B1 B2), (B3 W1) and (W2 W3) in the bowls. When we have taken a black stone out of one of the bowls, it was one of three possible stones - B1, B2 or B3. For two of these three possibilities the next stone will be black.

Edit - btw, I just had a huge amount of fun discussing this with my daughter - thanks!

_________________
Patience, grasshopper.

Top
 Profile  
 
Offline
 Post subject: Re: well known proba problem
Post #30 Posted: Tue Feb 12, 2013 7:32 am 
Lives in gote
User avatar

Posts: 312
Liked others: 52
Was liked: 41
Rank: 7K KGS
KGS: tictac
The root of the misunderstanding is was happen exactly when we says that the stone we picked is Black.

Bantari, What do you think of the following specification:
With the three boxes, you pick a random box, then a random stone.
If the stone is W, you put it back ,and shuffle the boxes, and retry, until you find a B stone.
Here is what can happen each time you pick a bocx +stone:
proba 1/3 : pick box BB => you will get a B stone and the remaing one will be a B one
proba 1/3 : pick box WW => you will get a W stone => retry
proba 1/6 : pick box WB and stone W=>retry
proba 1/6 : pick box WB and choose stone B =>remaining stone is W.

the only cases where the algo stops is the first and last. So whe nits stop, the proba that you have picked from BB is:
1/3/(1/3+1/6)=2/3


I think this example is clearer, now it remains to be convinced that this way of picking a box and then a B stone is equivalent to the first problem

What is different between the first problem, and this one when you get lucky and stumble on a B stone on your first try ? or let a friend do this problem and just gives you the box+ stone when he found a B one ?

_________________
In theory, there is no difference between theory and practice. In practice, there is.

Top
 Profile  
 
Offline
 Post subject: Re: well known proba problem
Post #31 Posted: Tue Feb 12, 2013 8:02 am 
Gosei

Posts: 1348
Location: Finland
Liked others: 49
Was liked: 129
Rank: FGA 7k GoR 1297
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

Top
 Profile  
 
Offline
 Post subject: Re: well known proba problem
Post #32 Posted: Tue Feb 12, 2013 8:04 am 
Gosei

Posts: 1348
Location: Finland
Liked others: 49
Was liked: 129
Rank: FGA 7k GoR 1297
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

Top
 Profile  
 
Offline
 Post subject: Re: well known proba problem
Post #33 Posted: Tue Feb 12, 2013 8:09 am 
Oza
User avatar

Posts: 2414
Location: Tokyo, Japan
Liked others: 2351
Was liked: 1332
Rank: Jp 6 dan
KGS: 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

Top
 Profile  
 
Offline
 Post subject: Re: well known proba problem
Post #34 Posted: Tue Feb 12, 2013 8:31 am 
Gosei

Posts: 1348
Location: Finland
Liked others: 49
Was liked: 129
Rank: FGA 7k GoR 1297
Here's the simulation code:

Code:
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:
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


This post by tj86430 was liked by: Magicwand
Top
 Profile  
 
Offline
 Post subject: Re: well known proba problem
Post #35 Posted: Tue Feb 12, 2013 10:15 am 
Tengen
User avatar

Posts: 4844
Location: Mechanicsburg, PA
Liked others: 62
Was liked: 505
Rank: Wbaduk 7D
KGS: magicwand
Tygem: magicwand
Wbaduk: rlatkfkd
DGS: magicwand
OGS: 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

Top
 Profile  
 
Offline
 Post subject: Re: well known proba problem
Post #36 Posted: Tue Feb 12, 2013 10:20 am 
Gosei
User avatar

Posts: 1639
Location: Ponte Vedra
Liked others: 642
Was liked: 490
Universal go server handle: 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!!

Top
 Profile  
 
Offline
 Post subject: Re: well known proba problem
Post #37 Posted: Tue Feb 12, 2013 10:27 am 
Gosei
User avatar

Posts: 1639
Location: Ponte Vedra
Liked others: 642
Was liked: 490
Universal go server handle: Bantari
tj86430 wrote:
Here's the simulation code:

Code:
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:
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!!

Top
 Profile  
 
Offline
 Post subject: Re: well known proba problem
Post #38 Posted: Tue Feb 12, 2013 10:39 am 
Lives with ko

Posts: 206
Liked others: 33
Was liked: 60
GD Posts: 248
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.

Top
 Profile  
 
Offline
 Post subject: Re: well known proba problem
Post #39 Posted: Tue Feb 12, 2013 10:53 am 
Gosei

Posts: 1348
Location: Finland
Liked others: 49
Was liked: 129
Rank: FGA 7k GoR 1297
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:

Quote:
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

Top
 Profile  
 
Offline
 Post subject: Re: well known proba problem
Post #40 Posted: Tue Feb 12, 2013 10:54 am 
Gosei

Posts: 1348
Location: Finland
Liked others: 49
Was liked: 129
Rank: FGA 7k GoR 1297
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

Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 132 posts ]  Go to page Previous  1, 2, 3, 4, 5 ... 7  Next

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group