News for hackers. Stuff that matters.
Re:140 Google Interview Questions by ez77 on Tuesday November 30, 2010 @05:45AM (#1953732)

  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?
Thoughts?
Re:140 Google Interview Questions by bertm on Tuesday November 30, 2010 @08:54AM (#1954065)
A good analogy for this is flipping a coin. What is the proportion of total heads to total tails if a population of people each flip a coin until they get a heads. The answer is fairly trivial, as each coin flip is independent. Given a fair coin, you would expect the answer to be near 1. You could always calculate the variance given the population size using the binomial distribution.

A more fruitful question might be: what is the average family size in a country with these birthing habits?

Re:140 Google Interview Questions by radq on Tuesday November 30, 2010 @06:30AM (#1953798)
Re:140 Google Interview Questions by jyiin on Tuesday November 30, 2010 @06:14AM (#1953776)
If we assume there's an even chance of having a boy or girl, the proportion of boys to girls is still 50/50. It's basic stats. These are independent events.
Re:140 Google Interview Questions by ez77 on Tuesday November 30, 2010 @05:49AM (#1953741)
Smart-ass, no-way-getting-an-offer answer: if we assume gender selection to be truly random, the answer may be anywhere between 0 and 1, period.
Re:140 Google Interview Questions by radq on Tuesday November 30, 2010 @06:25AM (#1953787)
> the answer may be anywhere between 0 and 1

0 and infinity, actually.

(sorry, couldn't resist)