How can I calculate the probability that the third-largest of 39 nine-sided dice will be equal to 8? How would this be done mathematically?
The following is possible for example:
(two nines, one eight, rest is below 8)
(three eights, rest is below 8)
(one nine, two eights, rest is below 8)
$$\binom {39} 2 \cdot 37 \frac{7^{36}}{9^{39}}$$ choose 2 from 39 that have the value 9. That's $\binom{39}2$. Now choose one that holds 8, 37 dice left, hence 37. The rest can be anything from 1,..,7, hence $7^{36}$. Total number of cases is $9^{39}$.
Sorry for the typo, I'm typing from my phone.