11/5/2020

Top 3

  • Discrete Uniform
  • Binomial
  • Negative binomial

Discrete Uniform Distribution

-Defines a given range of disctrete values each with an equal probability of being selected

-Usefulness: Picking a random value with no bias

\({\mu = {n+1 \over 2}\quad }\) \({\quad \sigma^2 = {n^2-1 \over 12}}\)

Example: Tossing a fair dice. All values 1-6 have an equal probability of being rolled

Probability Density Function

\({P(x)=}\) \({1\over n}\) for n number of possible outcomes , \({n\in \mathbb{N}}\)

Binomial Distribution

-The probability of observing x successes in n trials with each trial having a probability of p success per trial

-Usefulness: Determining the probability of ‘x’ number of outcomes in ‘n’ identical trials

\({\mu = n \cdot p \quad }\) \({\quad \sigma^2 = n \cdot p \cdot (1-p)}\)

Example: How many times will the number six appear in 35 rolls of a fair die? A 6 can appear 0-35 times, thus we can determine the probability of each outcome occurance.

Binomial PDF

\({P(x)=}\) \({n\choose x}\) \({\cdot p^x \cdot (1-p)^ {(n-x)}}\) for x number of successes in n trials with probabilty p , for \({p \in [0,1]}\) and \({x,n\in \mathbb{N}}\)

Negative Binomial

-The probability of how many trials it will take to get r successes with each trial having an identical probability of p success.

-Usefulness: Determining the probability of it taking ‘x’ number of trials in order to get ‘r’ number of successes in identical trials with probability p.

\({\mu = {r \over p}\quad }\) \({\quad \sigma^2 = {r \cdot (1-p) \over p^2}}\)

Example: How many rolls of a die will it take to get 10 ’3’s? It can take no less than 10 rolls to get 10 ’3’s and technically you can roll the dice infinitely many times and never get 10. However, we can find the most probable number of rolls it will take. Anywhere from 10 to millions of rolls! In this case it will probably take around 54 - 55 rolls.

Negative Binomial PDF

\({P(x)=}\) \({{x-1}\choose r-1}\) \({\cdot p^r \cdot (1-p)^ {(x-r)}}\) for r number of successes in x trials with probabilty p , for \({p \in [0,1]}\) and \({r\in \mathbb{N}}\) and \({x \in [r,\infty]}\)

R code Used

## Uniform

x = data.frame(1:6,rep(1/6,6))

xax <- list(
  title = "Number on Fair Die",
  titlefont = list(family="Modern Computer Roman"),
  range = c(0.5,6.5), tickmode = 'linear', tick0 = 0, dtick = 1)

yax <- list( title = "Probability Density",
             titlefont = list(family="Modern Computer Roman"),
  range = c(0,.4))

plot_ly(x= x$X1.6,y = x$rep.1.6..6., type="scatter", 
        mode="markers", name="x")%>%
  layout(margin=list(l=10,r=10,b=10,t=50))%>%
  layout(title = "Discrete Uniform PDF", xaxis = xax, yaxis = yax )

R code Used(cont.)

## Binomial

b =data.frame(0:35, dbinom(0:35, 35, 1/6))
names(b) <- c("Number of '6's in 35 Rolls","Probability ")

ggplot(data = b, aes(b$`Number of '6's in 35 Rolls`,b$Probability )) + 
  geom_bar(stat = "identity", width = .5, fill = "blue")+theme_minimal() +
  xlab("Number of '6's in 35 Rolls")+ ylab("Probability Density")

R code Used(cont.)

## Negative Binomial

c =data.frame(10:155, dnbinom(0:145, 10, 1/6))
names(c) <- c("Number of trials to get 10 '6's" ,"Probability ")

ggplot(data = c, 
       aes(c$`Number of trials to get 10 '6's`,c$`Probability ` )) + 
  geom_point(color = "blue", size = .5) + geom_line(color = "red")+ 
  xlab("Number of trials to get 10 '6's") + 
  ylab("Probability Density")