radosr
Baruch MFE Faculty
- Joined
- 7/18/07
- Messages
- 696
- Points
- 73
The answer does involve trig functions (this I am sure about).
The asnwer I got is (1 + sin 1)/cos 1, which is around 3.41 (between 3 and 4 ). I could be wrong.
I am not going to give away my reasoning just yet.
The "random alternation" question was asked in an interview for a QR position recently.
It is a "variant" on the following (more classical) question that has been asked more than once.
Question: "You pick random numbers between 0 and 1 (uniformly at random) x_1, x_2, x_3, ..., as long as they keep decreasing x_1 > x_2 > x_3 > ... What is the expected number of numbers you pick?"
Solution: Let E(x) be the expected number of numbers you have yet to select, given that you have just selected the number x. Then
E(x) = (1-x) + integral from 0 to x of (E(y) + 1)dy ;
so E(x) = 1 + integral from 0 to x of E(y)dy.
Differentiate --> E'(x)=E(x), so E(x) = e^x (using the initial condition E(0) = 1).
Now, the expected number of numbers selected (in this decreasing fashion) is E(1) = e (since your first pick is less than 1).
Let's just say that similar ideas can be carried over to the random alternation variant, but it does get "hairy".
Best regards!
The asnwer I got is (1 + sin 1)/cos 1, which is around 3.41 (between 3 and 4 ). I could be wrong.
I am not going to give away my reasoning just yet.
The "random alternation" question was asked in an interview for a QR position recently.
It is a "variant" on the following (more classical) question that has been asked more than once.
Question: "You pick random numbers between 0 and 1 (uniformly at random) x_1, x_2, x_3, ..., as long as they keep decreasing x_1 > x_2 > x_3 > ... What is the expected number of numbers you pick?"
Solution: Let E(x) be the expected number of numbers you have yet to select, given that you have just selected the number x. Then
E(x) = (1-x) + integral from 0 to x of (E(y) + 1)dy ;
so E(x) = 1 + integral from 0 to x of E(y)dy.
Differentiate --> E'(x)=E(x), so E(x) = e^x (using the initial condition E(0) = 1).
Now, the expected number of numbers selected (in this decreasing fashion) is E(1) = e (since your first pick is less than 1).
Let's just say that similar ideas can be carried over to the random alternation variant, but it does get "hairy".
Best regards!