by sagaro · 3y ago · 0 comments
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.
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.
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.
I believe your script may require a datacenter and a scalable architecture now.