# How many trials until I each my desired outcome

I'll just get straight to the point; I want to know how many independent trials are required to get an outcome(?) of 10. The situation is that I have an 80% success rate and I increment x by 1, however if I fail I decrement x by 1. How many times does this have to run before I reach 10? x starts at 0.

I have no idea how to set this up and no it's not for school but for a game I play.

• What's the initial value of $x$? – user122283 Apr 5 '14 at 1:46
• x starts at 0. Ill update the question to reflect that – user1193752 Apr 5 '14 at 1:46
• Firstly, whats the initial value of $x$, secondly, understand that you can't say for certainty. you could say the expected value of how many trials are needed, but that will only be an estimation. – Oria Gruber Apr 5 '14 at 1:48
• That's good enough, a reliable estimate is all I need. I guess 95% confidence would be nice. Assuming its even required to solve this problem. – user1193752 Apr 5 '14 at 1:49
• There's an $80$% chance that $x\to x+1$, and so the chance that $x\to x+10$ is$($$(80)$%$)^{10}$, i.e., $10.73741824$%. – user122283 Apr 5 '14 at 1:49

we have a $\frac{4}{5}$ chance for $+1$ and a $\frac{1}{5}$ chance for $-1$.

So the expected value $E(x)=\frac{4}{5}-\frac{1}{5} = \frac{3}{5}$

On average, per game, we expect to win $\frac{3}{5}$. a simple calculation of $10$ divided by $\frac{3}{5}$ will give us the result which is $17$ rounded up. On average it will take $17$ tries to get to $10$.

• Thanks, it's so simple yet I couldn't set it up right. – user1193752 Apr 5 '14 at 2:00
• That's the average, didn't the OP ask the number of 'trials required', makes it sound how many trials would one need to guarantee with 100% probability. – Grid Apr 5 '14 at 2:00
• Ah it seems Grid is correct. – Oria Gruber Apr 5 '14 at 2:01
• An average is good enough. – user1193752 Apr 5 '14 at 2:01
• Then I guess I have no qualms. – Grid Apr 5 '14 at 2:02

We can't give a meaningful answer because there is no set number where this is guaranteed to occur. You could be really unlucky and get a loss 2000 times in a row. Unlikely, but possible. Furthermore, there is no number of attempts that will guarantee you a 10.

However, maybe a useful answer to you is that the -average- number of attempts will be 16.666.. if I am understanding your question correctly.

• This is true but an average is good enough. I just wanted to estimate a cost. And yes Ive failed 25 times in a row once. – user1193752 Apr 5 '14 at 2:02