probability_any: Find the probability of any (at least one) event happening

Description Usage Arguments Details Value Examples

View source: R/functions.R

Description

For an event that occurs with probability p, this function returns the probability of an occurrence given n repetitions. p is numeric and can be a vector.

Usage

1

Arguments

n

The number of times to repeat the event (independent)

p

The individual probability of the event happening

Details

The probability that any event p occurs with n repetitions is equal to the reciprocal of the probability that p never occurs. The probability that p never occurs with n repetitions is (1 - p) ^ n. Thus, the probability that any event p occurs after n repetitions is 1 - ( (1 - p) ^ n ).

Value

The probability of an event with the specified probability, after n repetitions

Examples

1
2
3
probability_any(1, 0.5)
probability_any(2, 0.5)
probability_any(2, c(0.5, 1/3, 0.25))

covidprobability documentation built on Feb. 11, 2021, 5:08 p.m.