Represent a 27% Event with Two-Digit Numbers
In Simulating Events with Equal Probabilities, you used one label for each equally likely outcome. When an event is less likely than its complement, assigning one label to each category may not represent the probability accurately. A two-digit number model lets us assign different numbers of labels to the two outcomes.
Suppose a batter gets a hit on 27% of at-bats. For a simple simulation, model each at-bat with one randomly generated integer from 00 through 99. There are 100 possible two-digit labels, and each is equally likely. Assign 27 labels to “hit” and the remaining 73 to “no hit.” One convenient assignment is 00 through 26 for a hit and 27 through 99 for no hit.
The hit labels are 00, 01, 02, and so on through 26. Counting both endpoints gives \(26-0+1=27\) labels. The no-hit labels are 27 through 99, giving \(99-27+1=73\) labels. Together, the two groups account for all 100 possible outcomes, with no overlap or gap.
The assignment of which specific labels mean “hit” is a choice; what matters is assigning exactly 27 of the 100 equally likely labels to a hit. For instance, 00–26 could represent no hit instead, as long as the complementary 73 labels represent a hit. In this tutorial, use 00–26 for a hit so that examples follow one consistent rule.
Generate Trials with randInt
On a TI-84, randInt(lower, upper, number of values) generates random integers from the lower endpoint through the upper endpoint. Use randInt(0,99,n) to generate \(n\) values. Each generated value represents one at-bat. When reading or recording the results, write every value with two digits: for example, write 4 as 04. This keeps the labels clear and matches the 00–99 assignment.
For example, randInt(0,99,20) produces 20 values, so it simulates 20 at-bats. Classify each value using the same rule: 00 through 26 is a hit, and 27 through 99 is no hit. Count the hit values, then divide by the total number of simulated at-bats to find the relative frequency.
This relative frequency estimates the probability under the model. It does not replace the model probability of 0.27 or guarantee that 27% of any particular number of simulated at-bats will be hits. As in The Law of Large Numbers in Simulations, relative frequencies tend to settle near the model probability over many repeated trials, but random variation remains in a particular run.
Check the Assignment Before Running the Simulation
A quick boundary check helps confirm that the labels represent the intended probability. The first hit label, 00, should count as a hit; the last hit label, 26, should also count. The next label, 27, should count as no hit. The final label, 99, should count as no hit. These checks catch common off-by-one errors, such as accidentally assigning 26 labels instead of 27.
For the batter model, one trial is one at-bat and the event is getting a hit.
Use 00–26 for a hit and 27–99 for no hit. Check that there are 27 hit labels and 73 no-hit labels.
Use randInt(0,99,n) to simulate \(n\) at-bats, recording each result as a two-digit label.
Count every generated value from 00 through 26 as a hit; all other values are no hits.
Divide the hit count by the total number of simulated at-bats and describe the result as a relative frequency from this run.
Worked Example: Classify a Set of Two-Digit Outcomes
A batter’s hit probability is modeled as 0.27. A student has assigned 00–26 to a hit and 27–99 to no hit. Classify these ten generated outcomes and calculate the simulated relative frequency of hits:
Classify: The values 04, 18, 00, and 26 are between 00 and 26, inclusive, so they represent hits. The other six values—63, 27, 91, 42, 76, and 35—represent no hits. In particular, 27 is not a hit because the hit range ends at 26.
Calculate: There are 4 hits among 10 simulated at-bats. Therefore:
Run and Interpret a Full Simulation
The following example uses the same hit assignment but begins with a fresh set of generated values. A full description states what one trial represents, how the random numbers are assigned, how many trials are run, and how the result is interpreted.
Worked Example: Simulate 20 At-Bats for a Batter
A batter has a modeled hit rate of 27%. Use two-digit random numbers to simulate 20 at-bats and estimate the batter’s hit probability from the following illustrative calculator results.
Do: The simulated outcomes are:
The values from 00 through 26 are 04, 18, 00, 26, 11, 24, 07, and 20. That is 8 hits. The other 12 values are no hits. The simulated relative frequency is:
The result of 0.40 is not evidence that the digit assignment was wrong: the number labels still give exactly 27 out of 100 possible outcomes to a hit. Nor should you change the hit range after seeing a run to make the simulation result closer to 0.27. Define the model first, then apply its rule consistently to every generated value.
Combine Batches Without Losing the Tally
If generating a large number of values at once is inconvenient, generate smaller batches and keep a running total. The batches are parts of one simulation when you use the same model and add their trial counts and hit counts. Do not discard an earlier tally or use only the last batch when calculating the relative frequency for the full run.
Worked Example: Combine Three Batches of At-Bats
A student simulates 30 at-bats for a batter with modeled hit probability 0.27, generating three batches of 10 values. Use the 00–26 hit rule to find the total number of hits and the simulated relative frequency.
First batch: The values are 73, 12, 28, 05, 44, 26, 81, 19, 60, and 33. The hits are 12, 05, 26, and 19, for 4 hits.
Second batch: The values are 02, 97, 21, 54, 17, 39, 00, 68, 25, and 46. The hits are 02, 21, 17, 00, and 25, for 5 hits. The running total is \(4+5=9\) hits in 20 at-bats.
Third batch: The values are 88, 14, 30, 09, 72, 23, 51, 06, 27, and 95. The hits are 14, 09, 23, and 06, for 4 more hits. The total is \(9+4=13\) hits in \(20+10=30\) at-bats.
The relative frequency across all three batches is:
Use the Same Method for a Spinner
The method also works for a spinner with a 27% chance of landing on a specified color, provided the model treats the 100 two-digit outcomes as equally likely. For example, assign 00–26 to blue and 27–99 to all other colors. One trial is one spin, and each generated number represents the spinner’s outcome category. Count a blue result whenever the number is in the assigned range.
The key is to match the number of labels to the event probability, not to give every category the same number of labels. If a spinner has several different colors, assign each color a number of labels corresponding to its probability, making sure the assignments cover 00–99 exactly once. For a single 27% event, the complement receives the other 73 labels.
Common Mistakes and AP Exam Tips
- Assigning 26 labels instead of 27. The range 00–26 includes 27 integers because both endpoints count. Show or check the count, not just the difference between endpoints.
- Treating 27 as a hit. Under this tutorial’s assignment, 26 is the last hit label and 27 is the first no-hit label. State the boundary clearly and apply it consistently.
- Forgetting the leading zero. The generated integer 4 represents the two-digit label 04, which is a hit. Writing outcomes with two digits makes their place in the assigned ranges easier to see.
- Using the wrong number of trials. In randInt(0,99,20), the final argument means 20 generated values, so it represents 20 at-bats when one value is one at-bat. Do not treat the 20 values as one trial.
- Changing the assignment after seeing the outcomes. Decide which labels represent the event before generating or inspecting results. Adjusting the rule to improve a result no longer follows the stated model.
- Calling a relative frequency the exact probability. Give the hit count and total, then describe the quotient as an estimate from that simulated run. The model probability is 0.27; a particular run’s relative frequency can differ.
- Dropping earlier batches. When combining batches, add both the hits and the total number of trials. The denominator for three batches of 10 is 30, not 10.
For a clear AP-style explanation, identify the trial and event, show that the assignment gives 27 of 100 labels to the event, specify how many values are generated, and explain how the tally becomes a relative frequency. A complete interpretation names the simulated context and makes clear that the result estimates, rather than determines, the model probability.
Check Your Understanding
For each question, use the model that assigns 00–26 to a hit and 27–99 to no hit.
- How many labels represent a hit, and how many represent no hit?
- Does 26 represent a hit? Does 27? Explain using the assigned ranges.
- What does randInt(0,99,40) represent if one trial is one at-bat?
- In 40 simulated at-bats, a batter gets 11 hits. Calculate the simulated relative frequency and describe what it estimates.
- A student simulates two batches of 10 at-bats and observes 3 hits in the first batch and 4 in the second. What is the relative frequency across all 20 at-bats?
- Why can the relative frequency from a short simulation differ from the model probability of 0.27?