80 likes | 186 Views
Google/Microsoft interview. Problem 1. Estimate the weight of a 747. . Problem 1. Estimate the weight of a 747. Ok, 747 is a vehicle designed to carry people. We don’t know much about planes, but let’s think by proxy. What other large vehicles carry passengers?
E N D
Problem 1 • Estimate the weight of a 747.
Problem 1 • Estimate the weight of a 747. • Ok, 747 is a vehicle designed to carry people. We don’t know much about planes, but let’s think by proxy. What other large vehicles carry passengers? • Busses. Assume 747 = 6 buses. 4 in a row + 2 on top. Each bus ~ 60 people. So 747 ~ 360 people. Sounds about right. A bus weighs 5-10 tons. So, a 747 weighs between 6*5 and 6*10 = 30-60 tons. (43 tons, actually).
Problem 2 • In a country where couples want boys, they use the following strategy: couples have children until they have a boy, then stop. What is the ratio of boys to girls in this country?
Problem 2 • In a country where couples want boys, they use the following strategy: couples have children until they have a boy, then stop. What is the ratio of boys to girls in this country? • 1St step: get your feet wet. Play with the problem. Start with N=2 couples. You can have 2 boys. Or you can have 4 girls and then 2 boys. So, looks like all possible ratios are possible.
Problem 2 • In a country where couples want boys, they use the following strategy: couples have children until they have a boy, then stop. What is the ratio of boys to girls in this country? • 1St step: get your feet wet. Play with the problem. Start with N=2 couples. You can have 2 boys. Or you can have 4 girls and then 2 boys. So, looks like all possible ratios are possible. • Of course, each of these outcomes has its own different probability. So, we could consider all outcomes and work out the probabilities. But that would be kind of difficult…
Problem 2 • In a country where couples want boys, they use the following strategy: couples have children until they have a boy, then stop. What is the ratio of boys to girls in this country? • Alternative. Let’s go to the large N limit. Appropriate for “country”. Will simplify things. Exactly ½ couples will have boys, ½ will have girls. • First, what is easier to find, NB or NG? Of course, NB = N. So, need to focus on NG • Draw a BIG diagram.
Problem 2 Count girls: NG = N/2 + N/4 + N/8 + … = N = NB Offspring generation # 3 N/8 BBB GGG 2 BBBBBB GGGGGG N/4 BBBBBBBBBBBBB GGGGGGGGGGGGG N/2 1 N/2 couples