# On The Hydra Of Argos

When the Baron last met with Sir R-----, he proposed a wager which commenced with the placing of twenty black tokens and fifteen white tokens in a bag. At each turn Sir R----- was to draw a token from the bag and then put it and another of the same colour back inside until there were thirty tokens of the same colour in the bag, with the Baron winning a coin from Sir R----- if there were thirty black and Sir R----- winning ten coins from the Baron if there were thirty white.
Upon hearing these rules I recognised that they described the classic probability problem known as Pólya's Urn. I explained to the Baron that it admits a relatively simple expression that governs the likelihood that the bag contains given numbers of black and white tokens at each turn which could be used to figure the probability that he should have triumphed, but I fear that he didn't entirely grasp my point.

Now we can figure the probability that the bag contains $$b$$ black tokens and $$w$$ white tokens on the $$n^\mathrm{th}$$ turn, given that it had $$b_0$$ of the former and $$w_0$$ of the latter at the outset, with
\begin{align*} p_n(b,w) &= \frac{b-1}{b+w-1} \times p_{n-1}(b-1,w) + \frac{w-1}{b+w-1} \times p_{n-1}(b,w-1)\\ p_0\left(b_0,w_0\right) &= 1 \end{align*}
for $$b$$ no less than $$b_0$$, $$r$$ no less than $$r_0$$ and
$\left(b-b_0\right) + \left(w-w_0\right) = n$
since the number of tokens in the bag increases by exactly one at each turn, and equal to zero for all other cases.

That the terms upon the right hand side of the recurrence relation involve multiplying by the number of tokens of the colour that are increasing and dividing by the total number of tokens is highly suggestive that the probability should take the form
$p_n(b,w) = \frac{(b-1)! \times (w-1)!}{(b+w-1)!} \times f_n(b,w)$
for some function $$f_n$$, where the exclamation mark stands for the factorial of the term preceding it. Substituting this into the recurrence relation yields
\begin{align*} \tfrac{(b-1)! \times (w-1)!}{(b+w-1)!} \times f_n(b,w) &= \tfrac{b-1}{b+w-1} \times \tfrac{(b-2)! \times (w-1)!}{(b+w-2)!} \times f_{t-1}(b-1,w) + \tfrac{w-1}{b+w-1} \times \tfrac{(b-1)! \times (w-2)!}{(b+w-2)!} \times f_{t-1}(b,w-1)\\ &= \tfrac{(b-1)! \times (w-1)!}{(b+w-1)!} \times f_{t-1}(b-1,w) + \tfrac{(b-1)! \times (w-1)!}{(b+w-1)!} \times f_{t-1}(b,w-1)\\ f_n(b,w) &= f_{t-1}(b-1,w) + f_{t-1}(b,w-1) \end{align*}
with an initial condition of
$f_0\left(b_0,w_0\right) = p_0\left(b_0,w_0\right) \times \frac{\left(b_0+w_0-1\right)!}{\left(b_0-1\right)! \times \left(w_0-1\right)!} = \frac{\left(b_0+w_0-1\right)!}{\left(b_0-1\right)! \times \left(w_0-1\right)!}$
which further suggests that $$f_n$$ should take the form
$f_n(b,w) = \frac{\left(b_0+w_0-1\right)!}{\left(b_0-1\right)! \times \left(w_0-1\right)!} \times g_n(b,w)$
for some function $$g_n$$ that satisfies
\begin{align*} g_n(b,w) &= g_{t-1}(b-1,w) + g_{t-1}(b,w-1)\\ g_0\left(b_0,w_0\right) &= 1 \end{align*}
This immediately brings to mind the combination
${}^nC_r = \frac{n!}{r! \times (n-r)!}$
which is the number of ways that we can pick $$r$$ from $$n$$ objects when the order of choice is unimportant, and which satisfies
\begin{align*} {}^nC_r &= {}^{n-1}C_{r-1} + {}^{n-1}C_r\\ {}^0C_0 &= 1 \end{align*}
since $$0!$$ is equal to one and
\begin{align*} {}^{n-1}C_{r-1} + {}^{n-1}C_r &= \frac{(n-1)!}{(r-1)! \times \left((n-1)-(r-1)\right)!} + \frac{(n-1)!}{r! \times \left((n-1)-r\right)!}\\ &= \frac{(n-1)!}{(r-1)! \times (n-r)!} + \frac{(n-1)!}{r! \times (n-r-1)!}\\ &= \frac{r}{n} \times \frac{n!}{r! \times (n-r)!} + \frac{n-r}{n} \times \frac{n!}{r! \times (n-r)!}\\ &= \frac{r+n-r}{n} \times \frac{n!}{r! \times (n-r)!} = \frac{n!}{r! \times (n-r)!} = {}^nC_r \end{align*}
We might therefore suppose that
$g_n(b,w) = {}^nC_{b-b_0} = {}^{\left(b-b_0\right)+\left(w-w_0\right)}C_{b-b_0} = \frac{\left(\left(b-b_0\right)+\left(w-w_0\right)\right)!}{\left(b-b_0\right)! \times \left(w-w_0\right)!}$
and consequently
\begin{align*} f_n(b,w) &= \frac{\left(b_0+w_0-1\right)!}{\left(b_0-1\right)! \times \left(w_0-1\right)!} \times \frac{\left(\left(b-b_0\right)+\left(w-w_0\right)\right)!}{\left(b-b_0\right)! \times \left(w-w_0\right)!}\\ p_n(b, w) &= \frac{(b-1)! \times (w-1)!}{(b+w-1)!} \times \frac{\left(b_0+w_0-1\right)!}{\left(b_0-1\right)! \times \left(w_0-1\right)!} \times \frac{\left(\left(b-b_0\right)+\left(w-w_0\right)\right)!}{\left(b-b_0\right)! \times \left(w-w_0\right)!}\\ &= \frac{\left(b-1\right)!}{\left(b_0-1\right)!} \times \frac{\left(w-1\right)!}{\left(w_0-1\right)!} \times \frac{\left(b_0+w_0-1\right)!}{\left(b+w-1\right)!} \times \frac{\left(\left(b-b_0\right)+\left(w-w_0\right)\right)!}{\left(b-b_0\right)! \times \left(w-w_0\right)!} \end{align*}
To verify this formula we need only confirm that it yields the correct probabilities at the start and after the first turn of the game since the probabilities at all subsequent turns necessarily follow from those.
\begin{align*} p_0(b_0, w_0) &= \frac{\left(b_0-1\right)!}{\left(b_0-1\right)!} \times \frac{\left(w_0-1\right)!}{\left(w_0-1\right)!} \times \frac{\left(b_0+w_0-1\right)!}{\left(b_0+w_0-1\right)!} \times \frac{\left(\left(b_0-b_0\right)+\left(w_0-w_0\right)\right)!}{\left(b_0-b_0\right)! \times \left(w_0-w_0\right)!}\\ &= 1 \times 1 \times 1 \times \frac{(0+0)!}{0! \times 0!} = 1\\ p_1(b_0+1, w_0) &= \frac{\left(b_0+1-1\right)!}{\left(b_0-1\right)!} \times \frac{\left(w_0-1\right)!}{\left(w_0-1\right)!} \times \frac{\left(b_0+w_0-1\right)!}{\left(b_0+1+w_0-1\right)!} \times \frac{\left(\left(b_0+1-b_0\right)+\left(w_0-w_0\right)\right)!}{\left(b_0+1-b_0\right)! \times \left(w_0-w_0\right)!}\\ &= b_0 \times 1 \times \frac{1}{b_0 + w_0} \times \frac{(1+0)!}{1! \times 0!} = \frac{b_0}{b_0+w_0}\\ p_1(b_0, w_0+1) &= \frac{\left(b_0-1\right)!}{\left(b_0-1\right)!} \times \frac{\left(w_0+1-1\right)!}{\left(w_0-1\right)!} \times \frac{\left(b_0+w_0-1\right)!}{\left(b_0+w_0+1-1\right)!} \times \frac{\left(\left(b_0-b_0\right)+\left(w_0+1-w_0\right)\right)!}{\left(b_0-b_0\right)! \times \left(w_0+1-w_0\right)!}\\ & = 1 \times w_0 \times \frac{1}{b_0+w_0} \times \frac{(0+1)!}{0! \times 1!} = \frac{w_0}{b_0+w_0} \end{align*}
We can make the reckoning of these probabilities dramatically easier by representing them with their prime factorisations and it transpires that there's a remarkably simple trick for figuring the prime factorisations of factorials.
To clarify, first note that there are exactly $$\lfloor n \div 2 \rfloor$$ even numbers between one and $$n$$, where the oddly shaped brackets stand for the floor of the term between them, being the largest integer that is less than or equal to it. Next, there are exactly $$\lfloor n \div 4 \rfloor$$ multiples of four, $$\lfloor n \div 8 \rfloor$$ multiples of eight, and so on for each power of two. In other words, there are $$\lfloor n \div 2 \rfloor$$ numbers with at least one factor of two, $$\lfloor n \div 4 \rfloor$$ with at least two, $$\lfloor n \div 8 \rfloor$$ with at least three and so, continuing in this manner, we can figure the power of two in $$n!$$ with
$\sum_{j=1}^\infty \lfloor n \div 2^j\rfloor$
where $$\sum$$ is the summation sign. By applying this to every prime number we can write the factorisation of $$n!$$ as
$\prod_{i=1}^\infty p_i^{\sum_{j=1}^\infty \lfloor n \div p_i^j\rfloor}$
where $$\prod$$ is the product sign.
Note that we don't have to take the sums and product to infinity since we can cease the former as soon as $$p_i^j$$ is greater than $$n$$ and the latter as soon as $$p$$ exceeds it.
For example, the factorials of seven and ten have the factorisations
\begin{align*} 7! &= 2^{\lfloor 7 \div 2\rfloor + \lfloor 7 \div 4\rfloor} \times 3^{\lfloor 7 \div 3\rfloor} \times 5^{\lfloor 7 \div 5\rfloor} \times 7^{\lfloor 7 \div 7\rfloor}\\ &= 2^{3+1} \times 3^2 \times 5^1 \times 7^1\\ &= 2^4 \times 3^2 \times 5 \times 7\\ \\ 10! &= 2^{\lfloor 10 \div 2\rfloor + \lfloor10 \div 4\rfloor + \lfloor10 \div 8\rfloor} \times 3^{\lfloor 10 \div 3\rfloor + \lfloor10 \div 9\rfloor} \times 5^{\lfloor 10 \div 5\rfloor} \times 7^{\lfloor 10 \div 7\rfloor}\\ &= 2^{5+2+1} \times 3^{3+1} \times 5^2 \times 7^1\\ &= 2^8 \times 3^4 \times 5^2 \times 7 \end{align*}
We may see how easy it is to work with the factorisations of factorials by using them to calculate the number of ways that we can choose $$r$$ from $$n$$ objects, assuming that the order in which they are chosen matters, known as a permutation and defined as
${}^{n}P_r = \frac{n!}{(n-r)!} = \prod_{i=n-r+1}^n i$
We can figure the number of ways in which we can select three from ten objects using the factorisations with
\begin{align*} {}^{10}P_3 = \frac{10!}{7!} = \frac{2^8 \times 3^4 \times 5^2 \times 7}{2^4 \times 3^2 \times 5 \times 7} &= 2^{8-4} \times 3^{4-2} \times 5^{2-1} \times 7^{1-1}\\ &= 2^4 \times 3^2 \times 5^1 \times 7^0 = 16 \times 9 \times 5 \times 1 = 720 \end{align*}
which we may confirm as correct with the product form of the permutation
${}^{10}P_3 = \prod_{i=8}^{10} i = 8 \times 9 \times 10 = 720$
Whilst in this particular case the latter is rather less work than the former, when figuring large factorials the converse will generally be true.

Returning to the Baron's wager, it must be the case that he should have emerged victorious had there ever been twenty nine black tokens, and fewer than thirty white, in the bag and Sir R----- were to have picked out one of them. Since the game should then have been at an end, each such outcome would have been unrelated to the others and we can therefore simply add together their probabilities to yield the Baron's chances with
$\Pr(\text{Baron wins}) = \sum_{w=15}^{29} \frac{29}{29+w} \times p_n(29,w)$
Now the chance that there should have been twenty nine black coins and just fifteen white is given by
$p_9(29,15) = \frac{28!}{19!} \times \frac{14!}{14!} \times \frac{34!}{43!} \times \frac{\left(9+0\right)!}{9! \times 0!} = \frac{28! \times 34!}{19! \times 43!}$
Using the trick to factorise factorials yields
\begin{align*} 19! &= 2^{16} \times 3^{8} \times 5^{3} \times 7^{2} \times 11 \times 13 \times 17 \times 19\\ 28! &= 2^{25} \times 3^{13} \times 5^{6} \times 7^{4} \times 11^{2} \times 13^{2} \times 17 \times 19 \times 23\\ 34! &= 2^{32} \times 3^{15} \times 5^{7} \times 7^{4} \times 11^{3} \times 13^{2} \times 17^{2} \times 19 \times 23 \times 29 \times 31\\ 43! &= 2^{39} \times 3^{19} \times 5^{9} \times 7^{6} \times 11^{3} \times 13^{3} \times 17^{2} \times 19^{2} \times 23 \times 29 \times 31 \times 37 \times 41 \times 43 \end{align*}
and consequently
$p_9(29,15) = \frac{2^{2} \times 3 \times 5 \times 11 \times 23}{19\times 37 \times 41 \times 43}$
We can figure the likelihood that the bag contained twenty nine black tokens upon one turn should it have previously had that many on the previous turn by dividing the former's probability by the latter's
\begin{align*} \frac{p_{n+1}(b, w+1)}{p_n(b,w)} &= \frac { \frac{\left(b-1\right)!}{\left(b_0-1\right)!} \times \frac{\left(w+1-1\right)!}{\left(w_0-1\right)!} \times \frac{\left(b_0+w_0-1\right)!}{\left(b+w+1-1\right)!} \times \frac{\left(\left(b-b_0\right)+\left(w+1-w_0\right)\right)!}{\left(b-b_0\right)! \times \left(w+1-w_0\right)!} } { \frac{\left(b-1\right)!}{\left(b_0-1\right)!} \times \frac{\left(w-1\right)!}{\left(w_0-1\right)!} \times \frac{\left(b_0+w_0-1\right)!}{\left(b+w-1\right)!} \times \frac{\left(\left(b-b_0\right)+\left(w-w_0\right)\right)!}{\left(b-b_0\right)! \times \left(w-w_0\right)!} }\\ &= \frac { w! \times (b+w-1)! \times \left(w-w_0\right)! \times \left(\left(b-b_0\right)+\left(w-w_0\right)+1\right)! } { \left(w-1\right)! \times (b+w)! \times \left(w-w_0+1\right)! \times \left(\left(b-b_0\right)+\left(w-w_0\right)\right)! }\\ &= \frac{w \times \left(\left(b-b_0\right)+\left(w-w_0\right)+1\right)}{(b+w) \times \left(w-w_0+1\right)} \end{align*}
by which we can reckon the chance that there should have been twenty nine black tokens and sixteen white with
\begin{align*} p_{10}(29,16) &= \frac{15 \times \left(9+0+1\right)}{44 \times 1} \times p_9(29,15)\\ &= \frac{2 \times 3 \times 5^2}{2^2 \times 11} \times \frac{2^{2} \times 3 \times 5 \times 11 \times 23}{19\times 37 \times 41 \times 43} = \frac{2 \times 3^2 \times 5^3 \times 23}{19\times 37 \times 41 \times 43} \end{align*}
Continuing in the same fashion we find that the chances that the Baron should have amassed twenty nine black tokens whilst Sir R----- had had less than thirty were
$\begin{array}{lclcl} p_{11}(29,17) &=& \dfrac{16 \times 11}{45 \times 2} \times \dfrac{2 \times 3^2 \times 5^3 \times 23}{19 \times 37 \times 41 \times 43} &=& \dfrac{2^4 \times 5^2 \times 11 \times 23}{19 \times 37 \times 41 \times 43}\\ p_{12}(29,18) &=& \dfrac{17 \times 12}{46 \times 3} \times \dfrac{2^4 \times 5^2 \times 11 \times 23}{19 \times 37 \times 41 \times 43} &=& \dfrac{2^5 \times 5^2 \times 11 \times 17}{19 \times 37 \times 41 \times 43}\\ p_{13}(29,19) &=& \dfrac{18 \times 13}{47 \times 4} \times \dfrac{2^5 \times 5^2 \times 11 \times 17}{19 \times 37 \times 41 \times 43} &=& \dfrac{2^4 \times 3^2 \times 5^2 \times 11 \times 13 \times 17}{19 \times 37 \times 41 \times 43 \times 47}\\ p_{14}(29,20) &=& \dfrac{19 \times 14}{48 \times 5} \times \dfrac{2^4 \times 3^2 \times 5^2 \times 11 \times 13 \times 17}{19 \times 37 \times 41 \times 43 \times 47} &=& \dfrac{2 \times 3 \times 5 \times 7 \times 11 \times 13 \times 17}{37 \times 41 \times 43 \times 47}\\ p_{15}(29,21) &=& \dfrac{20 \times 15}{49 \times 6} \times \dfrac{2 \times 3 \times 5 \times 7 \times 11 \times 13 \times 17}{37 \times 41 \times 43 \times 47} &=& \dfrac{2^2 \times 3 \times 5^3 \times 11 \times 13 \times 17}{7 \times 37 \times 41 \times 43 \times 47}\\ p_{16}(29,22) &=& \dfrac{21 \times 16}{50 \times 7} \times \dfrac{2^2 \times 3 \times 5^3 \times 11 \times 13 \times 17}{7 \times 37 \times 41 \times 43 \times 47} &=& \dfrac{2^5 \times 3^2 \times 5 \times 11 \times 13 \times 17}{7 \times 37 \times 41 \times 43 \times 47}\\ p_{17}(29,23) &=& \dfrac{22 \times 17}{51 \times 8} \times \dfrac{2^5 \times 3^2 \times 5 \times 11 \times 13 \times 17}{7 \times 37 \times 41 \times 43 \times 47} &=& \dfrac{2^3 \times 3 \times 5 \times 11^2 \times 13 \times 17}{7 \times 37 \times 41 \times 43 \times 47}\\ p_{18}(29,24) &=& \dfrac{23 \times 18}{52 \times 9} \times \dfrac{2^3 \times 3 \times 5 \times 11^2 \times 13 \times 17}{7 \times 37 \times 41 \times 43 \times 47} &=& \dfrac{2^2 \times 3 \times 5 \times 11^2 \times 17 \times 23}{7 \times 37 \times 41 \times 43 \times 47}\\ p_{19}(29,25) &=& \dfrac{24 \times 19}{53 \times 10} \times \dfrac{2^2 \times 3 \times 5 \times 11^2 \times 17 \times 23}{7 \times 37 \times 41 \times 43 \times 47} &=& \dfrac{2^4 \times 3^2 \times 11^2 \times 17 \times 19 \times 23}{7 \times 37 \times 41 \times 43 \times 47 \times 53}\\ p_{20}(29,26) &=& \dfrac{25 \times 20}{54 \times 11} \times \dfrac{2^4 \times 3^2 \times 11^2 \times 17 \times 19 \times 23}{7 \times 37 \times 41 \times 43 \times 47 \times 53} &=& \dfrac{2^5 \times 5^3 \times 11 \times 17 \times 19 \times 23}{3 \times 7 \times 37 \times 41 \times 43 \times 47 \times 53}\\ p_{21}(29,27) &=& \dfrac{26 \times 21}{55 \times 12} \times \dfrac{2^5 \times 5^3 \times 11 \times 17 \times 19 \times 23}{3 \times 7 \times 37 \times 41 \times 43 \times 47 \times 53} &=& \dfrac{2^4 \times 5^2 \times 13 \times 17 \times 19 \times 23}{3 \times 37 \times 41 \times 43 \times 47 \times 53}\\ p_{22}(29,28) &=& \dfrac{27 \times 22}{56 \times 13} \times \dfrac{2^4 \times 5^2 \times 13 \times 17 \times 19 \times 23}{3 \times 37 \times 41 \times 43 \times 47 \times 53} &=& \dfrac{2^2 \times 3^2 \times 5^2 \times 11 \times 17 \times 19 \times 23}{7 \times 37 \times 41 \times 43 \times 47 \times 53}\\ p_{23}(29,29) &=& \dfrac{28 \times 23}{57 \times 14} \times \dfrac{2^2 \times 3^2 \times 5^2 \times 11 \times 17 \times 19 \times 23}{7 \times 37 \times 41 \times 43 \times 47 \times 53} &=& \dfrac{2^3 \times 3 \times 5^2 \times 11 \times 17 \times 23^2}{7 \times 37 \times 41 \times 43 \times 47 \times 53} \end{array}$
Multiplying these by the probabilities that Sir R----- should have drawn a black token at the next turn yields
$\begin{array}{lclcl} \dfrac{29}{44} \times p_9(29,15) &=& \dfrac{29}{44} \times \dfrac{2^{2} \times 3 \times 5 \times 11 \times 23}{19\times 37 \times 41 \times 43} &=& \dfrac{3 \times 5 \times 23 \times 29}{19\times 37 \times 41 \times 43}\\ \dfrac{29}{45} \times p_{10}(29,16) &=& \dfrac{29}{45} \times \dfrac{2 \times 3^2 \times 5^3 \times 23}{19\times 37 \times 41 \times 43} &=& \dfrac{2 \times 5^2 \times 23 \times 29}{19\times 37 \times 41 \times 43}\\ \dfrac{29}{46} \times p_{11}(29,17) &=& \dfrac{29}{46} \times \dfrac{2^4 \times 5^2 \times 11 \times 23}{19 \times 37 \times 41 \times 43} &=& \dfrac{2^3 \times 5^2 \times 11 \times 29}{19 \times 37 \times 41 \times 43}\\ \dfrac{29}{47} \times p_{12}(29,18) &=& \dfrac{29}{47} \times \dfrac{2^5 \times 5^2 \times 11 \times 17}{19 \times 37 \times 41 \times 43} &=& \dfrac{2^5 \times 5^2 \times 11 \times 17 \times 29}{19 \times 37 \times 41 \times 43 \times 47}\\ \dfrac{29}{48} \times p_{13}(29,19) &=& \dfrac{29}{48} \times \dfrac{2^4 \times 3^2 \times 5^2 \times 11 \times 13 \times 17}{19 \times 37 \times 41 \times 43 \times 47} &=& \dfrac{3 \times 5^2 \times 11 \times 13 \times 17 \times 29}{19 \times 37 \times 41 \times 43 \times 47}\\ \dfrac{29}{49} \times p_{14}(29,20) &=& \dfrac{29}{49} \times \dfrac{2 \times 3 \times 5 \times 7 \times 11 \times 13 \times 17}{37 \times 41 \times 43 \times 47} &=& \dfrac{2 \times 3 \times 5 \times 11 \times 13 \times 17 \times 29}{7 \times 37 \times 41 \times 43 \times 47}\\ \dfrac{29}{50} \times p_{15}(29,21) &=& \dfrac{29}{50} \times \dfrac{2^2 \times 3 \times 5^3 \times 11 \times 13 \times 17}{7 \times 37 \times 41 \times 43 \times 47} &=& \dfrac{2 \times 3 \times 5 \times 11 \times 13 \times 17 \times 29}{7 \times 37 \times 41 \times 43 \times 47}\\ \dfrac{29}{51} \times p_{16}(29,22) &=& \dfrac{29}{51} \times \dfrac{2^5 \times 3^2 \times 5 \times 11 \times 13 \times 17}{7 \times 37 \times 41 \times 43 \times 47} &=& \dfrac{2^5 \times 3 \times 5 \times 11 \times 13 \times 29}{7 \times 37 \times 41 \times 43 \times 47}\\ \dfrac{29}{52} \times p_{17}(29,23) &=& \dfrac{29}{52} \times \dfrac{2^3 \times 3 \times 5 \times 11^2 \times 13 \times 17}{7 \times 37 \times 41 \times 43 \times 47} &=& \dfrac{2 \times 3 \times 5 \times 11^2 \times 17 \times 29}{7 \times 37 \times 41 \times 43 \times 47}\\ \dfrac{29}{53} \times p_{18}(29,24) &=& \dfrac{29}{53} \times \dfrac{2^2 \times 3 \times 5 \times 11^2 \times 17 \times 23}{7 \times 37 \times 41 \times 43 \times 47} &=& \dfrac{2^2 \times 3 \times 5 \times 11^2 \times 17 \times 23 \times 29}{7 \times 37 \times 41 \times 43 \times 47 \times 53}\\ \dfrac{29}{54} \times p_{19}(29,25) &=& \dfrac{29}{54} \times \dfrac{2^4 \times 3^2 \times 11^2 \times 17 \times 19 \times 23}{7 \times 37 \times 41 \times 43 \times 47 \times 53} &=& \dfrac{2^3 \times 11^2 \times 17 \times 19 \times 23 \times 29}{3 \times 7 \times 37 \times 41 \times 43 \times 47 \times 53} \\ \dfrac{29}{55} \times p_{20}(29,26) &=& \dfrac{29}{55} \times \dfrac{2^5 \times 5^3 \times 11 \times 17 \times 19 \times 23}{3 \times 7 \times 37 \times 41 \times 43 \times 47 \times 53} &=& \dfrac{2^5 \times 5^2 \times 17 \times 19 \times 23 \times 29}{3 \times 7 \times 37 \times 41 \times 43 \times 47 \times 53}\\ \dfrac{29}{56} \times p_{21}(29,27) &=& \dfrac{29}{56} \times \dfrac{2^4 \times 5^2 \times 13 \times 17 \times 19 \times 23}{3 \times 37 \times 41 \times 43 \times 47 \times 53} &=& \dfrac{2 \times 5^2 \times 13 \times 17 \times 19 \times 23 \times 29}{3 \times 7 \times 37 \times 41 \times 43 \times 47 \times 53}\\ \dfrac{29}{57} \times p_{22}(29,28) &=& \dfrac{29}{57} \times \dfrac{2^2 \times 3^2 \times 5^2 \times 11 \times 17 \times 19 \times 23}{7 \times 37 \times 41 \times 43 \times 47 \times 53} &=& \dfrac{2^2 \times 3 \times 5^2 \times 11 \times 17 \times 23 \times 29}{7 \times 37 \times 41 \times 43 \times 47 \times 53}\\ \dfrac{29}{58} \times p_{23}(29,29) &=& \dfrac{29}{58} \times \dfrac{2^3 \times 3 \times 5^2 \times 11 \times 17 \times 23^2}{7 \times 37 \times 41 \times 43 \times 47 \times 53} &=& \dfrac{2^2 \times 3 \times 5^2 \times 11 \times 17 \times 23^2}{7 \times 37 \times 41 \times 43 \times 47 \times 53} \end{array}$
To sum these it is convenient to put them into fractions having the same denominator
$\begin{array}{lclcl} \dfrac{29}{44} \times p_9(29,15) &=& \dfrac{3^2 \times 5 \times 7 \times 23 \times 29 \times 47 \times 53}{3 \times 7 \times 19 \times 37 \times 41 \times 43 \times 47 \times 53} &=& \dfrac{523,371,555}{64,833,677,979}\\ \dfrac{29}{45} \times p_{10}(29,16) &=& \dfrac{2 \times 3 \times 5^2 \times 7 \times 23 \times 29 \times 47 \times 53}{3 \times 7 \times 19 \times 37 \times 41 \times 43 \times 47 \times 53} &=& \dfrac{1,744,571,850}{64,833,677,979}\\ \dfrac{29}{46} \times p_{11}(29,17) &=& \dfrac{2^3 \times 3 \times 5^2 \times 7 \times 11 \times 29 \times 47 \times 53}{3 \times 7 \times 19 \times 37 \times 41 \times 43 \times 47 \times 53} &=& \dfrac{3,337,441,800}{64,833,677,979}\\ \dfrac{29}{47} \times p_{12}(29,18) &=& \dfrac{2^5 \times 3 \times 5^2 \times 7 \times 11 \times 17 \times 29 \times 53}{3 \times 7 \times 19 \times 37 \times 41 \times 43 \times 47 \times 53} &=& \dfrac{4,828,639,200}{64,833,677,979}\\ \dfrac{29}{48} \times p_{13}(29,19) &=& \dfrac{3^2 \times 5^2 \times 7 \times 11 \times 13 \times 17 \times 29 \times 53}{3 \times 7 \times 19 \times 37 \times 41 \times 43 \times 47 \times 53} &=& \dfrac{5,884,904,025}{64,833,677,979}\\ \dfrac{29}{49} \times p_{14}(29,20) &=& \dfrac{2 \times 3^2 \times 5 \times 11 \times 13 \times 17 \times 19 \times 29 \times 53}{3 \times 7 \times 19 \times 37 \times 41 \times 43 \times 47 \times 53} &=& \dfrac{6,389,324,370}{64,833,677,979}\\ \dfrac{29}{50} \times p_{15}(29,21) &=& \dfrac{2 \times 3^2 \times 5 \times 11 \times 13 \times 17 \times 19 \times 29 \times 53}{3 \times 7 \times 19 \times 37 \times 41 \times 43 \times 47 \times 53} &=& \dfrac{6,389,324,370}{64,833,677,979}\\ \dfrac{29}{51} \times p_{16}(29,22) &=& \dfrac{2^5 \times 3^2 \times 5 \times 11 \times 13 \times 19 \times 29 \times 53}{3 \times 7 \times 19 \times 37 \times 41 \times 43 \times 47 \times 53} &=& \dfrac{6,013,481,760}{64,833,677,979}\\ \dfrac{29}{52} \times p_{17}(29,23) &=& \dfrac{2 \times 3^2 \times 5 \times 11^2 \times 17 \times 19 \times 29 \times 53}{3 \times 7 \times 19 \times 37 \times 41 \times 43 \times 47 \times 53} &=& \dfrac{5,406,351,390}{64,833,677,979}\\ \dfrac{29}{53} \times p_{18}(29,24) &=& \dfrac{2^2 \times 3^2 \times 5 \times 11^2 \times 17 \times 19 \times 23 \times 29}{3 \times 7 \times 19 \times 37 \times 41 \times 43 \times 47 \times 53} &=& \dfrac{4,692,304,980}{64,833,677,979}\\ \dfrac{29}{54} \times p_{19}(29,25) &=& \dfrac{2^3 \times 11^2 \times 17 \times 19^2 \times 23 \times 29}{3 \times 7 \times 19 \times 37 \times 41 \times 43 \times 47 \times 53} &=& \dfrac{3,962,390,872}{64,833,677,979}\\ \dfrac{29}{55} \times p_{20}(29,26) &=& \dfrac{2^5 \times 5^2 \times 17 \times 19^2 \times 23 \times 29}{3 \times 7 \times 19 \times 37 \times 41 \times 43 \times 47 \times 53} &=& \dfrac{3,274,703,200}{64,833,677,979}\\ \dfrac{29}{56} \times p_{21}(29,27) &=& \dfrac{2 \times 5^2 \times 13 \times 17 \times 19^2 \times 23 \times 29}{3 \times 7 \times 19 \times 37 \times 41 \times 43 \times 47 \times 53} &=& \dfrac{2,660,696,350}{64,833,677,979}\\ \dfrac{29}{57} \times p_{22}(29,28) &=& \dfrac{2^2 \times 3^2 \times 5^2 \times 11 \times 17 \times 19 \times 23 \times 29}{3 \times 7 \times 19 \times 37 \times 41 \times 43 \times 47 \times 53} &=& \dfrac{2,132,865,900}{64,833,677,979}\\ \dfrac{29}{58} \times p_{23}(29,29) &=& \dfrac{2^2 \times 3^2 \times 5^2 \times 11 \times 17 \times 19 \times 23^2}{3 \times 7 \times 19 \times 37 \times 41 \times 43 \times 47 \times 53} &=& \dfrac{1,691,583,300}{64,833,677,979} \end{array}$
and having done so we have
$\Pr(\text{Baron wins}) = \sum_{w=15}^{29} \frac{29}{29+w} \times p_n(29,w) = \frac{58,931,954,922}{64,833,677,979} =\frac{1,033,893,946}{1,137,432,947}$
The Baron's expected prize is therefore
\begin{align*} \mathrm{E}[\text{Baron's prize}] &= \Pr(\text{Baron wins}) \times 1 - \left(1-\Pr(\text{Baron wins})\right) \times 10\\ &= \Pr(\text{Baron wins} \times 11 - 10\\ &= \frac{1,033,893,946}{1,137,432,947} \times 11 - \frac{1,137,432,947}{1,137,432,947} \times 10\\ &= \frac{11,372,833,406 - 11,374,329,470}{1,137,432,947}\\ &= -\frac{1,496,064}{1,137,432,947} \end{align*}
and I should have had no qualms whatsoever in advising Sir R----- to accept the Baron's wager!
$$\Box$$