Probability that rolling dice that two dice sum to X New here.
I'm trying to figure out how to come up with a roll system for a game, where i want the probability of rolling N dice or rolling one dice N times and then taking the two largest outcomes, adding them together and equaling them to some value.
I'd be happy if someone could help me with either a formula, pseudocode or the likes.
Thanks.
I already tried something with binomials etc., but i'm confused about the math.
Expected result of running the aforementioned example: 70.4%
EDIT:
I might have formulated the question wrong. Instead of rolling two dies 14 times and finding the sum of the larger two equaling 12, i'd like to e.g. find the sum of the two larger dice in a roll with 14 dice that equal to 8. This might change the answer?

I assume throughout that the die used is $6$ sided.
Taking each value of $X$ separately there are $11$ possible values the 'larger sum' can take - $\{2,3,4,5,6,7,8,9,10,11,12\}$. In order to achieve $X=2$ in $n$ rolls of the die, one must roll $n$ $1$s which has a probability of $\frac1{6^n}$ of occurring. For $X=3$ one must roll a single $2$ and otherwise $1$s. The probability of this occurring is $\binom{n}{1}\frac{1}{6^n}=\frac{n}{6^n}$ because the $2$ can be rolled in any of the $n$ rolls and there are $n$ total rolls occurring with a probability of $\frac16$ of occurring. For $X=4$ one can roll any number of $2$s greater than or equal to two and otherwise roll a $1$. The probability of this occurring is equal to $\frac1{3^n}-\frac{1+n}{6^n}=\frac{2^n-n-1}{6^n}$ because this is just equal to the probability of rolling $n$ $1$s or $2$s and not rolling either all $1$s or only one $2$ ($X=2$ and $X=3$ respectively). One can continue like this to formulate every possibility up to $X=12$.
