Distribution

Negative Binomial Distribution

Binomial Distribution: "I flip a fair coin 5 times. What are the chances that I get heads 0 times? 1 time? 2 times? Etc..."

Negative Binomial Distribution: I flip a fair coin 5 times. What are the chances it takes me two flips to get heads twice? How about 3 flips to get heads twice? 4 Flips? Etc..."

Characteristics of the Negative Binomial Distribution

The mean of the Negative Binomial Distribution is:

μ=rp\large \mu = \frac{r}{p}

The variance of the Negative Binomial Distribution is:

σ2=r(1p)p2\large \sigma^2 = \frac{r(1-p)}{p^2}

import numpy as np

s = np.random.negative_binomial(2, 0.5, 100000)
for i in range(1, 11):
    probability = sum(s<i) / 1000000
    print("{} coins flipped, probability of success: {:.4f}%".format(i, probability * 100))

Geometric and Negative Binomial Distributions

The Geometric Distribution is a discrete probability distribution that helps us calculate the probability distribution of repeated independent events.

Poisson Distribution

The Poisson Distribution lets us ask how likely any given number of events are over a set interval of time.

Sample Question 1

An average of 20 customers walk into a store in a given hour. What is the probability that 25 customers walks into a store in the next hour?

Sample Question 2

A police officer pulls over an average of 3 people for speeding violations per shift. What is the probability that the officer will pull over two people for speeding violations during their next shift?

Exponential Distribution

The Exponential Distribution describes the probability distribution of the amount of time it may take before an event occurs. In a way, it solves the inverse of the problem solves by the Poisson Distribution.

The Exponential Distribution lets us ask how likely the length of an interval of time is before an event occurs exactly once.

Sampling

Last updated