# EXAMINE THE NORMAL DIST. USING MU=1 STD.DEV=2

# 1. Density Curve over (-5, 7)
z=seq(-5,+7, length.out=100)
f=dnorm(z,1,2)
plot(z,f)
p=.975

# 2. Quantile for P =0.975
qnorm(p)
## [1] 1.959964
# 3. Probability that one random draw will be observed in the interval (-3, 5)
pnorm(5,1,2)-pnorm(-3,1,2)
## [1] 0.9544997
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
# EXAMINE THE BINOMIAL DIST USING N=12 P=0.3

# 5.  Plot the binomial density curve over the range (0, 12). [Hint. Use x <- 0:12]

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