# How to calculate the probability of at least k events each of probability m in a set of N independent trials.

I have a probability of an event $=p$. For example ($p = 0.01$). I have $N$ (say $1000$) independent trials. I seek to calculate the probability of having exactly $k$ ($k= 1 \dots N$) events of in the set.

I have that the probability of having $0$ events is $(1-p)^N$, which is to say the probability of getting no event $(1-p)$ in each of the $N$ trials.

After that I am not sure where to go. Simulations give very reasonable answers - i.e. a more or less Gaussian centered at 10 (1% of 1000 using the examples given). But I am stumped for a closed form solution.

In your example, where the probability of an individual event is small and the expected number of events is fairly small, a Poisson distribution will be a better approximation. There is a "closed form" for the cumulative distribution function so you don't have to do the sum if you have the incomplete gamma function available to you. The probability of at most $k$ events is $\frac {\Gamma(k+1,\lambda)}{k!}$ where $\lambda=Np$ is the expected number of events. The probability of exactly $k$ events is $\frac {\lambda^k}{k!}e^{-\lambda}$. The Poisson distribution becomes Gaussian as the number of expected events becomes large.
Probability of having exactly $k$ events (occurence probability $p$) out of $N$ is
$$\binom{N}{k} p^{k} (1-p)^{N-k}$$