# Simulation (2015 #2)

To increase business, the owner of a restaurant is running a promotion in which a customer’s bill can be randomly selected to receive a discount. When a customer’s bill is printed, a program in the cash register randomly determines whether the customer will receive a discount on the bill. The program was written to generate a discount with a probability of 0.2, that is, giving 20 percent of the bills a discount in the long run. However, the owner is concerned that the program has a mistake that results in the program not generating the intended long-run proportion of 0.2. The owner selected a random sample of bills and found that only 15 percent of them received discounts. Should he be concerned? There are two competing hypotheses: The program is working (null hypothesis) vs the program is not working (alternate hypothesis). In the dot plot below, each dot represents the number of discounts in 100 simulated bills, under the assumption that the program gives discounts 20% of the time. There are 100 trials represented in the plot. Since the estimated p-value is reasonably large, we do not have evidence that the program is not working as intended. This does not mean the program is working, just that we lack convincing evidence it is not working.

## Using a Binomial Model

This is a binomial situation. There are only two outcomes: discount or no discount. The assumed probability of a discount is always 20% and does not change from bill to bill. Wether or not a bill receives a discount is independent of the other bills getting discounts. The applet below shows a hypothetical sample of 20 bills. The probability of 15% or fewer of the 20 bills (3 or fewer) given the true discount rate is 0.2 is about 41%. Explore this model by changing the sample size (n) and the upper bounds for the lower tail.