Testing random
Steven D'Aprano
steve+comp.lang.python at pearwood.info
Tue Jun 16 21:36:35 EDT 2015
On Wed, 17 Jun 2015 01:45:27 +0200, Thomas 'PointedEars' Lahn wrote:
> The
> probability of only having sons is _not_ greater than that of having
> sons and one daughter or vice-versa.
Take a family of four children. We can enumerate all the possibilities,
using S for son and D for daughter, there are exactly 2**4 = 16 of them:
SSSS
SSSD
SSDS
SSDD
SDSS
SDSD
SDDS
SDDD
DSSS
DSSD
DSDS
DSDD
DDSS
DDSD
DDDS
DDDD
There is exactly 1 outcome which is "all sons", 4 outcomes which is
"three sons and one daughter", 14 outcomes which is "at least one son and
one daughter", 15 outcomes which are "at least one son", and 1 outcome is
"no sons".
If you have *two* children, those probabilities are different:
SS, SD, DS, DD
All sons: 1/4, not 1/16.
Three sons and one daughter: 0, not 4/16.
At least one son and one daughter: 2/4, not 14/16.
At least one son: 3/4, not 15/16.
No sons: 1/4, not 1/16.
With four children, it is true that the probability of these are the same:
SSSS vs SSDS
but that's not the question. The question is to compare the probability
of these:
SSSS vs (SSDS or SSSD or SDSS or DSSS)
> And for that it does _not_ matter
> how many children you have
Of course it does. Assuming the births are independent and the
probability of a boy is 1/2, the probability of having "no boys" depends
on how many children you have:
Pr(no boys, given no children) = 1
Pr(no boys, given 1 child) = 1/2
Pr(no boys, given 2 children) = 1/4
Pr(no boys, given 3 children) = 1/8
Pr(no boys, given 4 children) = 1/16
and in general:
Pr(no boys, given n children) = 1/2**n
> *because* it does _not_ matter how many
> children you had before. The probability for a boy or a girl is
> *always* the same.
That is completely irrelevant, as has been explained to you over and over
again. A little learning is a dangerous thing.
> You are _not_ due for a boy if you have many girls, and not for a girls
> if you have many boys. But that is precisely what your flawed logic is
> implying.
You are the only one talking about being "due" for a result. You are
ignoring what we are saying, ignoring the clear and detailed analysis we
have repeatedly given, ignored the simulations we have given, and keep
coming back to your arrogant *AND WRONG* accusation that we are making
the gambler's fallacy.
Time to man up and admit your mistake.
--
Steven D'Aprano
More information about the Python-list
mailing list