Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Two problems that were on my job application

Name: Anonymous 2009-07-24 22:47

After a night of wild revelry, a group of local intoxicated hoodlums stumble into a children's playground. One of these hoodlums, Phil, climbs to the middle of a spin-around carousel and his friends push the carousel so it rotates once every five seconds. Phil, who is trying not to get sick, holds a flashlight motionless in his hand.

There is a straight path running by the playground that, at its closest point, is 30 meters from the middle of the carousel. Unknown to Phil, there are two cops facing him on the path, shocked at the spectacle. One of them is standing on the path at the point closest to the carousel, while the other is standing 60 meters down the path. At approximately what speed (in meters per second) does the spot illuminated by the flashlight traverse each of the cops' bodies? State speed at the closest cop first.


A rustic village contains one million married couples and no children. Each couple has exactly one child per year. Each couple wants a girl, but also wants to minimize the number of children they have, so they will continue to have children until they have their first girl. Assume that children are equally likely to be born male or female. Let p(t) be the percentage of children that are female at the end of year t. What is p(t)? "Can't tell" is a potential answer if you don't have sufficient information.


Let's see how fast you guys can answer these.

Name: Anonymous 2009-07-25 0:11

#1

Angular velocity is 2 pi/5 radians/sec. 

First cop is 30 meters away.

Second cop is sqrt(30^2+60^2) = 67.08 meters away.

Velocity of spot at first cop = (2 pi * 30 meters/radian) * (2 pi / 5 radians / sec) = 237 meters / sec

Velocity of spot at second cop = 530 meters/sec

#2

Something to do with the central limit theorem and a truncated geometric distribution, but I hate stats and am too lazy to do it right now. :P

Name: Anonymous 2009-07-25 12:05

production rate of village = 1 child per couple per year
hence there are a great number of couples there will be equivalent children
year,population without girl,rate
1,500T,0.5
2,250T,0.75
3,125T,0.875875
approx It is p(t)=p=0.5
Large number e function approximation: Couples without girls = 1*exp(-0.5 *t)
Approximation
Resulsts may vary.

Name: Anonymous 2009-07-25 14:40

For the second one:

We only need to consider one couple since they're all independent.
For each couple, the chance of a girl being born at the Tth year is 2^-T.

After T years, the probability distribution for the number of children per couple is given by
q(k) = 2^-k if  k < T
q(T) = 2^-(T-1)

So the mean number of children per couple after T years is
(1 * 1/2 + 2* 1/4... +  (T-1) 1/2^-(T-1)) + T*2^-(T-1)
(find a nicer expression yourself).

The average number of girls among these is 1-2^-T, so divide this quantity by that series and there's your answer.

Name: Anonymous 2009-07-25 14:55

typo*
(1 * 1/2 + 2* 1/4... +  (T-1)2^-(T-1)) + T*2^-(T-1)

Name: Anonymous 2009-07-25 14:57

>A rustic village contains one million married couples and no children.

That's pretty big for a village.

Name: Anonymous 2009-07-25 14:59

Straightaway we can see that as T tends to infinity, p(T) tends to

1/ 1/(1-1/2)^2 = 1/4

Name: Anonymous 2009-07-26 10:22

Oops.
The mean number of children as T tends to infinity is
x+2x^2 + 3x^3... evaluated at x = 1/2
= x(1+2x+3x^2...) = x d/dx (x+x^2+ x^3) = x d/dx x/(1-x)
 = x d/dx (1/(1-x) - 1)
= x/(1-x)^2 = 2

So p(T) tends to 1/2 not 1/4.

Name: 4tran 2009-07-28 7:34

>>2-8
You guys are making the question a lot harder than necessary.
p(T) = 1/2 for all T [on average at least]

yr 1: half male, half female
yr 2: previous gender distribution is 1:1, and the gender distribution of newly born children is (surprise!) 1:1.  Combine these 2 sets, and the total gender distribution is still 1:1
...
yr N: rinse and repeat

Name: Anonymous 2009-07-28 10:35

oh damnit

Name: Anonymous 2009-07-28 19:11

>>9
lol, pwnt. ^_^

Name: Anonymous 2009-07-29 13:25

>>9

But it asks for p(t), not E(P(t)). The fact that it averages out to a half is unsurprising.

However the exact distribution is different, I'd be quite interested to see a proof of it's closed form (if it exists), you can obviously give a recursive definition based on a binomial distribution.

Name: Anonymous 2009-07-29 13:45

>>12
Nah he's right. Each year there are roughly equal numbers of gender born.

Name: Anonymous 2009-07-29 21:02

>>12
Well E(p(t)) is the best you're gonna get unless you have magical prophecy powers.

Name: 4tran 2009-07-29 22:24

>>12
So you want probability(%male, T)?  That's going to get gnarly

Name: Anonymous 2009-07-30 0:29

Fix t, and let Z be the random variable which is the percentage of children which are girls after time t.  Then Z = X/Y where X is the number of girls born, and Y is the total number of children born.  Let X_i be the number of girls born to couple i by time t, and Y_i the number of children born to couple i by time t. 

X_i has bernoulli distribution with P(X_i = 0) = (1/2)^t and P(X_i = 1) = 1-(1/2)^t.  So X has binomial distribution with parameters n = 1000000 and p = 1-(1/2)^t

Y_i has a truncated geometric distribution, so that P(Y_i = n) = (1/2)^n for n = 1...t-1 and P(Y_i = t) = (1/2)^{t-1}.  Then we have

P(Y = n) = \sum_{a_1+a_2+...+a_{1000000} = n, a_i < t} \left(\frac{1}{2}\right)^{a_1} \left(\frac{1}{2}\right)^{a_2} ... \left(\frac{1}{2}\right)^{a_{1000000}} + \sum_j \sum_{a_1+a_2+...+a_{1000000} = n, a_i < t, a_j = t} \left(\frac{1}{2}\right)^{a_1} \left(\frac{1}{2}\right)^{a_2} ... \left(\frac{1}{2}\right)^{a_{1000000}} + \sum_{j,k} \sum_{a_1+a_2+...+a_{1000000} = n, a_i < t, a_j = a_k = t} \left(\frac{1}{2}\right)^{a_1} \left(\frac{1}{2}\right)^{a_2} ... \left(\frac{1}{2}\right)^{a_{1000000}} + ...
= \frac{1}{2^t} \sum_{a_1+a_2+...+a_{1000000} = n, a_i < t} 1 + \frac{1}{2^{t-1}} \sum_j \sum_{a_1+a_2+...+a_{1000000} = n, a_i < t, a_j = t} 1 + ...
= \frac{1}{2^t} P(n) + \frac{1}{2^{t-1}} P(n-t) \binom{t}{1} + \frac{1}{2^{t-2}} P(n-2t) \binom{t}{2} ...

where $P(n)$ is the number of order-significant ways to partition n into 1000000 non-negative integers no larger than t-1.

(I can't wait to see how bad the TeX fails in this post.)

Name: Anonymous 2009-07-30 0:31

Hmmm, what does [eqn] do then?
P(Y = n) = \sum_{a_1+a_2+...+a_{1000000} = n, a_i < t} \left(\frac{1}{2}\right)^{a_1} \left(\frac{1}{2}\right)^{a_2} ... \left(\frac{1}{2}\right)^{a_{1000000}} + \sum_j \sum_{a_1+a_2+...+a_{1000000} = n, a_i < t, a_j = t} \left(\frac{1}{2}\right)^{a_1} \left(\frac{1}{2}\right)^{a_2} ... \left(\frac{1}{2}\right)^{a_{1000000}} + \sum_{j,k} \sum_{a_1+a_2+...+a_{1000000} = n, a_i < t, a_j = a_k = t} \left(\frac{1}{2}\right)^{a_1} \left(\frac{1}{2}\right)^{a_2} ... \left(\frac{1}{2}\right)^{a_{1000000}} + ...

= \frac{1}{2^t} \sum_{a_1+a_2+...+a_{1000000} = n, a_i < t} 1 + \frac{1}{2^{t-1}} \sum_j \sum_{a_1+a_2+...+a_{1000000} = n, a_i < t, a_j = t} 1 + ...

= \frac{1}{2^t} P(n) + \frac{1}{2^{t-1}} P(n-t) \frac{t}{1} + \frac{1}{2^{t-2}} P(n-2t) \frac{t}{2} ...


(the (t/1) and (t/2) in the last line are supposed to be binomial coefficients, since this board doesn't like the \binom command.  inb4 moar texfail.)

Name: Anonymous 2009-07-30 0:49

>>17
Not bad, actually, except for the \binom thing.

Continued:

OK, so that's fucking awful, so we'll use the central limit theorem instead.  Y will then be normal with mean equal to 1000000 * (mean of Y_i) and variance = 1000000 * (variance of Y_i).  To get the mean and variance of Y_i we do

E(Y_i) = 1 \cdot \frac{1}{2} +  2 \cdot \left(\frac{1}{2}\right)^2 + ... + (t-1) \cdot \left(\frac{1}{2}\right)^{t-1} + t \cdot \left(\frac{1}{2}\right)^{t-1} = 2-\frac{1}{2^{t-1}}

E(Y_i)^2 = 1^2 \cdot \frac{1}{2} +  2^2 \cdot \left(\frac{1}{2}\right)^2 + ... + (t-1)^2 \cdot \left(\frac{1}{2}\right)^{t-1} + t^2 \cdot \left(\frac{1}{2}\right)^{t-1} = 6-\frac{3}{2^{t-1}}-\frac{t}{2^{t-2}}

Var(Y_i) = 2^{1-2 u} \left(-2+2^u+2^{2 u}-2^{1+u} u\right)


(using mathematica for all the painful sums).  Therefore Y has a normal distribution with parameters set to what they should be based on that mess (O_o).

So, we want to find the density function (or something) of X/Y, i.e. what is P(X/Y<n) = P(X<n*Y) given a percentage n.  Since we know X <= 1000000, we can write this as a finite sum

\sum_{x=0}{1000000} P(X = x) P(Y > X/n)


and since we know the distributions of X and Y, we can evaluate this.

Name: Anonymous 2009-07-30 0:50

>>18

Oops, should be E(Y_i^2) in the second equation, and

\sum_{x=0}^{1000000} P(X = x) P(Y > X/n)


at the end.

Name: Anonymous 2009-08-02 13:52

MAYBE YOU SHOULD FIND ANOTHER JOB

Don't change these.
Name: Email:
Entire Thread Thread List