• Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Google Interview Question - Probability

joey122

More time posting than coding
Thanks received
0
In a country in which people only want boys…
…every family continues to have children until they have a boy. If they have a girl, they have another child. If they have a boy, they stop. What is the proportion of boys to girls in the country?


Answers :D
 
It depends on how many baby girls get killed after they are born - that's what allegedly happening in China in rural areas :eek:
 
There was a chap at Yahoo! who took the ten or so pages of interview questions away with him and posted them on his blog. They weren't very happy about that :laugh

They still gave him a job, once he'd taken them down :rolleyes:

(Oh, and they don't ask idiotic questions about mythical countries or piano tuners - just sensible technical questions.)
 
Same as normal? Near 50%.

Yep. Near enough 50%.

But:

0% of families will have 2 or more Boys.

25% of families will have 2 or more Girls.

50% of families will be a single child boy family.

0% of families will be a single child girl family.


Basically the families with girls will have more girls to balance out the families that have only a single boy.
 
Last edited: 21:21
Correct, but not a full explanation.
Assuming a (very small to keep things simple) country with 100 fertile couples, assuming a 50/50 chance of having a boy or girl, and disregarding genetic abberations...

First go: 50 boys, 50 girls
then 25 boys, 25 girls
then we run into 'statistics' land with
12.5 boys, 12.5 girls, and so on.

It won't be exactly 50% outside 'statistics' land in the real world, but near as dammit, and I'm not anal enough or that bothered to work out the finer details.
 
It won't be exactly 50% outside 'statistics' land in the real world, but near as dammit, and I'm not anal enough or that bothered to work out the finer details.

Sounds like you ain't Google quality candidate...

btw, looks like you nicked my binary idea showing Xeno geek points :eyes
 

Advertisers

Back
Top