\(n=20\)
\(\pi = 50\% =.5\)
\(P(9 \le X \le12 | n=20, \pi =.5 )\)
plot(x = 0:20,
y = dbinom(x = 0:20,
size = 20,
prob = .5
),
type = 'h',
main = 'Binomial Distribution (n=20, p=0.5)',
ylab = 'Probability',
xlab = '# Successes',
lwd = 3
)
dbinom(x = 9:12, size = 20, prob = .5)
## [1] 0.1601791 0.1761971 0.1601791 0.1201344
sum(dbinom(x = 9:12, size = 20, prob = .5))
## [1] 0.6166897
round(x = sum(dbinom(x = 9:12, size = 20, prob = .5)),digits = 4)
## [1] 0.6167
print(round(x = sum(dbinom(x = 9:12, size = 20, prob = .5)),digits = 4))
## [1] 0.6167
Answer: 0.6167
i. Identify the distribution. This is a binomial distribution problem. The binomial distribution is used to describe the number of successes in a fixed number of trials, and here the success is defined as bulb being defective. You can think of the bulb being “special” and not necessarily bad/“failure” from a manufacturing perspective if that helps.
ii. Identify the parameters
\(n=13\)
\(\pi = 20\% =.2\)
iii. See what is the Probability Statement Required to be Solved so that you know what to compute
Let X be the count of defective bulbs.
In Words : Probability that less than 6 but more than 3 bulbs from the sample are defective.
In Math: \(P(3<X<6 | n=13, \pi =.2 )\)
iv. Compute/Evaluate
plot(x = 0:13,
y = dbinom(x = 0:13,
size = 13,
prob = .2
),
type = 'h',
main = 'Binomial Distribution (n=13, p=0.2)',
ylab = 'Probability',
xlab = '# Successes',
lwd = 3
)
dbinom(x = 4:5, size = 13, prob = .2)
## [1] 0.15354508 0.06909529
sum(dbinom(x = 4:5, size = 13, prob = .2))
## [1] 0.2226404
round(x = sum(dbinom(x = 4:5, size = 13, prob = .2)),digits = 4)
## [1] 0.2226
print(round(x = sum(dbinom(x = 4:5, size = 13, prob = .2)),digits = 4))
## [1] 0.2226
Answer: 0.2226
Poisson distribution
lamba = 4.2 X <= 3
distr <- sum( dpois(x = 0:3, lambda = 4.2))
print(distr, digits = 4)
## [1] 0.3954
Answer: 0.3954
p_less2 <- phyper(1, 6, 11, 3)
p_less2
## [1] 0.7279412
print(p_less2, digits = 4)
## [1] 0.7279
Answer: 0.7279
prob_more1 <- 1-phyper(1, 6, 19, 6)
print(prob_more1, digits = 4)
## [1] 0.4529
Answer: 0.4529
#6 The weights of steers in a herd are distributed normally. The
variance is 90,000 and the
mean steer weight is 800 lbs. Find the probability that the weight of a
randomly
selected steer is between 1040 and 1460 lbs.
pnorm1 <- pnorm(1460, mean = 800, sd = 300)
pnorm2 <- pnorm(1040, mean = 800, sd = 300)
finalpnorm <- pnorm1 - pnorm2
print(finalpnorm, digits = 4)
## [1] 0.198
Answer: 0.1980
p111 <- pnorm(111, mean = 106, sd = 4)
p103 <- pnorm(103, mean = 106, sd = 4)
finalpnorm2 <- p111 - p103
print(finalpnorm2, digits = 4)
## [1] 0.6677
Answer: 0.6677
bottom3 <- qnorm(.03, mean = 3.34, sd = .07)
bottom3
## [1] 3.208344
top3 <- qnorm(1-.03, mean = 3.34, sd = .07)
top3
## [1] 3.471656
Answer: Bottom 3% is 3.21 and top 3% is 3.47 - nails below or above these lengths in cm should be rejected
agrade <- qnorm(1-.09, mean = 75.8, sd = 8.1)
print(agrade, digits = 1)
## [1] 87
Answer: 87
q10 <-dbinom(96, 155, .61)
print(q10, digits = 4)
## [1] 0.06402
Answer: 0.0640