Skip to content

Comment on Online executable Python solution to the Tuesday boy problemparent

Comments

Here's my attempt in python: http://pastebin.com/tSDK1uRv

the range(0,10000) may not be correct, it might need to be 1,10000

Wow, works good. I should learn python :) But yeah, you were absolutely right! It was hard for me to figure out because I was trying to find a mathematical reason for this, and I was wrong. I finally figured it out mathematically. The way you posit the problem the probability that the asked parents have another boy is (1/2)-(1/7/2).

This is really counter intuitive, the open vs. closed probability set through me off. Hey, thanks for putting up with my stubbornness!

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.