Counting in exclusion and inclusion range

An SAT micro-topic explainer. Free to read — no account needed.

Counting the items in a range has a famous trap: the off-by-one error.
It happens because you must decide whether the two endpoints are included in the count or not.
Simply subtracting the endpoints often gives the wrong answer.
When both endpoints are included, the count is b−a+1b - a + 1.
For example, the years from 20122012 to 20192019 inclusive number 2019−2012+1=82019 - 2012 + 1 = 8, not 77.
You add the extra 11 to count the starting year itself.
counting_range.png
This shows up in sequences, where the terms are numbered n=1,2,3,…n = 1, 2, 3, \dots.
If a sequence starts in a given year at n=1n = 1, then the value at term nn is start+(n−1)\text{start} + (n - 1).
The (n−1)(n - 1) is the inclusive-counting idea again: the first term adds nothing.
A related question asks how many steps or events happen across a span.
There you divide the length of the span by the size of each step.
For instance, if something doubles every 50005000 cycles from cycle 10,00010{,}000 to cycle 25,00025{,}000, it doubles 25,000−10,0005000=3\frac{25{,}000 - 10{,}000}{5000} = 3 times.

Worked examples

How many integers are there from 33 to 99, inclusive?
Since both endpoints are included, use b−a+1b - a + 1.
So it is 9−3+1=79 - 3 + 1 = 7 integers.
A sequence starts in 20152015, which is term n=1n = 1. What year is term n=11n = 11?
The year at term nn is start+(n−1)\text{start} + (n - 1).
So it is 2015+(11−1)=20252015 + (11 - 1) = 2025.
A quantity doubles every 50005000 cycles, from cycle 10,00010{,}000 to cycle 25,00025{,}000. How many times does it double?
Divide the span by the step size: 25,000−10,0005000\frac{25{,}000 - 10{,}000}{5000}.
So it doubles 15,0005000=3\frac{15{,}000}{5000} = 3 times.

Is this one of the topics costing you points?

Take the free 10-question diagnostic for a predicted SAT score and a breakdown of which domains are costing you points.

Predict your SAT score →