Embarassed
New member
- Joined
- Jan 29, 2023
- Messages
- 4
This should be a simple task but I'm not getting something.
So I thought I should build a row and then sum it.
A = 100, H = 10000, B = 10%, P = 80%
Average damage of 1st hit = D1 = A * P
Average damage of 2nd hit = D2 = A * P * B + A * (1 - P)
Average damage of 3rd hit = D3 = A * (P * P * B * B + (1 - P) * (1 - P) + P * (1 - P) + (1 - P) * P * B)
...
Average damage of Nth hit = DN = ?
Average damage of 1 hit is <D> = [imath]\displaystyle\sum_{n=1}^{N} \frac{D_n}N[/imath]. Then the average number of hits is H / <D>. But I got stuck with building the row and I'm pretty sure I'm going the wrong way since it should be simpler.
I could say that on the average there are 8 successful hits out of 10, then the average damage of 1 hit is [imath]\frac {A \displaystyle\sum_{n=0}^7 (1.1)^n} {10}[/imath]. But what if it's 4 hits then 1 miss then 4 hits then 1 miss? The average combo is not 8...
If you can explain me how should I approach this task, I would be grateful.
There's a game hero that attacks a monster. The hero deals 100 damage with every successful hit. The hero has a 20% chance to miss, in that case he deals 0 damage. If an attack is successful, the next successful hit deals 10% more damage. This bonus stacks: one hit is 100, next is 110, next is 121, and so on, until the hero misses. When the hero misses, he loses all the bonuses stacked from previous attacks and his next successful hit will deal 100 damage.
The monster has 10 000 health points.
What is an expected value of the number of attacks the hero needs to kill the enemy?
What is an expected value of the damage dealt with one hit?
And finally, what is an expected value of the damage dealt with one hit if monster's health points are infinite?
So I thought I should build a row and then sum it.
A = 100, H = 10000, B = 10%, P = 80%
Average damage of 1st hit = D1 = A * P
Average damage of 2nd hit = D2 = A * P * B + A * (1 - P)
Average damage of 3rd hit = D3 = A * (P * P * B * B + (1 - P) * (1 - P) + P * (1 - P) + (1 - P) * P * B)
...
Average damage of Nth hit = DN = ?
Average damage of 1 hit is <D> = [imath]\displaystyle\sum_{n=1}^{N} \frac{D_n}N[/imath]. Then the average number of hits is H / <D>. But I got stuck with building the row and I'm pretty sure I'm going the wrong way since it should be simpler.
I could say that on the average there are 8 successful hits out of 10, then the average damage of 1 hit is [imath]\frac {A \displaystyle\sum_{n=0}^7 (1.1)^n} {10}[/imath]. But what if it's 4 hits then 1 miss then 4 hits then 1 miss? The average combo is not 8...
If you can explain me how should I approach this task, I would be grateful.