So you want to be a 2n-aire?
ID:
1184
DescriptionThe player starts with a prize of $1, and is asked a sequence of
n
questions. For each question, he may
- quit and keep his prize.
- answer the question.
If wrong, he quits with nothing.
If correct, the prize is doubled, and he continues with the next
question.
After the last question, he quits with his prize.
The player wants to maximize his expected prize.
Once each question is asked, the player is able to assess the
probability
p that he will be able to answer it.
For each question, we assume that
p is a random variable
uniformly distributed over the range
t .. 1.
InputThe input consists of two numbers: an integer
1 ≤ n ≤ 30, and a real 0 ≤ t ≤ 1.
OutputFor each input n and t, print the player's expected
prize, if he plays the best strategy. Output should be rounded to
three fractional digits.
Sample Test Cases| Input | Expected Output |
|---|
1 0.00001 | 1.250 |
1 0.13154 | 1.288 |
1 0.75561 | 1.756 |

Loading...
Statistics
The Tops
No Submissions