In: Statistics and Probability
A restaurant is open everyday. For a given week, the total sales on weekdays are approximately normal with a mean of $10000 and a standard deviation of $2500. On the weekends, the total sales are approxi- mately normal with a mean of $7000 and a standard deviation of $1400. The rent costs $2500 weekly, labor costs $4500 weekly, food costs $4500 weekly, and other expenses amount to $2500 weekly. Our goal is to find out in any given week, what is the probability that the restaurant is making money? Please complete the following questions (Also, please make sure your results are reproducible):
Calculate the total cost for a given week (assign it to variable cost).
Simulate a random value from the distribution corresponds to weekdays (assign it to variable S1);
Simulate a random value from the distribution corresponds to weekends (assign it to variable S2).
Calculate S1 + S2 − cost (assign it to r1). This should be a simulated revenue for a given week.
Now, Simulate 10000 random values from the normal distribution corresponds to weekdays (assign it to variable S3); Simulate 10000 random values from the normal distribution corresponds to weekends (assign it to variable S4); Calculate S3 + S4 − cost (assign it to r2).
Calculate the percentage of values that is greater than 0 among r2 (assign it to perc). This value should be the probability that the restaurant is making money.
Note: You can even compute the mean revenue for this particular restaurant based on the sample you just got. The procedure you just complete is called simulation method. I didn’t have time to cover it in class, but it is extremely useful when you are dealing with complicated systems and when the exact solution is unavailable.
Let X denotes the sales on week days.
X ~ Normal(10000, 25002)
Let Y denotes the sales on weekends.
Y ~ Normal(7000,14002)
Total Cost = Variable Cost = 2500 +4500+4500 + 2500 = 14000
On left side is Output and on right side is Code of the below screenshot
There is 0.8479 probability that the restaurant is making money.
Here is the R code which u can run in R
# Total Cost =Variable Cost
cost = 2500 +4500+4500 + 2500
#Simulate a random value from the distribution corresponds to
weekdays
S1 = rnorm(1, 10000, 2500)
#Simulate a random value from the distribution corresponds to
weekends
S2 = rnorm(1,7000,1400)
#simulated revenue for a given week.
r1 = S1+S2-cost
#Simulate 10000 random values from the normal distribution
corresponds to
#weekdays
S3 = rnorm(10000, 10000, 2500)
# Simulate 10000 random values from the normal distribution
corresponds
#to weekends
S4 = rnorm(10000,7000,1400)
# S3 + S4 − cost (assign it to r2).
r2 = S3 + S4 − cost
# values that is greater than 0 among r2
value = r2[r2>0]
#Percentage of values that is greater than 0 among r2
(length(value)/length(r2))*100