TITLE: Probability that a character kills the boss in a 3 versus 1 fight
QUESTION [19 upvotes]: In a RPG game, your three characters A, B and C fight a boss.
The boss has $1000$ hp.
The attacks are sequential: A attacks then B attacks then C attacks then A attacks again, etc.
Character A can do any integral amount of damage between $25$ and $50$ with equal probability.
Character B can do any integral amount of damage between $30$ and $70$ with equal probability.
Character C can do any integral amount of damage between $10$ and $80$ with equal probability.
Assuming that the boss is not strong enough to kill any of the characters before it dies, what is the probability that player A will be the one to deliver the final blow and kill the boss?
Same question for players B and C.
Unfortunately I don't even know how to get started on this problem, any hint would be helpful.

REPLY [4 votes]: Here is yet an other answer, targeting the exact fractions that give the needed probabilities, it combines simple combinatorics and simple coding (sage is my weapon of choice), based on the fact that there is a (very) limited amount of complete turns $N$ till the total of $1000$ points can be randomly reached.

The player $A$ wins in a situation like $(ABC)^N\;A$, i.e. there are $N$ complete turns, then $A$ plays and the total sum of points so far is for the first time $\ge 1000$. We denote by $P(A,N)$ this probability.
Similarly, $B$ wins in a situation like $(ABC)^N\; AB$, and we denote by $P(N,B)$ the corresponding probability, and $C$ wins with the remained probability, but for the check, let this be in a situation like $(ABC)^N\; ABC$, and we denote by $P(N,C)$ the corresponding probability.
Now we compute. The first one who can win is $C$, since $5(50+70+80)=1000$, but the corresponding probability
$$
P(5,C)=
{\underbrace{\left(\frac 1{26}\right)}_p\ }^5
{\underbrace{\left(\frac 1{41}\right)}_q\ }^5
{\underbrace{\left(\frac 1{79}\right)}_r\ }^5
$$
is tiny. We have denoted by $p=1/26$,$q=1/41$, $r=1/79$ the corresponding probabilities for each individual result for $A$, $B$, respectively $C$. After this warming up, let us start.

Now let $N$ be fixed (between $4$ and $15$). Consider the polynomials (possibly taken modulo $x^{1001}$):
$$
\begin{aligned}
Q_A &= p(x^{25}+\dots+x^{50})\ ,\qquad Q_A(1) =1\ ,\\
Q_B &= q(x^{30}+\dots+x^{70})\ ,\qquad Q_B(1)=1\ ,\\
Q_C &= r(x^{10}+\dots+x^{80})\ ,\qquad Q_C(1)=1\ ,\\[3mm]
%
F_A(N) &= Q_A^N\; Q_B^N\; Q_C^N\ ,\\
F_B(N) &= Q_A^{N+1}Q_B^N\; Q_C^N\ ,\\
F_C(N) &= Q_A^{N+1}\; Q_B^{N+1}\;  Q_C^N\ ,\\[3mm]
%
&\qquad\text{ and isolate relevant coefficients:}\\
F_A(N) &= \dots + a_{950} x^{950} + a_{951} x^{951} + a_{999} x^{999} + \dots\\
F_B(N) &= \dots + b_{930} x^{930} + b_{931} x^{931} + b_{999} x^{999} + \dots\\
F_C(N) &= \dots + c_{920} x^{920} + c_{921} x^{921} + c_{999} x^{999} + \dots\qquad
\ .
\end{aligned}
$$
Above, the $a$, $b$, $c$ - coefficients in some degree $k$ are probabilities to reach $k$ short before being self on fire.
Then the probability to get on or over $1000$ after turn $N$ for $A,B,C$ is respectively
$$
\begin{aligned}
P_A(N) &= 
p(a_{950} + 2a_{951}  + 3a_{952} + \dots + 25 a_{974}) 
\\
&\qquad\qquad+
( a_{975} + a_{976}+\dots+a_{999})\ ,
\\[2mm]
P_B(N) &= 
q(b_{930} + 2b_{931}  + 3b_{932} + \dots + 40 b_{969}) 
\\
&\qquad\qquad+
( b_{970} + b_{971}+\dots+b_{999})\ ,
\\[2mm]
P_C(N) &= 
r(c_{920} + 2c_{921}  + 3c_{922} + \dots + 70 a_{974}) 
\\
&\qquad\qquad+
( c_{990} + c_{991}+\dots+c_{999})\ .
\end{aligned}
$$
These sums can be calculated. Let us get the explicit fractions.
p, q, r = 1/26, 1/41, 1/71
R.<x> = PowerSeriesRing(QQ, default_prec=1001)
QA = p*sum([x^k for k in [25..50]]) 
QB = q*sum([x^k for k in [30..70]])
QC = r*sum([x^k for k in [10..80]])
Q = QA * QB * QC + O(x^1000)

def PA(N):
    QAN = Q^N + O(x^1000)
    return p * sum([ (k-949) * QAN.dict().get(k, 0) for k in [950..974]]) + \
               sum([           QAN.dict().get(k, 0) for k in [975..999]]) 
           
def PB(N):
    QBN = Q^N * QA + O(x^1000)
    return q * sum([ (k-929) * QBN.dict().get(k, 0) for k in [930..969]]) + \
               sum([           QBN.dict().get(k, 0) for k in [970..999]]) 
           
def PC(N):
    QCN = Q^N * QA * QB + O(x^1000)
    return r * sum([ (k-919) * QCN.dict().get(k, 0) for k in [920..989]]) + \
               sum([           QCN.dict().get(k, 0) for k in [990..999]]) 
           
pa = sum([PA(N) for N in [0..16]])
pb = sum([PB(N) for N in [0..16]])
pc = sum([PC(N) for N in [0..16]])

print(f"p_A &= {latex(pa)}\\\\&\\approx {pa.n(200)}\\ ,\\\\[2mm]")
print(f"p_B &= {latex(pb)}\\\\&\\approx {pb.n(200)}\\ ,\\\\[2mm]")
print(f"p_C &= {latex(pc)}\\\\&\\approx {pc.n(200)}\\ .")

Let us print the obtained values explicitly in an aligned block:
$$
\begin{aligned}
p_A &= \frac{334033901864090379613127803175076008061329503244624264537089105546493539}{1178392443307351590334920499763343901461744782823432598226397490500042752}\\&\approx 0.28346575350277151214602996031038557893379483738585896702069\ ,\\[2mm]
p_B &= \frac{6309830943686662816904113123282509708706840969580727479884347191047819}{16597076666300726624435499996666815513545701166527219693329542119718912}\\&\approx 0.38017724871382680616769939159810617375709726053541809298534\ ,\\[2mm]
p_C &= \frac{604208147014494132197561989078063573296081662711244943014511790227369}{1796329944066084741364208078907536435155098754304013107052435198932992}\\&\approx 0.33635699778340168168627064809150824730910790207872293999396\ .
\end{aligned}
$$
$\square$

A final check:
sage: pa + pb + pc
1