Need help creating a single formula to find the probability of successfully rolling multiple 6-sided dice with conditions. Example question: If you roll 7 dice, what is the probability of successfully rolling a 5 or higher, at least 4 times?
Let a=7 b=5 c=4.
My goal is to plug a,b,c into a long formula and have the probability of success for the example above.
 A: Simulation. A simulation of a million 7-dice experiments in R is as follows. (At the end, the vector big contains the number of 5'5 or 6's seen on the seven dice rolled in each experiment.)
 m = 10^6;  n = 7;  big = numeric(m)
 for (i in 1:m) {
   roll = sample(1:6, n, rep=T)
   big[i] = sum(roll >= 5)  }
 mean(big >= 4)   # proportion of expts with at least four 5's or 6's
 ## 0.173095      # Approx. answer

The following relative frequency histogram summarizes the one million results. (There were 463 results out of a million with seven big results, but they are relatively too few to show on this scale.)

Exact formula. Now for a formula that gives the exact answer, based on the
Comment by @AndreNicholas.  Let $f(i, 7, 2/6) = {7 \choose i} (2/6)^i(4/6)^{7-i}$, for $i = 0, 1, \dots, 7,$ be the PDF
(or PMF, depending on text) of the Binomial distribution
based on $n = 7$ trials with success probability $p = 2/6$
on each trial. Also let $F(x, 7, 2/6) = \sum_{i=0}^x f(i, 7, 2/6)$
be the cumulative distribution function (CDF) of this binomial
distribution. You should match my notation with the notation
in your text.
In R, the function dbinom denotes the PDF and pbinom denotes the CDF.
Thus, your answer, $\sum_{i=4}^7 f(i, 7, 2/6) = 1 - F(3, 7, 2/6) = 0.1732968$
can be computed in R in two ways:
 i = 4:7; sum(dbinom(i, 7, 2/6)) 
 ## 0.1732968  # exact answer summing PDF terms
 1 - pbinom(3, 7, 2/6)
 ## 0.1732968  # exact answer using CDF

Notice that the simulation was accurate to three places.
The figure below shows a bargraph of the PDF of $Binom(7, 2/6),$
with the four probabilities that add to your answer (including the tiny probability at 7) highlighted as thick
blue bars.

