Before you start
You will be able to
- Define an experiment, its sample space and its events, and distinguish classical, relative-frequency and subjective probability.
- Calculate joint, marginal and conditional probabilities from a contingency table, and the probability of a complement, a union and an intersection.
- Decide whether two events are independent by comparing P(A | B) with P(A), and say what independence would predict for a table.
- Use a tree diagram and the multiplication rule for events in sequence, with and without replacement.
- Apply Bayes’ rule to a screening problem, explaining the role of the base rate and of false positives.
- Calculate the number of possible samples and arrangements with COMBIN and PERMUT.
Review first
- Describing distributions — Proportions, the notation for parameters and statistics, and the 231 spring orders.
- PivotTables — A PivotTable of channel against subscription, and % of Row Total, are the contingency tables of this lesson.
- Interpreting results: charts, comparisons and causes — Association is not causation, and confounding, which matter when two events turn out not to be independent.
- Collecting data: sources, samples and bias — Simple random samples, which make every order equally likely to be chosen.
Fictional case A fictional coffee business founded by Ana Lim. It starts as a catering and barista-training service, opens its own cafés and an online shop for beans, and plans a canned cold brew.
The idea
Fictional case
In B03, a PivotTable of the spring orders showed that app orders were more often subscriptions than web orders, and Ana wants to say it precisely. If she picks one of the 231 orders at random, how likely is it to be a subscription, and does knowing that it came through the app change that? And when Tillwise (fictional), the company that processes Lantern’s card payments, flags an order as possible fraud, how likely is the order to be fraudulent? All three are questions of probability.
Experiments, sample spaces and events
An experiment is any process with an uncertain outcome: drawing an order at random, the next customer’s rating, whether a quote is accepted. Its sample space is the set of all possible outcomes, and an event is any set of outcomes. Picking one spring order at random has a sample space of 231 orders; “the order is a subscription” is an event containing 104 of them.
A probability is a number from 0 to 1 that measures how likely an event is: 0 for impossible, 1 for certain. The probabilities of all the outcomes in a sample space add to 1. Writing for the probability of event , the chance that a randomly drawn spring order is a subscription is .
Three ways to assign a probability
- Classical: when every outcome is equally likely, is the number of outcomes in divided by the number in the sample space. A draw at random from the 231 orders is exactly such an experiment, which is why is the probability.
- Relative frequency: the share of times an event happens in a long run of repetitions. Treat 45.0% as the chance that Ana’s next order is a subscription and you are using the spring’s relative frequency as an estimate. The law of large numbers says that the relative frequency settles closer and closer to the true probability as the repetitions grow, which is why estimates from many orders are steadier than estimates from few.
- Subjective: a judgement of how likely an event is, used when there is no long run to count. Ana’s view that there is a 60% chance her largest café client renews its contract (fictional) is a subjective probability. It must still obey the rules below, and it should be revised when evidence arrives, which is what Bayes’ rule does.
Reading probabilities from a contingency table
A contingency table counts observations by two categorical variables at once: B03’s PivotTable of channel against subscription is one. Dividing every count by the grand total turns it into a table of probabilities for an order drawn at random.
| Subscription | One-off | Total | |
|---|---|---|---|
| Web | 47 (0.203) | 85 (0.368) | 132 (0.571) |
| App | 57 (0.247) | 42 (0.182) | 99 (0.429) |
| Total | 104 (0.450) | 127 (0.550) | 231 (1.000) |
- A joint probability is the probability that two events both happen, read from the body of the table: .
- A marginal probability is the probability of one event on its own, read from the margins: and .
- A conditional probability is the probability of one event given that another has happened. , read “the probability of a subscription given an app order”, keeps only the 99 app orders: . For web orders it is .
Conditioning shrinks the sample space to the orders that meet the condition. That is why the order of the bar matters: is a different question (of the subscription orders, what share came through the app?) with a different answer. B03’s % of Row Total and % of Column Total are these two conditional probabilities, as percentages.
Complements and “or”
The complement of an event , written (“not A”), is every outcome not in , so : the chance an order is one-off is . For “or”, add the two probabilities and take away the overlap, which would otherwise be counted twice: . Check it with counts: the 99 app orders plus the 47 web subscriptions make 146 orders, and .
Two events are mutually exclusive when they can’t happen together, like “web order” and “app order” for the same order. Their overlap is empty, so the probability of one or the other is the plain sum: .
Independence
Two events are independent when knowing that one happened doesn’t change the probability of the other: . Here it fails. An order’s chance of being a subscription is 0.450 overall but 0.576 among app orders and 0.356 among web orders. In these orders, channel and subscription are associated.
Independence also predicts what the table would look like. If channel told you nothing about subscription, the 99 app orders would contain subscriptions in the overall proportion, , instead of the 57 observed. Whether a gap of about 12 orders is more than chance would produce in 231 orders is a test question; module 4’s chi-square test answers it. And even a real association wouldn’t show that the app causes subscriptions: app users may be Lantern’s most loyal customers in the first place.
In depth
The rules of probability
Every way of assigning probabilities must obey the same rules. For any event, , and the whole sample space has probability 1. The complement rule follows: . The addition rule gives “or”, the union : . Here “and” is the intersection , the outcomes in both events, and its probability is 0 for mutually exclusive events.
Conditional probability is defined from the joint and marginal probabilities, , for any with . Rearranged, it is the multiplication rule: . With the table, , the same joint probability as before.
For independent events the multiplication rule simplifies to . Three checks are equivalent, and any one of them shows independence: , , or . For channel and subscription, , against the joint probability of 0.247.
Probabilities in Excel
A PivotTable gives the counts, and B03’s % of Grand Total, % of Row Total and % of Column Total turn them into joint and conditional probabilities. The same numbers come from formulas on the order sheet, with channel in column K and subscription in column L: =COUNTIFS(K2:K232,"app",L2:L232,"yes")/COUNT(J2:J232) is the joint probability 0.247, and =COUNTIFS(K2:K232,"app",L2:L232,"yes")/COUNTIF(K2:K232,"app") is the conditional probability 0.576. The pattern is always the same: the count of orders that meet both conditions, divided by the count of orders that meet the condition after the bar (or by all orders, for a joint probability).
Formulas have two advantages over a PivotTable for this work. They update when the data change, and they make the condition visible: anyone reading COUNTIF(K2:K232,"app") in the denominator can see that the probability is conditional on an app order. When a report quotes a percentage, the first check is the denominator, because a share of all orders, a share of app orders and a share of subscription orders are three different probabilities.
Tree diagrams
A tree diagram shows events in sequence. Each branch carries the probability of an event given everything to its left, so the first branches are marginal probabilities and later ones conditional. Multiplying along a path gives the joint probability of that path (the multiplication rule), and the paths’ probabilities add to 1.
Adding the paths that end in “subscription” recovers the marginal probability: . This is the law of total probability: . It is the denominator of Bayes’ rule.
Sampling with and without replacement
Draw two spring orders at random. If the first is put back before the second is drawn (with replacement), the draws are independent and . If it isn’t (without replacement), the second draw depends on the first: . Surveys and audits sample without replacement, but when the sample is a small part of the population the two answers are almost the same. That is why the next lesson can treat a few draws from a large population as independent; OpenStax’s rule of thumb is a sample of fewer than 10% of the population.
Bayes’ rule
Tillwise screens every card payment and flags some as possible fraud. Suppose (all rates fictional) that 0.4% of orders are fraudulent, the base rate; that the screen flags 95% of fraudulent orders; and that it also flags 2% of genuine ones, its false positive rate. If an order is flagged, what is the probability it is fraudulent? The screen’s 95% is ; the question asks for . Bayes’ rule turns one into the other:
Only about 16% of flagged orders are fraudulent. Natural frequencies make the reason visible. Of 10,000 orders, 40 are fraudulent and 38 of them are flagged; of the 9,960 genuine orders, 2%, about 199, are flagged too. So 38 of about 237 flagged orders are fraud. When the base rate is low, even a small false-positive rate produces more false alarms than real cases.
Confusing with is sometimes called the confusion of the inverse; it usually comes from ignoring the base rate (base-rate neglect), and it lies behind many bad decisions about screening tests, alarms and audits. The reverse question gives a reassuring answer: an order that is not flagged is fraudulent with probability about 0.0002, two in ten thousand. A screen like this is good at clearing orders and poor at convicting them.
Counting outcomes: COMBIN and PERMUT
Classical probability needs the number of equally likely outcomes, and counting them is often the hard part. The number of ways to choose items from when order doesn’t matter is the number of combinations, , Excel’s =COMBIN(n,k); when order matters it is the number of permutations, , =PERMUT(n,k). Here (“n factorial”) is .
Ana could draw 5,247,527,901 different samples of 5 orders from the 231: =COMBIN(231,5). A simple random sample makes each of them equally likely. Choosing 3 of 5 trainees for a photo can be done in =COMBIN(5,3) = 10 ways, but lining 3 of them up in order in =PERMUT(5,3) = 60 ways, because each group of 3 can be arranged in orders. Combinations return in the next lesson, where they count the ways a binomial outcome can happen.
Formulas
Complement rule
- An event
- Its complement: every outcome not in A
- Probability, from 0 to 1
Addition rule
- Two events
- Their joint probability (the overlap)
For mutually exclusive events P(A and B) = 0, so P(A or B) = P(A) + P(B).
Conditional probability and the multiplication rule
- Probability of A given that B has happened
- Probability of the condition (must be more than 0)
From a table of counts: the count in the cell divided by the count of the condition’s row or column.
Independence
- Two events with positive probability
- Probability of the event in brackets
If independent, the expected count in a table cell is row total × column total ÷ grand total.
Bayes’ rule
- Prior probability (the base rate) of A
- Probability of the evidence B when A is true (a screen’s sensitivity)
- Probability of the evidence when A is false (the false-positive rate)
- Probability of A after seeing B
Assumes. The denominator is P(B), by the law of total probability.
Combinations and permutations (COMBIN, PERMUT)
- Number of items to choose from
- Number chosen
- n factorial: n × (n − 1) × … × 1, with 0! = 1
- Number of ordered selections (permutations)
In Excel: =COMBIN(n,k) and =PERMUT(n,k); =FACT(n) gives n!.
Worked examples
Fictional figures
One of Lantern’s 231 spring orders is drawn at random. Using the channel × subscription table, find P(web), P(web and one-off), P(one-off | web) and P(web or one-off).
- Marginal: .
- Joint: .
- Conditional: keep only the 132 web orders, . Check with the multiplication rule: .
- Addition rule: , the 174 orders that are web, one-off or both. Its complement is the 57 app subscriptions: .
Answer. P(web) ≈ 0.571, P(web and one-off) ≈ 0.368, P(one-off | web) ≈ 0.644, P(web or one-off) ≈ 0.753.
What it means. Almost two web orders in three are one-off purchases. The “or” probability is easiest through its complement: the only orders that are neither web nor one-off are the app subscriptions.
Fictional figures
By region, the spring orders split as follows (subscription, one-off): North 19 and 39; South 18 and 25; East 39 and 13; West 17 and 36; Central 11 and 14. Is region independent of subscription for these orders? What would independence predict for the East? And if Ana picks two subscription orders at random, without replacement, for a follow-up call, what is the chance both are from the East?
| Region | Subscription | One-off | Total | P(sub | region) |
|---|---|---|---|---|
| North | 19 | 39 | 58 | 0.328 |
| South | 18 | 25 | 43 | 0.419 |
| East | 39 | 13 | 52 | 0.750 |
| West | 17 | 36 | 53 | 0.321 |
| Central | 11 | 14 | 25 | 0.440 |
| Total | 104 | 127 | 231 | 0.450 |
- Compare each region’s conditional probability with the overall one. , far above ; North (0.328) and West (0.321) are below it. The conditional probabilities differ, so region and subscription are not independent in these orders.
- What independence predicts: the 52 East orders would contain subscriptions in the overall proportion, , against 39 observed.
- Turn the condition round: , against . The East supplies 37.5% of subscription orders but 22.5% of all orders.
- Two subscription orders without replacement: . The second fraction is conditional on the first call being to an East customer, so one East order has left the pool.
Answer. Not independent: P(sub | East) = 0.75 against P(sub) ≈ 0.450; independence would predict about 23.4 East subscriptions, not 39. P(both calls go to the East) ≈ 0.138.
What it means. In the spring data, East customers subscribe far more often than others. That is a description of these orders: whether the gap is bigger than chance is module 4’s chi-square test, and why it exists (a local café partner promoting subscriptions? the delivery schedule?) is a question the data can’t answer alone.
Fictional figures
Tillwise offers Ana a setting that cancels every flagged order automatically. Using the fictional rates above (base rate 0.4%, 95% of fraud flagged, 2% of genuine orders flagged) and Lantern’s 583 orders in December 2026, how many orders would be cancelled in a month like December, how many of them genuine, and what should Ana choose?
- Probability that an order is flagged (law of total probability): . In December, orders would be flagged.
- Of those, fraudulent: ; genuine: .
- Bayes’ rule gives the same split as a probability: , so about 16% of cancelled orders would be fraud and 84% genuine customers.
- Weigh the outcomes. Automatic cancellation would turn away about 12 genuine December customers to stop about 2 fraudulent orders. Holding flagged orders for a manual check instead costs about 14 short reviews a month.
Answer. About 14 December orders would be flagged; about 12 of them genuine. Ana should hold flagged orders for review rather than cancel them.
What it means. A flag raises the probability of fraud from 0.4% to about 16%, a forty-fold increase, but leaves most flagged orders genuine. The flag is a reason to look, not a verdict. If Ana’s real base rate is lower than 0.4%, the share of false alarms is even higher.
Explore
Common mistakes
“P(A | B) and P(B | A) are the same thing.”
They answer different questions. 57.6% of app orders are subscriptions, but 54.8% of subscriptions are app orders. With a rare event the gap is enormous: the fraud screen flags 95% of fraud, yet only 16% of flagged orders are fraud.
“Mutually exclusive events are independent.”
They are the opposite: if two events can’t happen together, knowing one happened makes the other impossible. Independent events can happen together, and one tells you nothing about the other.
“P(A or B) = P(A) + P(B).”
Only when A and B can’t both happen. Otherwise the overlap is counted twice: P(app or subscription) is 0.429 + 0.450 − 0.247 = 0.632, not 0.879.
“The conditional probabilities differ, so one causes the other.”
A difference between P(subscription | app) and P(subscription | web) shows association in these orders. It may be chance (module 4 tests that), and even a real association can come from a confounding variable, such as loyal customers preferring the app.
“Ignore the base rate: the screen is 95% accurate.”
A screen’s sensitivity and false-positive rate describe how it treats cases whose truth is known. What a flagged case means depends on how common the condition is. Always put the base rate into Bayes’ rule, or count natural frequencies.
Guided practice
Work through these with hints when you need them. Every hint and every worked solution is there to be used.
Loading four questions…
On your own
No hints this time. Answer, check, and read the feedback; the solution appears once you have answered or if you ask for it. Your first answers count toward mastery.
Loading six questions…
In practice
Conditional probabilities are how businesses read their own data. A retailer compares the share of app customers who return with the share of web customers; an insurer prices a policy from claim rates conditional on age and region; a bank tunes a fraud model by trading its sensitivity against its false-positive rate. In each case the first question is “conditional on what?”, and the second is whether the comparison is between groups that differ in other ways too.
Bayes’ rule is the arithmetic of screening, and screening is everywhere: credit checks, quality inspections, spam filters, medical tests, audit samples. The managerial lesson is that the value of a flag depends on the base rate. A screen that is excellent in a population where the problem is common can be mostly false alarms where it is rare, so a business should decide what a flag triggers (a review, a call, a hold) from the expected numbers of true and false flags, not from the screen’s headline accuracy.
Fictional case
Ana sets Tillwise to hold flagged orders for her to check rather than cancel them, and adds a line to her shop review: “App orders were subscriptions 58% of the time, web orders 36%; East orders 75%. These are differences in the spring’s orders; whether they are more than chance, and why, is still open.” Module 4 runs the test.
Knowledge check
Six questions, one attempt each, no hints. Score 80% or more to complete the lesson; you can take it again at any time.
Loading six questions…
Summary
- A probability is a number from 0 to 1; it can be classical (equally likely outcomes), a relative frequency (a long-run share) or subjective (a judgement), and all obey the same rules.
- From a contingency table: joint probabilities come from the cells, marginal probabilities from the totals, conditional probabilities from a cell divided by its row or column total.
- P(A′) = 1 − P(A); P(A or B) = P(A) + P(B) − P(A and B); P(A and B) = P(B) × P(A | B).
- A and B are independent when P(A | B) = P(A); independence predicts each cell’s count as row total × column total ÷ grand total.
- Mutually exclusive events can’t happen together and are not independent; P(A | B) is not P(B | A).
- A tree diagram multiplies along branches for joint probabilities; without replacement, later branches change.
- Bayes’ rule turns P(evidence | condition) into P(condition | evidence); with a low base rate most flags can be false positives.
- COMBIN counts unordered selections and PERMUT ordered ones; a simple random sample makes every combination equally likely.
Key formulas
- Complement rule
- Addition rule
- Conditional probability and the multiplication rule
- Independence
- Bayes’ rule
- Combinations and permutations (COMBIN, PERMUT)
Terms introduced
- Sample space
- The set of all possible outcomes of an experiment, such as the 231 orders that a random draw could pick.
- Event
- A set of outcomes of an experiment, such as “the order drawn is a subscription”.
- Probability
- A number from 0 (impossible) to 1 (certain) that measures how likely an event is; the probabilities of all the outcomes in a sample space add to 1.
- Relative frequency
- The number of times an event occurs divided by the number of trials or observations; used as an estimate of its probability.
- Law of large numbers
- As an experiment is repeated more and more times, the relative frequency of an event tends to get closer to its probability, and the average of the results to the expected value.
- Contingency table
- A table that counts observations by two categorical variables at once, one in the rows and one in the columns, with row and column totals.
- Joint probability
- The probability that two events both happen, P(A and B); in a contingency table, a cell count divided by the grand total.
- Marginal probability
- The probability of one event regardless of the others; in a contingency table, a row or column total divided by the grand total.
- Conditional probability
- The probability of an event given that another has happened, P(A | B) = P(A and B) ÷ P(B).
- Complement
- All the outcomes not in an event A, written A′; P(A′) = 1 − P(A).
- Mutually exclusive
- Describes events that can’t happen together, so P(A and B) = 0 and P(A or B) = P(A) + P(B).
- Independent
- Describes events where knowing one has happened doesn’t change the probability of the other: P(A | B) = P(A), equivalently P(A and B) = P(A) × P(B). Two categorical variables are independent when this holds for every pair of their categories.
- Tree diagram
- A diagram of events in sequence whose branches carry probabilities, conditional on the branches before them; multiplying along a path gives its joint probability.
- Bayes’ rule
- P(A | B) = P(A) P(B | A) ÷ [P(A) P(B | A) + P(A′) P(B | A′)]: how the probability of A changes once evidence B is seen.
- Base rate
- How common a condition is in the population before any evidence is seen, such as the share of orders that are fraudulent; the prior probability in Bayes’ rule.
- False positive
- A case flagged by a screen or test that does not have the condition, such as a genuine order flagged as fraud. The false-positive rate is the share of cases without the condition that the screen flags, P(flag | no condition).
Sources
- Holmes, A., Illowsky, B. & Dean, S. (2023). Introductory Business Statistics 2e, section 3.1, “Terminology” (sample space, events, relative frequency, conditional probability). OpenStax. openstax.org/books/introductory-business-statistics-2e/pages…
- Holmes, A., Illowsky, B. & Dean, S. (2023). Introductory Business Statistics 2e, chapter 3, “Formula Review” (independence, mutually exclusive events, the multiplication and addition rules). OpenStax. openstax.org/books/introductory-business-statistics-2e/pages…
- Holmes, A., Illowsky, B. & Dean, S. (2023). Introductory Business Statistics 2e, section 4.2, “Binomial Distribution” (sampling without replacement and the 10% rule). OpenStax. openstax.org/books/introductory-business-statistics-2e/pages…
- Ault, S. V., Liao, S. N. & Musolino, L. (2025). Principles of Data Science, section 3.4, “Probability Theory” (Bayes’ theorem and a screening example). OpenStax. openstax.org/books/principles-data-science/pages/3-4-probabi…
- Microsoft Support. “COMBIN function”, with the page for PERMUT. support.microsoft.com/en-us/office/combin-function-12a3f276-…
