# binomial distrubution question
options(scipen =999 )
dbinom(11,40,0.6)
## [1] 0.00002417431
# poisson distribution questions
# question 1 :typographical errors question
# part 1: probability that a 300-page book will have no typos
dpois(0,(4*300/100))
## [1] 0.000006144212
# part 2: probability that it will have more than 5 typos
1-ppois(5,4)
## [1] 0.2148696
# part 3: probability that a book of 157 pages has no typos
dpois(0,(4*157/100))
## [1] 0.001873401
# part 4: Run simulations that confirm your analytic answer
rpois(30,4)
##  [1] 4 2 2 2 4 4 5 3 3 4 3 4 2 2 2 3 6 7 5 7 4 5 2 5 4 4 5 3 5 4
# question 2: accidents
# part 1:probability there will be more than seven accidents in this auto body shop during the month of May
1-ppois(7,4)
## [1] 0.05113362
# part 2: probability no more than three accidents will occur during the months of May and June
dpois(3,(4*2))
## [1] 0.02862614
# question 3: telephones
# part 1: probability that there will be zero calls during a one minute period.
dpois(0,2)
## [1] 0.1353353
# part 2: probability that there will be less than five calls in a one minute period
ppois(4,2)
## [1] 0.947347
# part 3: probability that there will be less than six calls in one hour
ppois(5,(2*60))
## [1] 0.00000000000000000000000000000000000000000001658476
# Normal distribution question
#part 1: what percentage of the population lives in poverty
(pnorm(10000,25000,10000))*100
## [1] 6.68072
#part 2:What percentage of the population will benefit from the law
(pnorm(30000,25000,10000) - pnorm(20000,25000,10000))*100
## [1] 38.29249
# Exponential distribution
# part 1:Probability that a randomly selected light bulb lasts between 3 and 12 months
pexp(12, 1/8) - pexp(3, 1/8)
## [1] 0.4641591
#part 2: The 95th percentile of the distribution
qexp(0.95, 1/8)
## [1] 23.96586
#part 3:The probability that a light bulb that has lasted for 10 months will last more than 25 months
pexp(25 - 10, 1/8)
## [1] 0.846645
#BETA PROBABILITY DISTRIBUTION QUESTION
# part 1: Find the mean and the variance
mean_beta<-4/(4+2);mean_beta
## [1] 0.6666667
variance_beta<-(4*2)/((4+2)^2*(4+2+1));variance_beta
## [1] 0.03174603
# part 2: The probability that at least 80% of the computers in the warehouse are sold.
1 - pbeta(0.8,4,2)
## [1] 0.26272