by x0054 · 12y ago · 0 comments
girl = 0
boy = 0
do 10000 times {
child1Sex = randomSex;
child1Day = randomDay;
child2Sex = randomSex;
child2Day = randomDay;
if ( (child1Sex == "B" AND child1Day == "Tu") OR (child2Sex == "B" AND child2Day == "Tu") ) {
if (child1Sex == child2Sex){
boy++
} else {
girl++
}
}
}
print "Ratio of boys and girls is " + boy " : " + girl;It is the most counter-intuitive statistic problem I know (worse than Monty Hall), it trips everyone up at first.
No problem about the stubborness ;)
the range(0,10000) may not be correct, it might need to be 1,10000
This is really counter intuitive, the open vs. closed probability set through me off. Hey, thanks for putting up with my stubbornness!