# How do I calculate the probability of a single trial of an event that will occur at least m times in k tries?

How do I calculate the probability of a single trial p of an event that will occur at least m times in k tries?

For example I want to trigger an event at least one time (m=1) in the next 60 minutes, but I do not want the user to know when exactly. Every minute I have a chance to trigger the event with probability p=?. There are 60 minute, so k=60 tries. What should be the probability p of the event for each of this trials.

Uniform will generate a sample, but it won't calculate p.

• The various paragraphs don't seem to have much to do with each other. The title and the first paragraph are ambiguous: what does "single trial of an event" mean? The last two paragraphs seem unrelated to anything like that. Are you asking how to generate a single realization of a uniform random variable in the range $[0,60]$? – whuber Nov 16 '17 at 22:11
• I mean "Probability of success on a single trial". Go to a probabilistic calculator for let's say Binomial distribution and you will see that this exists. No, I have explicitly stated that I do not want to do it with uniform. It is because the uniform will give me in advance at which minute I should trigger the event. I want to try many times (for example 60) and be sure that after these 60 I have triggered the event 1 time. But to do that I need a probability of this happening for each of these 60 tries. – Anton Andreev Nov 17 '17 at 7:10
• Are the "triggerings" in different tries independent (so that the total number is binomial)? If so, you need $p=1$ to be sure that at least one trigger occurs. If not, it is unclear what this $p$ is used for. – Juho Kokkala Nov 17 '17 at 7:57
• OK. I agree. But then if p=1 it means that it will be triggered 60 times. I won't something less (at least one time out of 60). So the probability should be less. How to calculate p so that the event is triggered at least once and we are confident in this let's say 0.95. – Anton Andreev Nov 17 '17 at 8:46
• It still sounds exactly like you want a uniform random value in the range $[0,60]$. – whuber Nov 17 '17 at 14:15

Negative binomial? It gives you k successes in n tries(failures). You can tell it how many successes(events) you want, and then it calculates the probability that you'll get them by n time. In r it's just rnbinom(n, size, prob, mu).