• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • 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

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    #11
    Originally posted by NickFitz View Post
    Those xeno points are turned into zimbabwe dollars

    Comment


      #12
      Originally posted by AtW View Post
      Sounds like you ain't Google quality candidate...
      Too many variables, too little inclination.

      Comment


        #13
        Originally posted by realityhack View Post
        Too many variables, too little inclination.
        "It's better to be a pirate than to join the Navy."

        Comment


          #14
          Originally posted by AtW View Post
          Those xeno points are turned into zimbabwe dollars
          W00T!

          Maybe I should buy myself an election

          Comment


            #15
            Originally posted by joey122 View Post
            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
            Originally posted by xoggoth View Post
            Same as normal? Near 50%.
            Originally posted by Iron Condor View Post
            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.
            Originally posted by realityhack View Post
            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.
            Originally posted by AtW View Post
            Sounds like you ain't Google quality candidate...
            It seems to me that they are all Google quality.

            The final quantity sought in the question is the proportion of boys to girls. Given that:
            • The probability of a child of a given sex is 0.5 for any given pregnancy;
            • The probability of a child of a given sex is independent of the outcome of any other pregnancy;


            ...then it comes down to the same thing as people tossing a coin and stopping when it lands on heads. If x people toss a coin, then x/2 will land on heads and stop tossing, and x/2 will land on tails and continue to toss. (Ooh-er, Missis!)

            So the next cycle will be (x/2)/2 land on heads, and (x/2)/2 get tails.

            And then ((x/2)/2)/2 get heads and ((x/2)/2)/2 get tails.

            The probabilities of each outcome remain equal whatever number of iterations you choose, as no previous iteration can affect the outcome of a subsequent iteration, and no single outcome within a given iteration can affect another outcome within the same iteration. Although the value of x is halved on each iteration (and is therefore the only variable quantity), the probability of each outcome remains at 0.5 for each iteration. As the only variable is independent of the relative proportions of the outcome, it is obvious that the relative proportions will remain unaltered as the series is summed: 0.5 heads, 0.5 tails.

            I don't know if Google actually use this question (I doubt it - there's a lot of crap spread around about interview questions used by top companies) but insofar as it has any interest, it's in that by introducing the question of human reproduction it might throw people off the scent, as people have a vague feeling that it must be quite complicated if it involves something so important. This is a purely psychological thing, and given that the question can be equally well put in terms of coin-tossing, it is I suppose possible that it might be used to see if a victim can avoid being distracted by irrelevant circumstances and focus on the underlying principles.

            But to be honest, if I went for an interview at somewhere like Google and they started asking me crap like this, I'd tell them to stop pissing about and get on with it.

            Comment


              #16
              Originally posted by NickFitz
              But to be honest, if I went for an interview at somewhere like Google and they started asking me crap like this, I'd tell them to stop pissing about and get on with it.

              Comment


                #17
                Originally posted by joey122 View Post
                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
                If some couples can only produce one sex of child, the result will be more females than males in the population, unless the couple get divorced and remarry. Also, in that scenario, some couples will end up having an infinite number of female children, so some upper bound on how many females they produce needs to be defined.

                Comment


                  #18
                  Originally posted by AtW View Post

                  Sounds like you ain't Google quality candidate...
                  Why ever not? RH expressed the basic idea very clearly.
                  Work in the public sector? Read the IR35 FAQ here

                  Comment


                    #19
                    Originally posted by OwlHoot View Post
                    Why ever not? RH expressed the basic idea very clearly.
                    The don't hire chimps at Google... allegedly!

                    Comment


                      #20
                      Yeh, but it is not random but genetic on male side. In a population of 50 million say, what is to stop a woman having 96 billion girls before they get to a boy? Well, perhaps not 96 billion but one every 9 months from age 8 to age 70, that's 84 of em. Gawd, she'd have a fanny like the channel tunnel.
                      bloggoth

                      If everything isn't black and white, I say, 'Why the hell not?'
                      John Wayne (My guru, not to be confused with my beloved prophet Jeremy Clarkson)

                      Comment

                      Working...
                      X