Hacker News new | ask | show | jobs
by sagaro 1036 days ago
>I tell you I have two children, and (at least) one of them is a boy born on April 1. What probability should you assign to the event that I have two boys? If you think that is going to be too cumbersome, simply tell me whether the probability is close to 1/2 or to 1/3, or to some other simple fraction, and provide an estimate as to how close.

I am going to not heed the author's suggestion of setting up the problem correctly and use intuition:

For the week problem it was 14+13 = (7 * 4 -1) in the bottom and 13 (7*2-1) on the top.

So for a normal year (365 days), it would be (365*2 - 1)/(365*4 - 1). Close to 1/2.

2 comments

Good intuition. The answer is, indeed, (2-p)/(4-p), where p is the probability that the kid in question is born in the time period in question, ie 1/7 or 1/365, as the case may be.

So, you’re correct.

One can pump the intuition further: If you only know that there are no girls, the result is 1/3. If a boy opens the door, or you know that the older one is a boy, the result is 1/2.

So identifying one of them as the boy increases the result from 1/3 to 1/2.

By saying “one is a boy born on Tuesday”, you give some information, thus nudge the result a bit toward 1/2. Saying “one is born on 12/30”, say, you identify the kid more and nudge the result nearly all the way towards 1/2.

And indeed, if (in the formula above) we set p=1 (no identification), 1/3 results, and if we set p=0 (full identification), 1/2 results.

Quite neat.

I was lazy so I just did:

import itertools as itools

xs = [f'{i}-{j}' for i in range(30) for j in range(12)]

ys = ['b', 'g']

zs = list(itools.product(xs, ys))

boys = [z for z in zs if z[1] == 'b']

len(boys)/len(zs)

----

gives me 0.5, or 1/2.

The moral of the article is to set up your universal set correctly and do not throw out any information, now matter how irrelevant.

Now I tell you I have two children, and (at least) one of them is a boy born on April 1st, has medium-length black hair, is 4'2", interested in 5 out of 12000 available rpg games, has 8 close friends and sword-shaped fingernails.

I believe your script may require a datacenter and a scalable architecture now.

And what do you do with non-discrete attributes?
But that's exactly what you did! You just counted which fraction of all kids is boys. You threw away that this is about pairs of kids, about april 1 on which one of them has their birthday and is a boy, and we want to know the sex of the other one. You already simplified by applying symmetry reductions. You could have just done print(1/2) and proclaimed that the output was 0.5 which therefore must be the solution.
But in this case the moral of the article is exactly the opposite - if you throw out the irrelevant information the answer becomes trivial (no need for your calculations).