Problem 3

Problem 3.a

knitr::opts_chunk$set(echo = TRUE)

#The local police department must write, on average, five tickets a day to keep department revenues at budgeted levels. Suppose the number of tickets written per day follows a Poisson distribution with a mean of 6.4 tickets per day.
#a. Find the probability that less than 6 tickets are written on a randomly selected day from this population.
#lambda = 6.4 

P_lessthan_6 <- ppois(5,6.4)
cat("Probability that less than 6 tickets are written on a randomly selected day is ",P_lessthan_6, "Or", round(P_lessthan_6*100,digits=2), "%")
## Probability that less than 6 tickets are written on a randomly selected day is  0.3837437 Or 38.37 %

Problem 3.b

knitr::opts_chunk$set(echo = TRUE)

#b. Find the probability that exactly 6 tickets are written on a randomly selected day from this population.
#lambda = 6.4 

P_equal_6 <- dpois(6,6.4)
cat("Probability that exactly 6 tickets are written on a randomly selected day ",P_equal_6, "Or", round(P_equal_6*100,digits=2), "%")
## Probability that exactly 6 tickets are written on a randomly selected day  0.1585852 Or 15.86 %

Problem 3.c

knitr::opts_chunk$set(echo = TRUE)

#Find the probability that less than six but more significant than three tickets are written from this population on a randomly selected day.
#lambda = 6.4 

P_lessthan_6 <- ppois(5,6.4)
P_upto_3 <- ppois(3,6.4)
P_lessthan6_morethan3 <- P_lessthan_6 - P_upto_3
print(P_lessthan6_morethan3)
## [1] 0.2648249
#One more method
P_equal_4 <- dpois(4,6.4)
P_equal_5 <- dpois(5,6.4)
P_lessthan6_morethan3_2 <- P_equal_4 +P_equal_5
print (P_lessthan6_morethan3_2)
## [1] 0.2648249
cat("Probability that less than six but more significant than three tickets are written is  ",P_lessthan6_morethan3, "Or", round(P_lessthan6_morethan3*100,digits=2), "%")
## Probability that less than six but more significant than three tickets are written is   0.2648249 Or 26.48 %