Turn Probabilities Into Digit Assignments
In Setting Up a Simulation Model, you defined the chance process, the possible outcomes, and what counts as one trial. Now we need a way to generate those outcomes using random digits. When each digit from 0 through 9 is equally likely, the ten digits can represent ten equally likely parts of the model. Assigning more digits to an outcome gives it a higher probability.
For example, if an outcome should occur with probability \(0.30\), it should be assigned three of the ten digits. Each digit represents one-tenth, or \(0.10\), of the probability. If the digits 0, 1, and 2 represent that outcome, then its modeled probability is \(3(0.10)=0.30\).
A clear assignment should account for every digit exactly once. Each digit must correspond to an outcome, and no digit should correspond to two different outcomes. When the assignment is complete, the number of digits assigned to each outcome should agree with its probability.
Use Consecutive Ranges to Keep Track
One convenient method is to list outcomes in a chosen order and assign each a consecutive range of digits. Start at 0, allocate the right number of digits to the first outcome, then continue with the next unused digit. The chosen order does not affect the modeled probabilities, as long as the assignment is complete and correct.
Suppose three outcomes have probabilities \(0.20\), \(0.50\), and \(0.30\). The first outcome needs two digits, the second needs five, and the third needs three. One possible assignment is 0–1 to the first outcome, 2–6 to the second, and 7–9 to the third. The range endpoints are inclusive: 0–1 contains two digits, not one.
These two totals provide related checks. The digit counts must add to ten because there are ten possible digits. The probabilities must add to one because the listed outcomes account for the entire chance process. A correct total alone is not enough: you also need to check that each outcome received the right number of digits and that every digit appears exactly once.
Worked Example: Representing a 30% Chance of Success
A garden sensor detects dry soil on any check with probability 0.30. For a simulation, each check should be represented by one random digit from 0 through 9. Assign the digits to “dry soil detected” and “dry soil not detected,” then check the assignment.
Find the digit counts: The detection outcome has probability \(0.30\), so it needs \(0.30(10)=3\) digits. The other outcome has probability \(1-0.30=0.70\), so it needs \(0.70(10)=7\) digits.
Make an assignment: Assign 0, 1, and 2 to “dry soil detected.” Assign 3, 4, 5, 6, 7, 8, and 9 to “dry soil not detected.”
Check the counts and probabilities: The detection outcome has three digits, so its modeled probability is \(3/10=0.30\). The other outcome has seven digits, so its modeled probability is \(7/10=0.70\). The counts add to \(3+7=10\), and the probabilities add to \(0.30+0.70=1.00\).
The assignment uses every digit exactly once, with no overlap or gap. Any three digits could have represented detection, provided the remaining seven represented no detection. Using a consecutive range simply makes the assignment easier to describe and check.
Assign Digits to More Than Two Outcomes
For several outcomes, calculate how many digits each probability requires, then assign ranges that cover 0 through 9 without repeating or skipping a digit. For probabilities that are multiples of \(0.10\), the count of digits is ten times the probability. For instance, a probability of \(0.20\) requires two digits, and a probability of \(0.50\) requires five.
You can check an assignment in two ways. First, count the digits in each range and compare each count with its outcome’s probability. Second, make sure the ranges together contain all ten digits once. Also check that the stated outcome probabilities sum to 1.00. That last check can reveal a problem in the chance model itself, even before you assign digits.
Worked Example: Three Possible Delivery Times
A simplified delivery model has three possible outcomes for a package: early with probability 0.20, on time with probability 0.50, and late with probability 0.30. Assign digits 0 through 9 to represent one delivery outcome.
Calculate the needed counts: Early needs \(0.20(10)=2\) digits. On time needs \(0.50(10)=5\) digits. Late needs \(0.30(10)=3\) digits.
Assign consecutive ranges: Assign 0–1 to early, 2–6 to on time, and 7–9 to late.
| Outcome | Probability | Assigned digits | Number of digits |
|---|---|---|---|
| Early | 0.20 | 0–1 | 2 |
| On time | 0.50 | 2–6 | 5 |
| Late | 0.30 | 7–9 | 3 |
Verify the assignment: The assigned counts are \(2\), \(5\), and \(3\), matching the probabilities because \(2/10=0.20\), \(5/10=0.50\), and \(3/10=0.30\). The digit-count check is \(2+5+3=10\), and the probability check is \(0.20+0.50+0.30=1.00\). The ranges cover 0–9 once, with no digit omitted or assigned to more than one delivery outcome.
Under this model, if the random digit is 5, the simulated outcome is on time. If it is 8, the simulated outcome is late. The same mapping is used each time the delivery process is simulated.
Use the Mapping Consistently
Once the assignment has been checked, apply it the same way for each random digit. Each digit produces exactly one model outcome. If a simulation trial calls for one delivery, one digit is enough. If a trial involves several deliveries, use one digit for each delivery and follow the trial definition from the earlier tutorial on setting up a simulation model.
Here is a four-outcome mapping for a device’s status: working with probability 0.40, needs a reset with probability 0.30, needs a repair with probability 0.20, or unusable with probability 0.10. Assign 0–3 to working, 4–6 to needs a reset, 7–8 to needs a repair, and 9 to unusable. The counts are \(4,3,2,1\), which correspond to probabilities \(0.40,0.30,0.20,0.10\).
For example, suppose a sequence of random digits is 7, 0, 2, 8, 4, 9, 1, 6, 0, 3. Applying the mapping gives: needs a repair, working, working, needs a repair, needs a reset, unusable, working, needs a reset, working, working. The sequence has five working outcomes, two reset outcomes, two repair outcomes, and one unusable outcome. Those counts describe this particular sequence; they are not a reason to alter the mapping. A simulation’s results can vary from one run to another.
When One Digit Is Not Enough
A single digit can represent probabilities in tenths exactly: \(0.10\), \(0.20\), and so on. It cannot represent every probability exactly. For example, a 35% outcome would require \(0.35(10)=3.5\) digits. A digit cannot be split between outcomes, so assigning either three or four digits would produce \(0.30\) or \(0.40\), not \(0.35\).
When a model needs probabilities in hundredths, a larger set of equally likely labels can help. For example, the 100 two-digit labels from 00 through 99 allow an outcome with probability 0.35 to receive 35 labels. This is the same counting idea at a finer level: each label represents \(1/100\), and 35 of them represent \(35/100=0.35\). A separate tutorial explains how to read a random digit table; the key point here is that the size of the label set must support the probabilities you need to model.
Worked Example: Assigning a 35% Outcome With Two-Digit Labels
A recycling center wants to model whether a randomly selected item is accepted. Suppose the probability of acceptance is 0.35 and the probability of rejection is 0.65. Explain why one digit is not enough for an exact assignment, then make an exact assignment using labels 00 through 99.
Check the single-digit option: Ten digits would require \(0.35(10)=3.5\) digits for acceptance. Since the number of assigned digits must be a whole number, a one-digit assignment cannot represent 0.35 exactly.
Use 100 labels: With labels 00 through 99, there are 100 equally likely labels. Assign 00 through 34 to acceptance. This inclusive range contains \(34-00+1=35\) labels. Assign 35 through 99 to rejection, which contains \(99-35+1=65\) labels.
Check the probabilities and coverage: The acceptance probability represented is \(35/100=0.35\), and the rejection probability represented is \(65/100=0.65\). The counts add to \(35+65=100\), and the two ranges cover 00 through 99 once with no overlap or gap.
This method changes the number of equally likely labels, not the checking principle. Count the labels assigned to each outcome, compare those counts with the intended probabilities, and verify that the complete set of labels is used exactly once.
Common Mistakes and AP Exam Tips
- Assigning the same number of digits to outcomes with different probabilities. If one outcome has probability 0.30 and another has probability 0.70, they need three and seven digits, not five each.
- Counting range endpoints incorrectly. The inclusive range 2–6 contains five digits: 2, 3, 4, 5, and 6. Write the digits out or use a count to avoid off-by-one errors.
- Leaving gaps or overlaps. An assignment such as 0–2 for one outcome and 4–9 for another omits 3. If two outcomes both include 3, the mapping is ambiguous. Check every digit, not just the total number assigned.
- Checking only that the counts total ten. Counts of 4 and 6 total ten, but they would not correctly represent probabilities of 0.30 and 0.70. Check both the overall total and each outcome’s count.
- Forcing an inexact probability into ten digits. A 35% probability cannot be represented exactly by a whole number of ten digits. Say so and use a larger set of equally likely labels when an exact representation is needed.
- Changing the mapping during the simulation. Decide and check the assignment before generating outcomes. Use that same mapping for every random digit in the simulation.
For a full-credit explanation, name the outcome assigned to each digit or range, show how many labels each outcome receives, and connect those counts to the intended probabilities. Then verify that the full set of labels is covered exactly once. If the probabilities do not fit the available labels, explain the limitation rather than quietly changing the model probabilities.
Check Your Understanding
Assume the digits 0 through 9 are equally likely. For each question, show the count or check that supports your answer.
- A bus arrives before its scheduled time with probability 0.40. How many digits should represent an early arrival? How many represent an arrival that is not early?
- Assign digits to outcomes with probabilities 0.10, 0.60, and 0.30. Give one complete mapping and verify its counts.
- A proposed assignment gives digits 0–3 to outcome A, 3–6 to outcome B, and 7–9 to outcome C. What is wrong with it?
- Why does assigning four digits to an outcome represent probability 0.40 under the single-digit model?
- Can one digit represent an outcome with probability 0.25 exactly? Explain, and name a label-set size that could represent it exactly.