# Thread: Solving for # of attempts using known indepentant chance and cumulative chance

1. ## Solving for # of attempts using known indepentant chance and cumulative chance

In a program I am working on I am using the formula z = 1 - ((1 - x) ^ y), where 'z' is the cumulative probability of an event occurring over 'y' attempts with a 'x' percent chance of the event occurring on each individual attempt.
This works fine except I need the formula rearranged so it solves for 'y' attempt using a known 'z' and 'x'.

Appreciate any help, thanks!

2. Originally Posted by TunnelCat
In a program I am working on I am using the formula z = 1 - ((1 - x) ^ y), where 'z' is the cumulative probability of an event occurring over 'y' attempts with a 'x' percent chance of the event occurring on each individual attempt.
This works fine except I need the formula rearranged so it solves for 'y' attempt using a known 'z' and 'x'.

Appreciate any help, thanks!
z = 1 - ((1 - x) ^ y)

1 - z = (1 - x)^y

Now take "ln" of both sides and solve for "y". If (x) > 1, you need to be careful!!

3. I don't think x can be greater than 1 given that it is the probability of success on each trial.

4. Originally Posted by j-astron
I don't think x can be greater than 1 given that it is the probability of success on each trial.
The number 5% can be used as 5 or 0.05 - depending on the context of the problem (e.g. rule of 72 in interest rate calculation). I do not quite know how 'x' is expressed here.