Probability of having $n$ dice equal to or greater than $x$ when $m$ dice are rolled I am trying to figure out how to do the math for something like this. The scenario:


*

*$n = 4$

*$x = 7$ (using d10s, where 0 = 10)

*$m = 8$


In words, if I roll 8d10 (eight 10-sided dice) what is the probability of having four dice greater than or equal to 7 (where 0 is the greateest [10])
I have seen a lot of sites which will do the calculation where $n = 1$, but I want to make $n$ a variable.
I know the probability of a 'successful' role is 4/10.
I know that I could write out all the possible combinations and count the ones that meet the criteria, but I'm sure this can be done with math.
How would you calculate this?
 A: It is so called Binomial distribution ($2$ outcomes: "$7$ to $10$" and "$1$ to $6$" with probabilities $0.4$ and $0.6$, respectively), and what you want is a binomial experiment, for which the formula is
$$_{n}C_{k}  \cdot  p^k  \cdot  (1 - p)^{n - k}$$
where


*

*$n$ is the number of trials ($8$)

*$k$ is the number of required successful trials ($4$)

*$_{n}C_{k}$ is number of combinations of $k$ elements from $n$ elements ($_8C_4 = 70$)

*$p$ is the probability of the success in one trial ($0.4$)


So you end up with the value (approximately) $0.2322432$
(I calculated it in Python with the following commands:
import itertools

p = .4
n = 8
k = 4

nCk = len(list(itertools.combinations(range(n), k)))

result = nCk * pow(p, k) * pow(1 - p, n - k)

print(result)

A: Probability (in this case) is the ratio of desired outcomes to all outcomes. Let's count desired outcomes in your particular case (and by the way we derive a general formula to compute it).
Suppose you roll 4 dice and you have a total success - on every die you get "7 to 10". How many quadruplets of numbers "1 to 10" may cause it? It is not so difficult: $4 \cdot 4 \cdot 4 \cdot 4$ or $4 ^ 4$. 
Then you roll the 4 remaining dice - but now you need a total failure - numbers 1 to 6 on every die. How many quadruplets is able to cause it? The answer is similar: $6 ^ 4$.
So for the first group of four dice to be totally successful and in the same time the second group of four dice to be totally unsuccessful - e. g. $(8, 8, 8, 8, 1, 1, 1, 1)$ - there is $4^4 \cdot 6^4$ possibilities.
But where is written that the first four dice have be successful (and in the same time the four others not)? We may select four successful dices by $_8 \mathop{C}_4 = 70$ ways. So all successful possibilities count $70 \cdot 4^4 \cdot 6^4$ which gives the result $23{.}224{.}320$.
So the general formula for the number of desired outcomes is
$$_n {\mathop{C}}_k \cdot p^k \cdot q^{n-k}$$
Note: Please don't forget to divide it by the number of all possibilities, i. e. by  $(p + q)^n$ to compute the probability.
