Suppose for each price x (in dollars), the daily demand Y for a new tropical juice at a local store has a normal distribution with a mean \[ \mu_{Y}\mid_{x} = \mu_{Y}(x) = 52-6x\] and variance \[(\sigma^{2}) = 16\].

  1. What is the mean demand quantity when the price is set at $3?
Mean_demand_quantity<- 52 - (6*(3))
Mean_demand_quantity
## [1] 34
  1. At that price, what is the probability that we would see a demand for at least 40 units of this new juice?
Probability_demand_greater_than_40<-1 - pnorm(40, mean = 34, sd = 4)
Probability_demand_greater_than_40
## [1] 0.0668072
  1. Give an estimate of (b) based on 3,000 simulated data points generated from the conditional distribution of daily demands when the juice is priced at $3.
set.seed(15)

Sample<-rnorm(3000, mean = 34, sd = 4)
hist(Sample, main = 'Daily Demand for Juice Units', xlab = 'Number of Juice Units')

greater_than_40<- Sample >= 40
table(greater_than_40)
## greater_than_40
## FALSE  TRUE 
##  2805   195
195/3000
## [1] 0.065

The simulation gives a probability of 6.5%, which is very close to the probability we estimated from the model.