Chapter 5: Probability and Distributions
Learning Objectives
- Interpret a probability as a long-run relative frequency, and estimate probabilities from data.
- Apply the complement rule, the addition rule and conditional probability, and decide whether two events are close to independent.
- Explain what a random variable and its probability distribution are.
- Check the four conditions for a binomial distribution and compute binomial probabilities with
BINOM.DISTandBINOM.DIST.RANGE. - Describe the normal distribution, and compute normal probabilities and percentiles with
NORM.DIST,NORM.INVandNORM.S.DIST. - Use the empirical rule, and judge whether a normal model fits a variable by comparing the model with the data.
5.1 How Likely Is a 600-Transaction Day?
Rosa, the Metro regional manager, has a staffing problem at the Downtown store. Downtown averages about 428 transactions a day. On a 500-transaction day the line runs out the door, and on a 600-transaction day it's a crisis. She asks you: "How often should I expect a day over 500? And how rare is a 600-transaction day? I want to know how many busy days to plan for, not just what happened last year."
That last sentence changes the question. In Chapter 4. Describing Data you described what happened. Rosa wants to know what is likely to happen. That's a question about probability, and answering it usually means using a model: a simple mathematical description of how the data behave, which you can check against the data and then use to make predictions.
In this chapter you'll learn the basic rules of probability, using the survey data, and two models that appear throughout statistics: the binomial distribution for counts of yes/no outcomes and the normal distribution for measurements. Excel does nearly all the computing. You'll also see how to check whether a model fits, because a model that doesn't fit the data gives confident wrong answers.
5.2 What a Probability Is
Flip a fair coin once and you can't say how it will land. Flip it 10,000 times and almost exactly half the flips will be heads. A probability describes that long-run pattern. Saying a coin has a 0.5 probability of heads means that, over many flips, the share of heads settles near 0.5.
Probability — A number between 0 and 1 that describes how likely an outcome is: the proportion of times it would occur if the process were repeated a very large number of times. 0 means it never happens and 1 means it always does.
You can't repeat most business situations thousands of times, but data often give you the next best thing: many past repetitions. If you pick a surveyed customer at random, what's the probability that they would recommend Ridgeline? Of the 600 respondents, 407 said yes.
=COUNTIF(Survey[would_recommend],"Yes")/ROWS(Survey[would_recommend])returns 407 / 600 = 0.678.
So the probability that a randomly chosen survey respondent would recommend Ridgeline is 0.678. If the survey represents Ridgeline's customers well, it's also a reasonable estimate of the probability for a randomly chosen customer in general. (How good an estimate it is, given that it comes from only 600 people, is the subject of Chapter 6. Sampling and the Central Limit Theorem and Chapter 7. Confidence Intervals.)
Probabilities are written P(event). Here, P(recommend) = 0.678. A probability can also be written as a percentage (67.8%), but stay with decimals when you do arithmetic with them.
An "event" is just an outcome you define. "The customer would recommend us," "the store has more than 500 transactions," and "at least 10 coupons are redeemed" are all events. Defining the event clearly is half the work.
5.3 The Basic Rules
You need only a few rules to work with probabilities. Each one is easiest to see with counts from the survey.
5.3.1 The complement rule
The complement of an event is everything else: the event not happening. A customer either would recommend Ridgeline or would not, so the two probabilities must add to 1.
In words: the probability that something doesn't happen is 1 minus the probability that it does. In symbols: P(not A) = 1 − P(A). In Excel: =1-407/600 returns 0.322. Check it by counting: 193 customers said No, and 193 / 600 = 0.322.
The complement rule is a shortcut you'll use constantly. "At least one" and "more than" questions are often much easier to answer by computing the opposite and subtracting from 1.
5.3.2 The addition rule
What's the probability that a customer ordered on the mobile app or at the drive-thru? A customer has only one order type, so these two events can't both happen. Events like that are mutually exclusive, and their probabilities simply add:
- P(Mobile or Drive-thru) = 136/600 + 119/600 = 255/600 = 0.425.
Now a harder one. What's the probability that a customer is a loyalty member or would recommend Ridgeline? These events can both happen. The survey has 247 loyalty members and 407 recommenders, but 169 people are both. If you add 247 and 407, you count those 169 people twice.
In words: add the two probabilities, then subtract the probability of both, so the overlap is counted once. In symbols:
P(A or B) = P(A) + P(B) − P(A and B)
With the survey counts: P(loyal or recommend) = 247/600 + 407/600 − 169/600 = 485/600 = 0.808. In Excel you can count it directly, and it's a good check:
=COUNTIFS(Survey[loyalty_member],"Yes",Survey[would_recommend],"Yes")returns 169, the number who are both.=ROWS(Survey[response_id])-COUNTIFS(Survey[loyalty_member],"No",Survey[would_recommend],"No")returns 485, everyone except those who are neither.
5.3.3 Conditional probability
Dana wants to know whether the loyalty program is building goodwill. Are loyalty members more likely to recommend Ridgeline? That question isn't about P(recommend) overall. It's about the probability of recommending among loyalty members, which is a conditional probability.
Conditional probability — The probability of an event given that another event has occurred, written P(A | B) and read "the probability of A given B." It equals P(A and B) / P(B).
The vertical bar means "given." To find P(recommend | loyal), restrict attention to the 247 loyalty members and ask what share of them would recommend.
A two-way table makes this easy to see. Build it with COUNTIFS, or with a PivotTable (loyalty_member in Rows, would_recommend in Columns, and response_id in Values, which Excel counts):
| Recommend: No | Recommend: Yes | Total | |
|---|---|---|---|
| Loyalty: No | 115 | 238 | 353 |
| Loyalty: Yes | 78 | 169 | 247 |
| Total | 193 | 407 | 600 |
- P(recommend | loyal) = 169 / 247 = 0.684.
- P(recommend | not loyal) = 238 / 353 = 0.674.
You can get the same answer from the formula: P(loyal and recommend) / P(loyal) = (169/600) / (247/600) = 0.2817 / 0.4117 = 0.684. Dividing by P(loyal) is exactly the step of restricting attention to loyal customers.
In Excel, =COUNTIFS(Survey[loyalty_member],"Yes",Survey[would_recommend],"Yes")/COUNTIF(Survey[loyalty_member],"Yes") returns 0.684.
P(A | B) is not P(B | A). P(recommend | loyal) = 169/247 = 0.684 is the share of loyal customers who recommend. P(loyal | recommend) = 169/407 = 0.415 is the share of recommenders who are loyal. They answer different questions, and mixing them up is one of the most common errors in reading statistics.
5.3.4 Independent events
Look at the two conditional probabilities again: 0.684 for members and 0.674 for non-members. They're almost the same, and both are very close to the overall 0.678. Knowing whether a customer is a loyalty member tells you almost nothing about whether they'll recommend Ridgeline.
When knowing that one event happened doesn't change the probability of another, the events are independent.
Independent events — Two events are independent if knowing that one occurred doesn't change the probability of the other: P(A | B) = P(A). For independent events, P(A and B) = P(A) × P(B).
Check the multiplication form: if loyalty and recommending were exactly independent, P(loyal and recommend) would be 0.4117 × 0.6783 = 0.279. The actual value is 0.2817. Very close.
For Dana, that's a real finding: in this survey, loyalty members are no more likely to recommend Ridgeline than other customers. The loyalty program may bring people back more often (members visit far more often, as you'll see in Chapter 9. Comparing Two Groups), but it isn't visibly turning them into advocates.
Compare a pair of events that are not close to independent. Among mobile-app customers, 103 of 136 would recommend (0.757). Among counter customers, 220 of 345 would (0.638). Knowing the order type does change the probability noticeably. Whether a gap like that is real or could be chance is a question for Chapter 11. Relationships in Categorical Data, which tests independence formally.
Data are never exactly independent. With real counts, the two conditional probabilities will almost never match exactly, even when the events have nothing to do with each other, because of random variation. "Close to independent" is a judgment for now. Later chapters give you a test for it.
5.4 Random Variables and Their Distributions
So far each event has been a yes/no outcome. Many business questions are about numbers instead: how many transactions tomorrow, how many coupons will be redeemed, how many times a week a customer visits.
A random variable is a numerical outcome of a random process. "The number of visits per week of a randomly chosen surveyed customer" is a random variable. Before you pick the customer, you don't know the value. You do know which values are possible and how likely each one is.
Random variable — A numerical outcome of a random process, such as the number of transactions a store will have tomorrow. It is discrete if it takes separate values (usually counts) and continuous if it can take any value in a range.
The list of possible values and their probabilities is the random variable's probability distribution. For visits per week, the frequency table from Chapter 4. Describing Data turns into a probability distribution when you divide each count by 600:
| Visits per week | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 or more |
|---|---|---|---|---|---|---|---|---|
| Customers | 59 | 125 | 124 | 90 | 84 | 54 | 35 | 29 |
| Probability | 0.098 | 0.208 | 0.207 | 0.150 | 0.140 | 0.090 | 0.058 | 0.048 |
Probability distribution — A list or formula giving each possible value of a random variable and its probability. The probabilities are between 0 and 1 and add up to 1.
From the table you can answer questions directly. The probability that a random customer visits 5 or more times a week is (54 + 35 + 29) / 600 = 118 / 600 = 0.197. The mean of the random variable, also called its expected value, is 2.83 visits: the long-run average if you picked customer after customer.
A distribution built from data like this is useful, but it only describes the data you have. Statisticians also use a small set of standard distributions, described by a formula and one or two numbers. When one of them fits the situation, it lets you answer questions the data alone can't, such as the chance of an outcome that hasn't happened yet. The two you'll use most are the binomial and the normal.
5.5 The Binomial Distribution: Counting Successes
5.5.1 The situation
Suppose 10 customers are chosen at random. How many of them would recommend Ridgeline? Each customer either would (call it a "success") or wouldn't, each has about a 0.678 chance of saying yes, and one customer's answer doesn't affect another's. The number who say yes could be anything from 0 to 10. The binomial distribution gives the probability of each count.
A random variable has a binomial distribution when four conditions hold:
- A fixed number of trials, n. Here n = 10 customers.
- Two outcomes per trial, success or failure. Recommend or not.
- The same probability of success, p, on every trial. Here p = 0.678.
- Independent trials. One customer's answer doesn't change another's.
Binomial distribution — The distribution of the number of successes in n independent trials, each with the same probability of success p. Its mean is n × p.
The expected number of recommenders among 10 customers is n × p = 10 × 0.678 = 6.78. Of course, you can't get 6.78 people. In any one group of 10 you'll get a whole number, and the distribution says how likely each one is.
5.5.2 Where the probabilities come from
Take one specific outcome: exactly 7 of the 10 recommend. One way that can happen is for the first 7 to say yes and the last 3 to say no. Because the trials are independent, the probability of that exact sequence is the product of the individual probabilities:
0.678 × 0.678 × … (7 times) × 0.322 × 0.322 × 0.322 = 0.678⁷ × 0.322³ ≈ 0.0022
But the 7 yeses could be any 7 of the 10 customers. There are 120 different ways to choose which 7. (Excel's =COMBIN(10,7) returns 120.) Each way has the same probability, so:
P(exactly 7) = 120 × 0.678⁷ × 0.322³ ≈ 0.264
You can do that in Excel with =COMBIN(10,7)*0.6783^7*(1-0.6783)^3, but you don't need to. BINOM.DIST does it for you:
=BINOM.DIST(7,10,0.6783,FALSE)returns 0.2639.
The arguments are the number of successes, the number of trials, the probability of success, and a switch. FALSE gives the probability of exactly that many successes. TRUE gives the cumulative probability: that many or fewer.
Use a cell for p. Type 0.6783 in a cell (or better, compute it with
=COUNTIF(Survey[would_recommend],"Yes")/600) and refer to that cell in every formula. You'll avoid typos, and you can see how the answers change if p changes.
5.5.3 The whole distribution
To see all 11 probabilities at once, put the counts 0 to 10 in a column and let BINOM.DIST spill:
- In A1 type
k, and in A2 enter=SEQUENCE(11,1,0). - In B1 type
P(exactly k), and in B2 enter=BINOM.DIST(A2#,10,0.6783,FALSE). - Select A1:B12 and choose Insert > Insert Column or Bar Chart > Clustered Column.
| Recommenders out of 10 | 0–3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|---|---|---|---|---|---|---|---|---|
| Probability | 0.016 | 0.049 | 0.125 | 0.219 | 0.264 | 0.209 | 0.098 | 0.021 |
The most likely single outcome is 7, but 6 and 8 are nearly as likely. Even a group as small as 10 customers rarely produces 3 or fewer recommenders.
5.5.4 "Or more" and "or fewer" questions
Marcus is planning a small customer panel of 10 people and wants at least 8 of them to be fans. How likely is that if he picks at random?
"8 or more" means 8, 9 or 10. Using the complement rule, P(8 or more) = 1 − P(7 or fewer):
=1-BINOM.DIST(7,10,0.6783,TRUE)returns 0.327.- Or add the range directly:
=BINOM.DIST.RANGE(10,0.6783,8,10)returns 0.327.BINOM.DIST.RANGEtakes the number of trials, p, and the smallest and largest counts you want.
There's about a one-in-three chance that a random panel of 10 contains 8 or more recommenders. And the chance of 5 or fewer is =BINOM.DIST(5,10,0.6783,TRUE) = 0.190, nearly one in five. If Marcus wants a panel of enthusiasts, random selection won't reliably deliver one.
Watch the boundary. "More than 7" and "at least 8" are the same event, but "at least 7" is different. With cumulative probabilities, P(X ≥ 8) = 1 − P(X ≤ 7), not 1 − P(X ≤ 8). Writing out which counts you want ("8, 9 or 10") before typing the formula prevents most mistakes.
5.5.5 Coupons
Ridgeline designed its mobile coupon so that about 34% of customers who receive it redeem it. Suppose a new store manager sends the coupon to 20 loyalty customers as a trial and hopes at least 10 redeem it. Check the conditions: 20 trials, redeem or not, p = 0.34 for each, and customers decide independently. That's binomial with n = 20 and p = 0.34.
- Expected redemptions: 20 × 0.34 = 6.8.
- P(at least 10) =
=1-BINOM.DIST(9,20,0.34,TRUE)or=BINOM.DIST.RANGE(20,0.34,10,20), which returns 0.103.
There's only about a 10% chance of reaching 10 redemptions. If the manager gets 10 or more, that's unusual enough to be worth noticing: perhaps the coupon works better with these customers. If the manager gets 6 or 7, that's exactly what the design predicts, and it isn't a sign of failure. This way of thinking, asking how surprising a result would be if a particular model were true, is the foundation of Chapter 8. Hypothesis Testing.
When the conditions fail. If the 20 customers were all friends who talk to each other about deals, their decisions wouldn't be independent, and the binomial would understate the chance of very high or very low redemption counts. Always check the four conditions before you use the binomial.
5.6 The Normal Distribution
5.6.1 A model for measurements
Daily transactions, wait times and spend aren't counts of yes/no outcomes, so the binomial doesn't fit them. For many measurement variables, the histogram has a familiar shape: a single peak in the middle, falling off symmetrically on both sides. The normal distribution is a smooth curve with exactly that bell shape.
Normal distribution — A symmetric, bell-shaped continuous distribution described by two numbers, its mean μ and its standard deviation σ. The mean sets the center and the standard deviation sets the spread.
Every normal curve has the same shape. Only its center and width change:
- The mean (μ, "mu") is at the peak, and it's also the median, because the curve is symmetric.
- The standard deviation (σ, "sigma") is the distance from the mean to the point where the curve changes from bending down to bending up. A larger σ gives a wider, flatter curve.
An Excel line chart of three normal curves drawn with NORM.DIST(x, mean, sd, FALSE) over x from 200 to 700: mean 428, SD 63 (Downtown); mean 254, SD 33 (Aspen Falls); and mean 474, SD 67 (Riverside). Each curve is labeled. The chart shows that the curves have the same shape and differ only in center and width.
For a continuous variable, probability is area under the curve. The total area under any normal curve is 1. The probability that a value falls between 400 and 500 is the area under the curve between 400 and 500. The probability of any single exact value, such as exactly 427.000…, is zero, because a single point has no width. That's why, for continuous models, "more than 500" and "500 or more" have the same probability.
5.6.2 Downtown's busy days
Rosa's question was how often Downtown has a day over 500 transactions. Downtown's 365 days in 2025 had a mean of 427.54 and an SD of 63.16. The histogram in Chapter 4. Describing Data showed a single hump with only a mild right tail. Try a normal model with μ = 427.54 and σ = 63.16.
NORM.DIST returns the area to the left of a value, that is, the probability of being at or below it, when its last argument is TRUE:
- P(X ≤ 500) =
=NORM.DIST(500,427.54,63.16,TRUE)returns 0.874. - P(X > 500) =
=1-NORM.DIST(500,427.54,63.16,TRUE)returns 0.126.
The model says about 12.6% of days exceed 500 transactions, or roughly 46 days in a year (0.1256 × 365).
Now check the model against the data. How many of Downtown's 365 days actually topped 500?
=COUNTIFS(DailySales[store_id],"S01",DailySales[transactions],">500")returns 45, and 45 / 365 = 0.123.
The model said 0.126 and the data say 0.123. That's a very close match.
The model also handles the quiet end. P(X < 380) = =NORM.DIST(380,427.54,63.16,TRUE) = 0.226, or about 82 days a year. The actual count is 90 days (0.247), a little more than the model predicts but still in the same range.
And Rosa's crisis day? P(X > 600) = =1-NORM.DIST(600,427.54,63.16,TRUE) = 0.003, about one day a year. Downtown actually had 3 days over 600 in 2025 (January 11, December 14 and December 20), all winter weekend days with a promotion running. The model's prediction is low here. The data have a slightly longer right tail than a perfect bell (skewness 0.46), and a winter weekend promotion is a different kind of day from an ordinary Tuesday. Normal models are usually least reliable far out in the tails, and that's worth telling Rosa: plan for about one day in eight over 500, and treat winter weekend promotions as their own case.
An Excel chart of the normal curve with mean 427.54 and SD 63.16, x from 230 to 630, with the area to the right of 500 shaded (built from two series: the full curve as a line and the shaded region as an area series). A label reads "P(X > 500) = 0.126 (model); actual 45/365 = 0.123."
5.6.3 Percentiles from a normal model
Sometimes the question runs the other way. Rosa wants to staff for all but the busiest 10% of days. What transaction count is that? She needs the 90th percentile. NORM.INV takes a probability and returns the value with that much area to its left:
=NORM.INV(0.9,427.54,63.16)returns 508.5.
Check it against the actual 90th percentile:
=PERCENTILE.INC(FILTER(DailySales[transactions],DailySales[store_id]="S01"),0.9)returns 513.6.
The model says 509, and the data say 514. Staffing Downtown for about 510 transactions covers nine days in ten.
NORM.DIST and NORM.INV are inverses.
NORM.DISTgoes from a value to a probability ("What share of days are below 500?").NORM.INVgoes from a probability to a value ("Below what count are 90% of days?"). If you're unsure which you need, ask whether you have a value or a probability in hand.
5.6.4 Standardizing: the standard normal distribution
Every normal distribution becomes the same curve when you measure in standard deviations from the mean. That's the z-score from Chapter 4. Describing Data:
z = (x − μ) / σ
A 500-transaction day at Downtown has z = (500 − 427.54) / 63.16 = 1.15. It's 1.15 standard deviations above the mean. The normal distribution with mean 0 and SD 1 is the standard normal distribution, and z-scores follow it whenever the original variable is normal.
Standard normal distribution — The normal distribution with mean 0 and standard deviation 1. If a variable is normal, its z-scores follow the standard normal distribution.
NORM.S.DIST gives areas under the standard normal curve. (The "S" stands for standard, so it needs no mean or SD.) Two routes give the same answer:
=1-NORM.DIST(500,427.54,63.16,TRUE)returns 0.126.=1-NORM.S.DIST((500-427.54)/63.16,TRUE)returns 0.126.
Why standardize when NORM.DIST does it for you? Because it lets you compare across situations and it reveals a pattern that holds for every normal distribution: the probability of being more than 1.15 SDs above the mean is always about 0.125, whether you're measuring coffee transactions, heights or test scores. Later chapters use standardized values constantly. Every test statistic you'll meet is a kind of z-score. NORM.S.INV is the standard-normal version of NORM.INV. For example, =NORM.S.INV(0.975) returns 1.96, a number you'll see again in Chapter 7. Confidence Intervals.
5.6.5 The empirical rule
Because every normal distribution has the same shape, a few areas are worth memorizing. For any normal distribution:
- about 68% of values fall within 1 SD of the mean,
- about 95% fall within 2 SDs, and
- about 99.7% fall within 3 SDs.
This is the empirical rule (sometimes called the 68–95–99.7 rule). You can confirm the first one in Excel: =NORM.S.DIST(1,TRUE)-NORM.S.DIST(-1,TRUE) returns 0.683.
Empirical rule — For a normal distribution, about 68% of values fall within 1 standard deviation of the mean, about 95% within 2, and about 99.7% within 3.
For Downtown, the rule says about 68% of days fall between 427.5 − 63.2 = 364 and 427.5 + 63.2 = 491 transactions, and about 95% between 301 and 554. Check the data. The share of Downtown days within 1 SD of the mean is:
=SUMPRODUCT((DailySales[store_id]="S01")*(ABS(DailySales[transactions]-427.54)<=63.16))/365
That returns 0.685. Change 63.16 to 2*63.16 and 3*63.16 for the other two.
| Within | Empirical rule | Downtown's 2025 days |
|---|---|---|
| 1 SD (364 to 491) | 68% | 68.5% |
| 2 SDs (301 to 554) | 95% | 95.6% |
| 3 SDs (238 to 617) | 99.7% | 99.5% |
The match is very close. That gives you a quick way to talk about Downtown: on about two days in three, transactions land between 364 and 491, and a day outside 301 to 554 happens only about once every three weeks. It also explains why the z = 3.24 day from Chapter 4. Describing Data stood out. Only about 0.3% of values in a normal distribution lie more than 3 SDs from the mean.
The empirical rule is a quick check for any data. Before trusting a normal model, compute the share of values within 1, 2 and 3 SDs of the mean and compare with 68%, 95% and 99.7%. Large gaps mean the normal model will give poor probabilities.
5.7 When a Normal Model Fits, and When It Doesn't
A normal model is a good description of Downtown's daily transactions. That's a finding about this variable, not a law of nature. Many business variables are not normal.
Try the same model on survey visits_per_week, which Chapter 4. Describing Data showed is clearly right-skewed (skewness 1.12, mean 2.83, median 2, SD 2.10). A normal model with mean 2.83 and SD 2.10 says:
- P(visits < 0) =
=NORM.DIST(0,2.83,2.103,TRUE)= 0.089.
The model claims that about 9% of customers visit a negative number of times a week, which is impossible. It also puts the peak at 2.83 and spreads the values symmetrically, when the data pile up at 1 and 2 and have a long tail out to 14. And the empirical rule fails: 70.5% of customers fall within 1 SD of the mean and 97.5% within 2 SDs, compared with the rule's 68% and 95%. Those gaps may look small, but the normal model puts the values in the wrong places: too many below zero, and the wrong shape across the middle.
Signs that a normal model won't work well:
- Strong skew. A
SKEWvalue beyond about ±1, or a mean and median that differ noticeably. - A hard boundary near the data. Counts, wait times and prices can't be negative. If the mean is within about 2 SDs of the boundary, the bell curve will spill past it.
- Few possible values. Visits per week and the 1–10 satisfaction rating take only a handful of whole-number values. A smooth curve is a rough approximation at best.
- A mix of groups. All 4,380 store-days pooled together mix busy Metro stores with quiet Mountain stores. Each store's days might be close to normal, while the pooled data aren't.
The fix isn't to give up on the question. For a single variable like visits per week, use the data's own distribution (the table earlier in this chapter) instead of a model. And as you'll see in the next chapter, averages of skewed data behave far more normally than the data themselves. That fact is what lets the rest of this book use normal-based methods on data that aren't normal.
Check the fit before you trust the probability.
NORM.DISTwill return a precise-looking answer for any mean and SD you give it, whether or not the data are anywhere near normal. Look at a histogram, compare the mean and median, and check the empirical rule first.
5.8 Checking the Model With R for Excel
Excel computed every probability in this chapter, and that's the right tool for this kind of work. R is useful for one part of it: drawing the data's histogram with the normal curve on top, which is fiddly in Excel. It's also a good place to practice asking an AI for something specific and checking what comes back.
Set up R for Excel:
- In 1. Data, click Add a table… and choose
DailySales. - In 2. Ask your AI, type the data description below.
- Click Copy prompt, and paste it into your AI assistant.
Each row of DailySales is one Ridgeline Coffee store on one day of 2025. transactions is the number of customer transactions that store had that day. store_id S01 is the Downtown store, with 365 rows.
Question: Is a normal distribution a good model for Downtown's daily transactions? The manager wants to know how often a day tops 500 transactions.
I'm in an intro business statistics course and have learned the binomial and normal distributions, z-scores and the empirical rule.
Please use only the S01 rows. Draw a histogram of transactions with the normal curve (using the sample mean and SD) drawn over it. Then make a small table comparing the normal model with the actual data for: P(more than 500), P(fewer than 380) and the 90th percentile. Send the table to Excel with excel_out(), and explain how to read it.
Needs: a reply with a base-R script that filters DailySales to store_id == "S01", computes mean and sd, draws hist(..., freq = FALSE) with curve(dnorm(...), add = TRUE), uses pnorm and qnorm for the model column and the data (mean(x > 500), mean(x < 380), quantile(x, 0.9)) for the actual column, and sends a three-row comparison table with excel_out(). The explanation should say the two columns are close, so the normal model fits well here. The text after this block checks the numbers against the Excel results above.
A script for this usually looks like the one below. It adds the binomial results from earlier in the chapter, using R's versions of the Excel functions: pnorm is NORM.DIST(…,TRUE), qnorm is NORM.INV, and pbinom is BINOM.DIST(…,TRUE).
# Downtown's daily transactions, its mean and its SD
x <- DailySales$transactions[DailySales$store_id == "S01"]
m <- mean(x)
s <- sd(x)
# Histogram of the data with the normal curve on top
hist(x, breaks = 25, freq = FALSE, main = "Downtown daily transactions, 2025", xlab = "Transactions")
curve(dnorm(x, m, s), add = TRUE, lwd = 2)
# Normal model vs. what actually happened
comparison <- data.frame(
measure = c("P(more than 500)", "P(fewer than 380)", "90th percentile"),
normal_model = round(c(1 - pnorm(500, m, s), pnorm(380, m, s), qnorm(0.9, m, s)), 4),
actual = round(c(mean(x > 500), mean(x < 380), quantile(x, 0.9, names = FALSE)), 4))
excel_out(comparison, "Downtown: normal model vs. actual")
# Binomial probabilities from the chapter
binom <- c("8+ of 10 recommend" = 1 - pbinom(7, 10, 407/600),
"10+ of 20 redeem a coupon" = 1 - pbinom(9, 20, 0.34))
excel_out(round(binom, 4), "Binomial probabilities")
Read it the same way you read every script:
- Data. The first line keeps only the
S01rows oftransactions. If the script used every store, the "model vs. actual" comparison would be about the whole chain, a different question with a poorer fit. - The model.
mandsare the sample mean and SD, so the normal curve is the same one you used withNORM.DIST. - The chart.
histdraws the histogram.freq = FALSEscales the bars so their total area is 1, which lets the normal curve (curve(dnorm(...))) sit on the same scale. - The comparison. The
normal_modelcolumn uses the normal curve. Theactualcolumn counts real days:mean(x > 500)is the share of days above 500, the same as yourCOUNTIFSdivided by 365. - Output. Two
excel_out()calls send the two tables to Excel.
Paste the reply into 3. Run R code and click Run. Send each output card to a New sheet. The histogram appears in Results with an Insert into Excel button, so you can place it next to the table.
The R for Excel Results area after running the script: a histogram of Downtown's daily transactions (density scale) with a smooth normal curve overlaid, an Insert into Excel button below it, and the output card "Downtown: normal model vs. actual" previewing three rows with normal_model and actual columns.
Verify. The comparison table should show 0.1256 vs. 0.1233 for days over 500, 0.2258 vs. 0.2466 for days under 380, and 508.5 vs. 513.6 for the 90th percentile, exactly the numbers you computed with NORM.DIST, COUNTIFS, NORM.INV and PERCENTILE.INC. The binomial table should show 0.3272 and 0.1032, matching BINOM.DIST.RANGE. In the histogram, the bars should follow the curve closely, with perhaps a few more bars than the curve expects at the far right. If the AI's numbers differ from yours, find out why before you use either. The usual causes are using all stores instead of S01, or >= where you meant >.
Conclusion for Rosa.
A normal model fits Downtown's daily transactions well. Expect about one day in eight (roughly 45 days a year) over 500 transactions, and plan staffing for about 510 to cover nine days in ten. Days over 600 are rare, about three a year. In 2025 all three were winter weekends with a promotion running, so schedule extra staff for those days specifically.
5.9 Summary
A probability is the long-run share of times an outcome occurs, and data let you estimate it, as with P(recommend) = 407/600 = 0.678. The complement rule (1 − P), the addition rule (subtract the overlap) and conditional probability (restrict to the group you're given) handle most everyday questions. Loyalty membership and recommending turned out to be nearly independent: P(recommend | loyal) = 0.684 vs. 0.674 for non-members.
A random variable is a numerical outcome, and its probability distribution lists the possible values and their probabilities. The binomial distribution counts successes in a fixed number of independent yes/no trials with the same probability, and BINOM.DIST and BINOM.DIST.RANGE give its probabilities. The normal distribution is a bell-shaped model described by its mean and SD. NORM.DIST turns values into probabilities, NORM.INV turns probabilities into values, and standardizing with z connects every normal distribution to the standard normal. For Downtown, the normal model predicted 12.6% of days over 500 transactions, against an actual 12.3%, and the empirical rule matched the data closely. For a skewed variable like visits per week, the same model gives impossible answers. Always check a model against the data before you rely on it.