10811 - Up the Ante
Moderator: Board moderators
I am confused with some probability here. Will stan continue to play after scoring a positive score in the kth round or higher rounds?
if we call stan's score A
isnt the answer to the question
Prob(A>0 after k rounds) + prob(A<= 0 in the kth round) * prob (A>0 in the k+1 th round) +
prob(A<=0 in the kth and (k+1)th round) * prob(A>0 in the k+2 th round) ... uptill the mth round.
but I don't seem to get the sample input
if we call stan's score A
isnt the answer to the question
Prob(A>0 after k rounds) + prob(A<= 0 in the kth round) * prob (A>0 in the k+1 th round) +
prob(A<=0 in the kth and (k+1)th round) * prob(A>0 in the k+2 th round) ... uptill the mth round.
but I don't seem to get the sample input

He will stop playing once he gets his first positive net score after playing k rounds and before the m+1 rounds.abishek wrote:I am confused with some probability here. Will stan continue to play after scoring a positive score in the kth round or higher rounds?
Did you deal with the conditional probability? I mean your formula should be modified as:abishek wrote:if we call stan's score A
isnt the answer to the question
Prob(A>0 after k rounds) + prob(A<= 0 in the kth round) * prob (A>0 in the k+1 th round) +
prob(A<=0 in the kth and (k+1)th round) * prob(A>0 in the k+2 th round) ... uptill the mth round.
Prob(A>0 in the kth round) +
prob(A<=0 in the kth round) * prob (A>0 in the k+1 th round | A<=0 in the kth round) + ...
Can someone tell me the correct output for this input?
My program outputs:
Which gives me a WA..
Code: Select all
INPUT:
5
3 4 10
1 30 1000
29 30 1000
10 11 50
1 2 2
Code: Select all
OUTPUT:
0.5835
0.9664
0.7483
0.6271
0.4898
My AC program outputs:tRipper wrote:Can someone tell me the correct output for this input?
Code: Select all
0.5835
0.9659
0.7298
0.6044
0.4898