23
$\begingroup$

I'm studying for the GRE, and my study book uses a rule that it never justifies for counting numbers in a sequence: "Add $1$ before you're done."

For example, how many multiples of $3$ are between $250$ and $350$? My study book says:

$$ 348 - 252 = 96 $$

$$ \dfrac{96}{3} = 32 $$

Now "add one before you're done":

$$ 32 + 1 = 33 $$

I follow the first few steps. Start and end with $252$ and $348$ because they are the first and last multiples of $3$ within the range, respectively. We divide by $3$ to count only the multiples of $3.$ But why add $1$?

$\endgroup$
6
  • 21
    $\begingroup$ Fenceposts. $\endgroup$
    – porglezomp
    Sep 29, 2015 at 3:54
  • 1
    $\begingroup$ @porglezomp, I can't believe I've never heard of that. A very straightforward analogy. $\endgroup$
    – jds
    Sep 29, 2015 at 11:17
  • 4
    $\begingroup$ Counting from $0$ to $1$, we get $\{0,1\}$ which contains two numbers, even though $1-0=1$ $\endgroup$ Sep 29, 2015 at 15:22
  • 2
    $\begingroup$ Of course, Dijkstra had opinions on the subject. $\endgroup$
    – mudri
    Sep 30, 2015 at 10:59
  • $\begingroup$ Related question. $\endgroup$ Sep 30, 2015 at 11:29

4 Answers 4

82
$\begingroup$

Arrgh. This apparently was written by someone who thinks that mathematics is merely arbitrary rules to be memorized rather than something to be understood.

It starts by finding the distance between two multiples of $3$, then divides that distance by $3.$ In doing this, you are not calculating multiples of $3$, you are calculating the number of gaps of size three between the multiples. But the multiples themselves are the "fenceposts" that create the gaps. And there has to be one more "fencepost" than gap, to form the ends. For example:

  • $0,3$. Distance = $3 - 0 = 3$, number of gaps = $3/3 = 1$, number of multiples = $2 = 1 + 1$.
  • $0,3,6$. Distance = $6 - 0 = 6$, number of gaps = $6/3 = 2$, number of multiples = $3 = 2 + 1$.
  • $3, 6, 9, 12$. Distance = $12 - 3 = 9$, number of gaps = $9/3 = 3$, number of multiples = $4 = 3 + 1$.
$\endgroup$
4
  • 29
    $\begingroup$ +1 for the first paragraph (not that there's anything wrong with the rest of the post). $\endgroup$
    – anomaly
    Sep 29, 2015 at 11:57
  • $\begingroup$ Never heard of this rule before. Great explanation. I assume that rule only works if both the start and end point of the range are multiples of 3? Does it also work for any other numbers? $\endgroup$ Sep 29, 2015 at 14:02
  • 4
    $\begingroup$ It does require that the start and end points are adjusted to exact multiples, the "discard the remainder" approach suggested by Jacob is not reliable. Consider: How many multiples of 7 are in the interval [6,8]? Now, how many in the interval [1,13]? Or [8,10]? $\endgroup$
    – Ben Voigt
    Sep 29, 2015 at 18:26
  • $\begingroup$ I should admit I had never heard it described as "fenceposts" before either (that I remember). I only used the term to tie into porglezomp's comment on the OP. $\endgroup$ Sep 29, 2015 at 22:12
12
$\begingroup$

There are just as many multiples of $3$ between $252$ and $348$ (inclusive) as there are between $0$ and $348-252$, that is, $0$ and $96$. Now what one does is a matter of taste.

The number between $0$ and $96$ is the same as the number from $3$ to $99$, which is the same as the number of integers between $1$ and $33$.

Or else there are $32$ between $3$ and $96$. But don't forget about $0$.

Or else there are just as many as there are integers from $0$ to $32$. Again, don't forget about $0$. There are $33$ of these.

Remark: I prefer to figure it out each time. Rules are hard to remember. But I am lucky. I don't have to solve too many too easy questions in too little time.

$\endgroup$
1
  • 3
    $\begingroup$ +1 for Remark Programmers know this as the fencepost or one-off problem. It is one of the most common coding mistakes $\endgroup$ Oct 1, 2015 at 20:23
7
$\begingroup$

Whenever you want to count the number of things, align it to the sequence $1, 2, \ldots$.

In the sequence $1,\ldots,n$, there are exactly $n$ items. This should be abundantly clear.

In the sequence $0,\ldots,n$, there are exactly $n+1$ items. This should be abundantly clear once you understand the first statement.

When you ask "How many numbers are there between 30 and 40?" and you answer "10" instinctively, you've done subtraction. Subtraction starts you at 0, not 1 -- if we subtract 30 from every number between 30 and 40, the sequence becomes $0, \ldots, 10$.

Instead of subtracting the first number, I always subtract the number that gets me to 1 -- here, 29 (i.e., 30-29=1). And 40-29 is 11. Or, if you prefer, just add 1 to 10, in parallel to the $0,\ldots,10$ argument.

$\endgroup$
2
$\begingroup$

You can use the idea of Arithmetic Progression.

$$t_n=a+(n-1)d$$ in any arithmetic progression where $t_n$ is the $n-th$ term which readily implies that $n\in\mathbb Z$.

For your first example. Between $250$ and $350$ the first multiple of $3$ is $252$ and the last multiple is $348$ and this forms an AP. So, we can write-$$348=252+(n-1)\times3$$ Solving you readily get $n=33$.

$\endgroup$
3
  • $\begingroup$ Funnily, whenever I need to count for instance the number of even numbers between $n$ and $m$ (such as counting the number of students who took some exam based on their student numbers), this is what I end up doing in my head :) $\endgroup$ Feb 20, 2022 at 19:12
  • 1
    $\begingroup$ @MaximilianJanisch I just browsed through your website. You are an inspired mathematician! All the best for your endeavours :) $\endgroup$
    – Soham
    Feb 22, 2022 at 14:23
  • 1
    $\begingroup$ Thank you! (Btw, if you mean maximilianjanisch.com, that site is about one year outdated, I will have to update it soon 😅; this one is more up to date: math.uzh.ch/index.php?id=people&key1=16606) $\endgroup$ Feb 22, 2022 at 14:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .