bM .2............
bT 22222221111111
bW .2............
Y bTh .2............
o bF .2............
u bS .2............
n bSu .2............
g gM .1............
e gT .1............
r gW .1............
gTh .1............
gF .1............
gS .1............
gSu .1............
bbbbbbbggggggg
MTWTFSSMTWTFSS
h u h u
Older
14 ones, 13 twos, 27 in total: 13/27 chance of two boys.
bM 22222221111111
bT 22222221111111
bW 22222221111111
Y bTh 22222221111111
o bF 22222221111111
u bS 22222221111111
n bSu 22222221111111
g gM 1111111.......
e gT 1111111.......
r gW 1111111.......
gTh 1111111.......
gF 1111111.......
gS 1111111.......
gSu 1111111.......
bbbbbbbggggggg
MTWTFSSMTWTFSS
h u h u
Older Assuming that the independent probabilities of a child being a boy and being born on any particular day of the week are exactly 1/2 and 1/7 respectively, what is the probability that, in families with exactly two (child × day-of-birth) pairs of which at least one is (boy × Tuesday), the other is (boy × D) for any weekday D?”posted by Tetch at 4:38 PM on May 25, 2010 [1 favorite]
1 Boy 1 X? Carry the Tuesday...*beep*
Total: Ghostbusters 2I'd better get back to you...
int boys = 0, girls = 0;
for (int i = 0; i < 1000; i++) {
int gender1 = random.Next(2), gender2 = random.Next(2);
if (gender1 == 0) {
if (gender2 == 0) {
boys++;
} else {
girls++;
}
}
}
Console.WriteLine("{0} / {1}", boys, girls);
Output: 255 / 256, i.e. 50/50int boys = 0, girls = 0;
for (int i = 0; i < 1000; i++) {
int gender1 = random.Next(2), gender2 = random.Next(2);
if (gender1 == 0 || gender2 == 0) {
if (gender2 == 0) {
boys++;
} else {
girls++;
}
}
}
Console.WriteLine("{0} / {1}", boys, girls);
Output: 517 / 209, i.e. 1/3> echo {b,g}{M,T,W,t,F,S,s}{b,g}{M,T,W,t,F,S,s} | fold -w 5 | wc -l
196> echo {b,g}{M,T,W,t,F,S,s}{b,g}{M,T,W,t,F,S,s} | fold -w 5 | grep bT | wc -l
27> echo {b,g}{M,T,W,t,F,S,s}{b,g}{M,T,W,t,F,S,s} | fold -w 5 | grep bT | grep b.b. | wc -l
13> cat | perl -l
for (1..100000000) {
$boy1 = rand() < 1/2; $tues1 = rand() < 1/7;
$boy2 = rand() < 1/2; $tues2 = rand() < 1/7;
if ( $boy1 && $tues1 or $boy2 && $tues2 ) {
$boy_tues++;
if ( $boy1 && $boy2 ) { $boy_boy++ }
}
}
print $boy_boy / $boy_tues;
0.481796652224822
Sunday 7,374 Monday 11,704 Tuesday 13,169 Wednesday 13,038 Thursday 13,013 Friday 12,664 Saturday 8,459
Or another way of stating this: when the problem says "I have two kids, one of which is a boy, what the the probability that the other is a boy", it is not the same thing as asking "my younger child is a boy, what are the chances that my older child is a boy?"posted by Rhomboid at 2:14 PM on May 26, 2010
« Older Tom Waits and Kool Keith collaborated on a song ca... | Lately, the organizations that... Newer »
This thread has been archived and is closed to new comments
posted by spiderskull at 3:32 PM on May 25, 2010