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\].
Mean_demand_quantity<- 52 - (6*(3))
Mean_demand_quantity
## [1] 34
Probability_demand_greater_than_40<-1 - pnorm(40, mean = 34, sd = 4)
Probability_demand_greater_than_40
## [1] 0.0668072
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.