# Thread: Calculating independent events with fail-success rates

1. ## Calculating independent events with fail-success rates

I'm trying to calculate two or more independent events that have a chance of either succeeding or failing.

The predecessor event has to succeed in order for the next event to be created. If the current event were to fail, the event sequence would go back by 1 event.

--------------

For example:

I'm playing a video game, and in the video game I'm a sorcerer who is able to imbue items with specific enchantments. I'm currently holding a sword that I'm going to enchant.

Each successful attempt will increment the swords damage by 1, and each unsuccessful attempt will decrement it by 1. The sword's damage will not decrease beyond it's default damage.

• I'm able to enchant the sword a maximum of 4 times.
• Level 1-4

• Each enchantment level has a specific pass/fail chance rate.
• Level 1 Enchantment - 80%

• Level 2 Enchantment - 50%

• Level 3 Enchantment - 20%

• Level 4 Enchantment - 8%

--------------

I'm able to to calculate these independent events:

Chance of success from Level 0 to 1 = 80%
Chance of success from Level 0 to 2 = 4/5 * 1/2 = 40%
Chance of success from Level 0 to 3 = 4/10 * 2/10 = 8%
Chance of success from Level 0 to 4 = 2/25 * 2/25 = 0.64%

--------------

Since you can fail a level, without going back to level 0. How would I go about adding the fail rates to the calculated succession rates?

Don't have to give me the solutions, just show me the methodology.

3. Originally Posted by hexilum
Each successful attempt will increment the swords damage by 1, and each unsuccessful attempt will decrement it by 1. The sword's damage will not decrease beyond it's default damage.

• I'm able to enchant the sword a maximum of 4 times.
• Level 1-4

• Each enchantment level has a specific pass/fail chance rate.
• Level 1 Enchantment - 80%

• Level 2 Enchantment - 50%

• Level 3 Enchantment - 20%

• Level 4 Enchantment - 8%

--------------

I'm able to to calculate these independent events:

Chance of success from Level 0 to 1 = 80%
Chance of success from Level 0 to 2 = 4/5 * 1/2 = 40%
Chance of success from Level 0 to 3 = 4/10 * 2/10 = 8%
Chance of success from Level 0 to 4 = 2/25 * 2/25 = 0.64%

--------------

Since you can fail a level, without going back to level 0. How would I go about adding the fail rates to the calculated succession rates?
I don't fully understand what you mean. Can you only attempt to enchant the sword 4 times, throughout the course of the entire game? Am I correct in understanding that you always start at level 0? Maybe you can look at it this way:

Starting at level 0, and choosing beforehand how many times you will attempt to enchant.

Choosing to enchant just once: There's an 80% chance you'll get to level 1 and a 20% chance you'll stay at level 0.

Choosing to enchant twice: There's a (0.8)(0.5) chance of reaching level 2, there's a (0.2)(0.5) + (0.8)(0.5) chance of reaching level 1, and a (0.2)(0.2) chance of staying at level 0.

Choosing to enchant three times: There's a (0.8)(0.5)(0.2) chance of reaching level 3, a (0.8)(0.5)(0.8) + (0.2)(0.5)(0.2) + (0.8)(0.5)(0.2) chance of reaching level 2, etc.

4. Originally Posted by undefined
I don't fully understand what you mean. Can you only attempt to enchant the sword 4 times, throughout the course of the entire game? Am I correct in understanding that you always start at level 0?
You can enchant the sword an infinite amount of times. You always start at level 0. Once the sword reaches level 4, you're unable to enchant it any further.

Originally Posted by undefined
Choosing to enchant twice: There's a (0.8)(0.5) chance of reaching level 2, there's a (0.2)(0.5) + (0.8)(0.5) chance of reaching level 1, and a (0.2)(0.2) chance of staying at level 0.
Can you explain this with basic steps? I don't understand why you're adding (0.2)(0.5) to (0.8)(0.5) to determine the chance of reaching level 1 with two attempts.

(Chance to fail Level 0->1)(Chance to fail Level 1->2) + (Chance to succeed Level 0->1)(Chance to succeed Level 1->2) ??

5. Originally Posted by hexilum
You can enchant the sword an infinite amount of times. You always start at level 0. Once the sword reaches level 4, you're unable to enchant it any further.

Can you explain this with basic steps? I don't understand why you're adding (0.2)(0.5) to (0.8)(0.5) to determine the chance of reaching level 1 with two attempts.

(Chance to fail Level 0->1)(Chance to fail Level 1->2) + (Chance to succeed Level 0->1)(Chance to succeed Level 1->2) ??
Looking back at your first post and my replies, I realize I made some errors. I originally read and understood the decrementing aspect, but when giving probabilities I forgot about this and instead was thinking that an unsuccessful attempt results in no change to the level. In addition, I made an error of using the probability for level 1->2 for the second enchantment attempt even in situations where the first attempt failed and therefore I should have used level 0->1 probability.

OK, let me try to redeem myself by giving revised answers.

I'm posting this now, without the revised answers, so you know what I'm up to, then in some number of minutes if you refresh the page you'll see my revised answers, might be up to 15 minutes since I'm doing some stuff.

Starting at level 0, and choosing beforehand how many times you will attempt to enchant.

Choosing to enchant just once: There's a 0.8 chance you'll get to level 1 and a 0.2 chance you'll stay at level 0.

Choosing to enchant twice: There's a (0.8)(0.5) chance you get to level 2, a (0.2)(0.8) chance of getting to level 1, and a (0.8)(0.5) + (0.2)(0.2) chance of staying at level 0.

Choosing to enchant three times: There's a (0.8)(0.5)(0.2) chance of getting to level 3, a (0.2)(0.8)(0.5) chance of getting to level 2, a (0.2)(0.2)(0.8) + (0.8)(0.5)(0.8) + (0.8)(0.5)(0.8) chance of getting to level 1, and a (0.2)(0.2)(0.2) + (0.2)(0.8)(0.5) + (0.8)(0.5)(0.2) chance of staying at level 0.

For enchanting three times, we can organize things like this, W for win and F for fail:

FFF -> 0
FFW -> 1
FWF -> 0
FWW -> 2
WFF -> 0
WFW -> 1
WWF -> 1
WWW -> 3

where the F and W strings are ordered in accordance with binary numbers.

Do things make more sense now, or should I explain more? Sorry for the mix-up earlier.

6. Thanks, will do.

7. Originally Posted by undefined
Starting at level 0, and choosing beforehand how many times you will attempt to enchant.

Choosing to enchant just once: There's a 0.8 chance you'll get to level 1 and a 0.2 chance you'll stay at level 0.
Understood.

Originally Posted by undefined
Choosing to enchant twice: There's a (0.8)(0.5) chance you get to level 2, a (0.2)(0.8) chance of getting to level 1, and a (0.8)(0.5) + (0.2)(0.2) chance of staying at level 0.
Trying to make sense of it all. Please tell me if I got the correct idea.

Starting from Level 0 with 2 enchant attempts

WW -> (0.8)(0.5) <-- Understood.
WF -> (0.8)(0.2) <-- wouldn't this be (0.8)(0.5), since there's a (0.5) chance you'll get Level 1 -> 2, and (0.5) chance you'll stay at level 1. We haven't failed the first level, so I'm confused why we're using the fail chance of the first level.
FW -> (0.2)(0.8) <-- Understood.
FF -> (0.8)(0.5) + (0.2)(0.2) <-- wouldn't this be (0.2)(0.2) instead, since there's a (0.2) chance of staying at level 0. We haven't succeeded with the first level, instead we failed Level 0->1 two times in a row.

I appreciate you helping me!

8. Originally Posted by hexilum
Understood.

Trying to make sense of it all. Please tell me if I got the correct idea.

Starting from Level 0 with 2 enchant attempts

WW -> (0.8)(0.5)
WF -> (0.8)(0.2) <-- wouldn't this be (0.8)(0.5), since there's a (0.5) chance you'll get Level 1 -> 2, and (0.5) chance you'll stay at level 1.
FW -> (0.2)(0.8)
FF -> (0.8)(0.5) + (0.2)(0.2) <-- wouldn't this be (0.2)(0.2) instead, since there's a (0.2) chance of staying at level 0 and we haven't succeeded with the first level?

FF -> level 0; probability (0.2)(0.2)
FW -> level 1; probability (0.2)(0.8)
WF -> level 0; probability (0.8)(0.5)
WW -> level 2; probability (0.8)(0.5)

So there are two ways to get level 0; we add those probabilities to get (0.2)(0.2) + (0.8)(0.5) like what I wrote above.

Note that I always wrote in order, so you won't see (0.8)(0.2) in my above post.

Another useful idea is that if you add these probabilities, you'll get 1. The sum of probabilities for all possible outcomes must equal 1. I used this as a test to see if I had made silly errors along the way.

Anyway, all of these probabilities are for when you choose the number of enchantment attempts beforehand, and then stick to what you chose. If you can decide as you're going whether or not to continue, we might not be interested in these probabilities. I offered them because I wasn't sure what probabilities you wanted, and because they illustrate the mode of thinking you will need to find these out on your own.

Hopefully you will get a good feel for these and be able to apply them to many situations.

9. Thanks

You helped me understand clearly.