Ratio of Boys and Girls

In a country where everyone wants a boy, each family continues having babies till they have a boy. After some time, what is the proportion of boys to girls in the country? (Assuming probability of having a boy or a girl is the same)

Round off your answer to 2 decimal places and output the answer as I.xx where I is the integer part of your answer, and xx are the first 2 decimal places of the rounded off answer.

Hints
  • Solution Approach
  • Complete Solution
2609 successful submissions.
Asked In:
  • Google
Click here to jump start your coding interview preparation