I don't know Python, but I think I know what went wrong there.
Joel Send a noteboard - 25/05/2010 11:33:18 AM
And 99.44% certain it did.
Again, don't know Python, but dual random number generators with only two outcomes are at least as old as Pascal, and I've played too much bridge not to have at least that much knowledge of probability: The only way to get 1/3 when you're essentially dealing with powers of 2 is to count the twins twice, and I think that's what's happened, precisely because we're distinguishing between coins A and B.
If you simply take T,T/ (T,x+T,T+x,T) you will, of course get 1/3. 25% of the time the "first" coin will be tails, 25% of the time the "second" will be and 25% they BOTH will be. The problem is still the same one though: Each of those "x"s can be heads or tails, so when you count "25% are T,x" you count the 12.5% that are T(1), T(2), when you count "25% are x,T" you count the 12.5% of THOSE that are T(1),T(2). There's nothing wrong with doing it that way--provided you don't then also count T,T as a group of its own totalling 25%, because then you're double counting every single such occurrence.
I just wish it was as easy to explain why "eight ever, nine never" is a bad rule for finessing a low honor (though it's valid if you're stupid enough to try the finesse IMMEDIATELY instead of playing the ace and trying to drop the queen, jack or whatever before you do the finesse. )
They are right, and you are wrong. Here is an easy way to test this.
An equivalent problem:
If someone threw a coin twice, and all you know is that at least one of those throws ended up tails, what is the probability that they got tails tails?
It is a trivial matter to write a script which performs for example a million pairs of coin throws, and then divide the number of tails tails by the number of pairs where at least one is tails. And you get 1/3.
The whole point of the problem is that order doesn't matter. If you knew the first child was a boy, then it would be fifty-fifty for the next child to be a boy. But since you don't know which one is a boy, it's 1/3 for both to be boys.
Here is the script I wrote to test this.
#!/usr/bin/env python
from random import randint
A = []
for x in xrange(100000):
A.append([randint(1,2), randint(1,2)])
c = 0
d = 0
for a in A:
if 1 in a:
c += 1
if a == [1,1]:
d +=1
print float(d)/float(c)
An equivalent problem:
If someone threw a coin twice, and all you know is that at least one of those throws ended up tails, what is the probability that they got tails tails?
It is a trivial matter to write a script which performs for example a million pairs of coin throws, and then divide the number of tails tails by the number of pairs where at least one is tails. And you get 1/3.
The whole point of the problem is that order doesn't matter. If you knew the first child was a boy, then it would be fifty-fifty for the next child to be a boy. But since you don't know which one is a boy, it's 1/3 for both to be boys.
Here is the script I wrote to test this.
#!/usr/bin/env python
from random import randint
A = []
for x in xrange(100000):
A.append([randint(1,2), randint(1,2)])
c = 0
d = 0
for a in A:
if 1 in a:
c += 1
if a == [1,1]:
d +=1
print float(d)/float(c)
Again, don't know Python, but dual random number generators with only two outcomes are at least as old as Pascal, and I've played too much bridge not to have at least that much knowledge of probability: The only way to get 1/3 when you're essentially dealing with powers of 2 is to count the twins twice, and I think that's what's happened, precisely because we're distinguishing between coins A and B.
If you simply take T,T/ (T,x+T,T+x,T) you will, of course get 1/3. 25% of the time the "first" coin will be tails, 25% of the time the "second" will be and 25% they BOTH will be. The problem is still the same one though: Each of those "x"s can be heads or tails, so when you count "25% are T,x" you count the 12.5% that are T(1), T(2), when you count "25% are x,T" you count the 12.5% of THOSE that are T(1),T(2). There's nothing wrong with doing it that way--provided you don't then also count T,T as a group of its own totalling 25%, because then you're double counting every single such occurrence.
I just wish it was as easy to explain why "eight ever, nine never" is a bad rule for finessing a low honor (though it's valid if you're stupid enough to try the finesse IMMEDIATELY instead of playing the ace and trying to drop the queen, jack or whatever before you do the finesse. )
Honorbound and honored to be Bonded to Mahtaliel Sedai
Last First in wotmania Chat
Slightly better than chocolate.
Love still can't be coerced.
Please Don't Eat the Newbies!
LoL. Be well, RAFOlk.
Last First in wotmania Chat
Slightly better than chocolate.
Love still can't be coerced.
Please Don't Eat the Newbies!
LoL. Be well, RAFOlk.
Recreational mathematics
24/05/2010 09:17:27 PM
- 1048 Views
How is boy/girl different from girl/boy?
25/05/2010 01:05:15 AM
- 887 Views
I think it has to do with sequence
25/05/2010 08:37:05 AM
- 764 Views
The problem doesn't state the sequence, so there's no reason to assume it.
25/05/2010 08:56:09 AM
- 859 Views
Faulty "logic". 2/4
25/05/2010 02:12:54 AM
- 933 Views
I was going to say.
25/05/2010 02:48:38 AM
- 784 Views
Yeah
25/05/2010 05:05:16 AM
- 740 Views
Re: Yeah
25/05/2010 09:52:58 AM
- 972 Views
I don't know Python, but I think I know what went wrong there.
25/05/2010 11:33:18 AM
- 803 Views
Re: I don't know Python, but I think I know what went wrong there.
25/05/2010 01:53:01 PM
- 954 Views
Ah, I see now; sorry.
25/05/2010 02:27:05 PM
- 759 Views
You realize this thread now contains the words "Monty" and "Python" several times, right?
26/05/2010 11:01:24 AM
- 673 Views