The manufacturer of a dairy drink wishes to compare a new formula (B) with that of the standard formula (A). Each of four judges perform a blinded taste test and report which glass he or she most enjoyed. Suppose that the two formulas are equally attractive.
Use R to find:
P[X = 2]
P[X > 2]
P[X < 4]
Binomial Probability Distribution
The manufacturer of a dairy drink wishes to compare a new formula (B) with that of the standard formula (A). Each of four judges perform a blinded taste test and report which glass he or she most enjoyed. Suppose that the two formulas are equally attractive.
Use R to find:
P[X = 2]
dbinom(x =2, size =4, prob =0.5)
[1] 0.375
Binomial Probability Distribution
The manufacturer of a dairy drink wishes to compare a new formula (B) with that of the standard formula (A). Each of four judges perform a blinded taste test and report which glass he or she most enjoyed. Suppose that the two formulas are equally attractive.
The manufacturer of a dairy drink wishes to compare a new formula (B) with that of the standard formula (A). Each of four judges perform a blinded taste test and report which glass he or she most enjoyed. Suppose that the two formulas are equally attractive.
Use R to find:
P[X < 4] = P[X \le 3]
pbinom(q =3, size =4, prob =0.5)
[1] 0.9375
Poisson Probability Distribution
We often use the Poisson distribution to model count data.
A random variable Y is said to have a Poisson probability distributioniff
p(y) = \frac{\lambda^y}{y!}e^{-\lambda}, \text{ where } y=0,1,2,..., \text{ and } \lambda > 0
If Y is a random variable with a Poisson distribution with parameter \lambda, then
We can use R to find information related to the Poisson distribution.
P[X = x]: dpois(x, lambda)
P[X \le x]: ppois(q, lambda)
P[X > x]: ppois(q, lambda, lower.tail = FALSE)
In the functions:
x or q is the value of X we are interested in
lambda is the rate of occurrence
lower.tail has two options:
TRUE (default) returns P[X \le x]
FALSE returns P[X > x]
Poisson Probability Distribution
Customers arrive at a checkout counter in a department store according to a Poisson distribution at an average of seven per hour. Use R to find the following probabilities.
No more than three customers arrive.
At least two customers arrive.
Exactly five customers arrive.
Poisson Probability Distribution
Customers arrive at a checkout counter in a department store according to a Poisson distribution at an average of seven per hour. Use R to find the following probabilities.
No more than three customers arrive.
ppois(q =3, lambda =7)
[1] 0.08176542
Poisson Probability Distribution
Customers arrive at a checkout counter in a department store according to a Poisson distribution at an average of seven per hour. Use R to find the following probabilities.
At least two customers arrive.
ppois(q =1, lambda =7, lower.tail =FALSE)
[1] 0.9927049
Poisson Probability Distribution
Customers arrive at a checkout counter in a department store according to a Poisson distribution at an average of seven per hour. Use R to find the following probabilities.
Exactly five customers arrive.
dpois(x =5, lambda =7)
[1] 0.1277167
Probability Distributions for Continuous RV
Theorem: If a continuous random variable Y has density function f(y) and a < b, then the probability that Y falls in the interval [a, b] is
P[a \le Y \le b] = \int_a^b f(y) dy.
Expected Values for Continuous RV
Expected value: The expected value of a continuous variable Y is
E[Y] = \int_{-\infty}^{\infty} y f(y) \ dy
This is the continuous version of the expected value for a discrete random variable,
E[Y] = \sum_y y p(y)
Expected Values for Continuous RV
Theorem: Let g(Y) be a function of Y; then the expected value of g(Y) is given by
E\left[ g(Y) \right] = \int_{-\infty}^{\infty} g(y) f(y) \ dy
Theorem: Let c be a constant and let g(Y), g_1(Y), g_2(Y), …, g_k(Y) be functions of a continuous random variable, Y. Then the following results hold:
An industrial psychologist has determined that it takes a worker between 9 and 15 minutes to complete a task on an automobile assembly line. If the time to complete the task is uniformly distributed over the interval 9 \le y \le 15, then determine the following probabilities:
A worker takes fewer than 13 minutes.
A worker takes at least 11 minutes.
A worker takes between 14 and 15 minutes.
Uniform Probability Distribution
An industrial psychologist has determined that it takes a worker between 9 and 15 minutes to complete a task on an automobile assembly line. If the time to complete the task is uniformly distributed over the interval 9 \le y \le 15, then determine the following probabilities:
A worker takes fewer than 13 minutes.
punif(13, 9, 15)
[1] 0.6666667
Uniform Probability Distribution
An industrial psychologist has determined that it takes a worker between 9 and 15 minutes to complete a task on an automobile assembly line. If the time to complete the task is uniformly distributed over the interval 9 \le y \le 15, then determine the following probabilities:
A worker takes at least 11 minutes.
punif(11, 9, 15, lower.tail =FALSE)
[1] 0.6666667
Uniform Probability Distribution
An industrial psychologist has determined that it takes a worker between 9 and 15 minutes to complete a task on an automobile assembly line. If the time to complete the task is uniformly distributed over the interval 9 \le y \le 15, then determine the following probabilities:
A worker takes between 14 and 15 minutes.
punif(15, 9, 15) -punif(14, 9, 15)
[1] 0.1666667
Normal Probability Distribution
Normal Distribution
Normal Probability Distribution
A random variable Y is said to have a normal distributioniff, for \sigma > 0 and -\infty < \mu < \infty,
A random variable Y is said to have a standard normal distributioniff
Y \sim N(\mu=0,\sigma=1)
The normal distribution is then simplified to
f(y) = \frac{1}{\sqrt{2\pi}} e^{-y^2/2}
Note that in all cases of the normal distribution, we assume -\infty < y < \infty.
Normal Probability Distribution
When using pnorm(), the default values for mean and sd are 0 and 1.
Thus, if we have the standard normal our R functions simplify to:
P[Z \le z]: pnorm(z)
P[Z \ge z]: pnorm(z, lower.tail = FALSE)
In the functions:
q is the z-score value of interest
lower.tail = TRUE returns P[Z \le z]
lower.tail = FALSE returns P[Z \ge z]
Normal Probability Distribution
A geneticist working for a seed company develops a new carrot for growing in heavy clay soil. After measuring 5000 of these carrots, it can be said that the carrot length, Y, is normally distributed with \mu = 11.5 cm and \sigma = 1.15 cm.
What is the probability that a carrot will be between 10 and 13 cm?
What is the probability that a carrot will be less than 9 cm?
What is the probability that a carrot will be 12 cm or larger?
Normal Probability Distribution
A geneticist working for a seed company develops a new carrot for growing in heavy clay soil. After measuring 5000 of these carrots, it can be said that the carrot length, Y, is normally distributed with \mu = 11.5 cm and \sigma = 1.15 cm.
What is the probability that a carrot will be between 10 and 13 cm?
pnorm(q =13, mean =11.5, sd =1.15) -pnorm(q =10, mean =11.5, sd =1.15)
[1] 0.807885
Normal Probability Distribution
A geneticist working for a seed company develops a new carrot for growing in heavy clay soil. After measuring 5000 of these carrots, it can be said that the carrot length, Y, is normally distributed with \mu = 11.5 cm and \sigma = 1.15 cm.
What is the probability that a carrot will be less than 9 cm?
pnorm(q =9, mean =11.5, sd =1.15)
[1] 0.01485583
Normal Probability Distribution
A geneticist working for a seed company develops a new carrot for growing in heavy clay soil. After measuring 5000 of these carrots, it can be said that the carrot length, Y, is normally distributed with \mu = 11.5 cm and \sigma = 1.15 cm.
What is the probability that a carrot will be 12 cm or larger?
pnorm(q =12, mean =11.5, sd =1.15, lower.tail =FALSE)
[1] 0.3318601
Gamma Probability Distribution
Gamma Distribution
Gamma Probability Distribution
A random variable Y is said to have a gamma distribution with parameters \alpha > 0 and \beta > 0iff,
q is the value of X we are interested in – must be in [0, 1]!
shape1 is the first shape parameter, \alpha
shape2 is the second shape parameter, \beta
lower.tail has two options:
TRUE (default) returns P[X \le x]
FALSE returns P[X \ge x]
Beta Probability Distribution
In a survey of cupcake preferences, 8 respondents liked the new cupcake flavor and 2 did not. We will model the proportion of all respondents who would like the cupcake flavor using a Beta distribution with \alpha = 8 and \beta = 2. What is the probability that:
fewer than 60% of respondents like the new flavor?
more than 90% of respondents like the new flavor?
somewhere between 70% and 90% of respondents like the new flavor?
Beta Probability Distribution
In a survey of cupcake preferences, 8 respondents liked the new cupcake flavor and 2 did not. We will model the proportion of all respondents who would like the cupcake flavor using a Beta distribution with \alpha = 8 and \beta = 2. What is the probability that:
fewer than 60% of respondents like the new flavor?
pbeta(q =0.6, shape1 =8, shape2 =2)
[1] 0.07054387
Beta Probability Distribution
In a survey of cupcake preferences, 8 respondents liked the new cupcake flavor and 2 did not. We will model the proportion of all respondents who would like the cupcake flavor using a Beta distribution with \alpha = 8 and \beta = 2. What is the probability that:
In a survey of cupcake preferences, 8 respondents liked the new cupcake flavor and 2 did not. We will model the proportion of all respondents who would like the cupcake flavor using a Beta distribution with \alpha = 8 and \beta = 2. What is the probability that:
somewhere between 70% and 90% of respondents like the new flavor?