Title: Assignment No. 2 Author: “Dennis Duncan” Output: html

# 1. Plot the normal density curve over the range (-5, 7).
z=seq(-5,+7, length.out=100)
f=dnorm(z,1,2)
plot(z,f)
p=.975
# 2. What is the quantile for P = 0.975?
qnorm(p)
## [1] 1.959964
# 3. What is the probability that one random draw will be observed in the interval (-3, 5)?
pnorm(5,1,2)-pnorm(-3,1,2)
## [1] 0.9544997
# 4. What is the probability that one random draw will be greater than 7?
abline(v=c(-3,5))

# 4. What is the probability that one random draw will be greater than 7?
1-pnorm(7,1,2)
## [1] 0.001349898
qnorm(p)
## [1] 1.959964
pnorm(5,1,2)-pnorm(-3,1,2)
## [1] 0.9544997
#abline(v=c(-3,5))
1-pnorm(7,1,2)
## [1] 0.001349898
x=0:12
x=seq(0,+12, length.out =13 )
y=dbinom(x,12,.3)
plot(x,y)

# 6. What is the quantile for P = 0.99?
q=.99
qbinom(.99,12,.33)
## [1] 8
# 7. What is the probability that one random draw will be observed in the interval (0,4)?

pbinom(4, 12, .3)
## [1] 0.7236555
# 8. What is the probability that one random draw will be greater than 3?

1-pbinom(3, 12, .3)
## [1] 0.5074842
# 9.  Buying 3 trucks with a $450,000 budget.
#     Avg Truck = $156,818       Std. Dev = $8,000
#     12 quotes.        Probability buys 3 trucks under $450,000?

j=seq(130000,180000,length.out = 10)
k=dnorm(j, 156818, 8000)
plot(j,k)

pnorm(150000, 156818, 8000)
## [1] 0.1970377
dbinom(3,12,0.1970377)
## [1] 0.2335216