Skip to content

Instantly share code, notes, and snippets.

@vishal-keshav
Created February 15, 2019 10:49
Show Gist options
  • Save vishal-keshav/2115b63a981bd926c40df36b58a93360 to your computer and use it in GitHub Desktop.
Save vishal-keshav/2115b63a981bd926c40df36b58a93360 to your computer and use it in GitHub Desktop.
Distributions

Distributions

Bernoulli Distribution

A Bernoulli random variable takes 1 with probability p and 0 with probability 1-p. The distribution can be written as:

$$p(x) = p if x = 1 p(x) = 1-p if x = 0$$

Situation: Passing or failing an exam.

Multinoulli Distribution (Categorical distribution)

This is a multivariate distribution. A multinoulli random vector has all the K elements set to zero except one which is set to 1. X = [0, 0, 1, 0] for K = 4 An outcome can be any of the four, that which happens has index set to 1.

It is parametrized by K probabilities for happening of the K outcomes.

The distribution ca be written as:

$$p(x) = p1 if x = [1,0,0,0] p(x) = p2 if x = [0,1,0,0] as so on and so forth$$

Situation: Getting one of the four houses (please, not Slytherin)

Binomial Distribution

An experiment when repeated N number of times(independent of each other), each results in either success or failure, gives rise to the Binomial Distribution. A binomial random variable takes the number of successes in the N repetition. The parameter is p which represents the probability of success of each experiment.

The distribution can be written as:

$$p(x) = (N x)*(p^x)*((1-p)^(N-x)) for any x from {0,1,2,...,N}$$

Situation: In a disease breakout (the chance of being infected is p), what is the chance that out of N employees, x of them have contracted the disease.

Multinomial Distribution

When an experiment is repeated N number of times and the number of possible outcomes is K, then a Multinomial random vector [k1, k2, k3, k4] represents how many times the first event occurred(k1), how many times the second event occurred(k2) and so on and so forth. Here, the multivariate distribution is parametrized by p1,p2,p3 and p4. Each representing the probability of happening of the respective outcome.

Note: p1+p2+p3+p4 = 1 and k1+k2+k3+k4 = N

The distribution is written as:

$$p(x) = (N x1,x2,x3,x4)*(p1^x1)*(p2^x2)*(p3^x3)*(p4^x4)$$

Situation: Three friends play a game N number of times (each have their own expertise that determine their chances of winning any game). Then, what is the chance that first won N-4 games and other two won 2 games each.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment