Apple is known to ask the following question in job interviews ...posted by ericb at 2:36 PM on January 1, 2011 [13 favorites]
Microsoft is known to ask the following question in job interviews ...
I.B.M. is known to ask the following question in job interviews ...
McKinsey & Company is known to ask the following question in job interviews ...
Line 6: warning: parenthesize argument(s) for future versionposted by kenko at 4:11 PM on January 1, 2011 [3 favorites]
Line 3:in `times': no block given (LocalJumpError)
from t.rb:3
In a place full of people flipping coins, everyone only wants tails. Every person continues to flip a coin until they get a result of tails. If they get heads, they flip again. If they get tails, they stop. What is the proportion of tails to heads in the results?Or, using the other wording:
There’s a certain place where everybody flipping a coin wants tails. Therefore each person keeps flipping until they get tails; then they stop. What fraction of the flips are heads?If you take the "Well, nobody would ever have ten girls in a row" aspect out of it, but leave all the rest of the wording exactly the same, do you approach the question differently?
steambadger: If you think Landsburg is wrong then you should probably go to vegas and make big, big money using the martingale system.Not just analogous, but basically that gets to the heart of the problem in both cases.
Correct me if I'm wrong (and I may be): using a martingale system on a game with 1:1 odds (such as a coin toss) gives you an expectation of 0; that is, you won't lose any money, but you won't win any, either (or rather, your chances of winning are balance by your chances of catastrophic loss). Is this analogous to a fifty-fifty split between boys and girls
atrazine: Finally, during a real Google interview, if you bring up subtle arguments about real life live birth ratios, maximum family sizes etc it will reflect well on you. These questions are intended to be solved by people during the interview to show their thought processes, not to get totally correct answersHaving gotten these kinds of questions in the past (Microsoft doesn't do them anymore I hear, but way back when I interviewed with them in the late 90's they definitely asked those questions), the relevant part is not only getting the question right but offering up the thought processes that got you to your answer- right or wrong. If asked well and answered well it shows that you:
kafziel: This is a puzzle of logic and math. Questions of "at what point do families give up" or "but maybe this couple is more disposed towards producing girls" are missing the point. As for Landsburg's artificially small population count, that's what limits are for. That's also why the initial problem doesn't phrase it by specific population count, because that's also completely missing the point.I believe you're totally wrong here. Mathematically, Landsburg's on very solid ground, from what I can tell (and this seems to be well-corroborated by theory and by computer simulation); the answer is computable from k families, and he shows that an exact answer is actually dependent on the size of k- it's just that past a ludicrously small number of families in a tiny island nation, the answer rounds to 50% within the first several digits, and any computer or real-world simulation will come awfully close to the mathematically pure "infinite child family" abstraction.
#!/usr/bin/python
### converges to 1 as the number of families goes up
families = 1000000
import random
m=1.0
f=1.0
for i in range(families):
s=0
while not s:
if random.random()<0>0>We’ll randomly choose five graduate students in computer science from among the top ten American university departments of computer science and have them write simulations for a country starting with, say, four couples, each having one child per year and stopping when they have a boy. We’ll let this run for a simulated 30 years and then compute the fraction of girls in the population.He specifies in the comments that there are indeed only four couples having children.
Let your families get divorced and remarried if you want. Heck, let them gay marry and reproduce by artificial insemination. Let their children and grandchildren and great-grandchildren do all that too.is wrong. If there's children and grandchildren and so on down the line, and every family follows the stopping rule, then the number of families *can't* be finite. Which means the answer is 1/2.
None of that matters. As long as every family follows the stopping rule, and the number of families is finite, the expected ratio will be less than 0.5.
Please, if you think that 50% is a wrong answer, contact Google that had 50%-50% as the official right answer to this puzzle during their hiring process. Complain over there. I didn’t use this simple math problem to dismiss candidates for jobs in my company even though I fully understand why Google did. It’s a very good task to find and throw away the people who will get distracted from common sense and from simple, fundamental math arguments by noise and who will immediately start to think about complicated yet irrelevant technicalities – which is exactly what you did which is why you couldn’t work at Google but you instead work in the Academia that often supports this contrived way of thinking that is detached from the reality and everything important in it.Emphasis mine.
« Older "The design brief had at least one interesting bul... | Oakland's Turf Feinz (previous... Newer »
This thread has been archived and is closed to new comments
posted by gsteff at 2:03 PM on January 1, 2011