Show that the number of multiples of $m$ in $[1, x]$ is $\lfloor \frac{x}{m} \rfloor$

74 Views Asked by At

I'm self-studying number theory using "A Computational Introduction to Number Theory and Algebra" by Victor Shoup, and this trivially-looking exercise throws me off:

Let $m$ $\in$ $\mathbb{Z}$, $m$ $\gt$ 0; $x$ $\in$ $\mathbb{R}$, $x$ $\ge$ 1. Show that the number of multiples of $m$ in $[1, x]$ is $\lfloor \frac{x}{m} \rfloor$

Let's take $x = 4.0$ and $m = 2$. Then $\lfloor \frac{x}{m} \rfloor = 2$. But I don't see two multiples of $m$ in $[1, 4.0]$:

  • first multiple goes from 1 to 3
  • second multiple goes from 3 to 5, and 5 $\notin [1, 4.0]$

What am I missing? This feels so elementary I'm even ashamed of asking

2

There are 2 best solutions below

2
On BEST ANSWER

I see exactly two multiples of $2$ in $[1,4]$: $2$ and $4$. Which concept of multiple are you using?

In the general case, the multiples of $m$ in $[1,x]$ are $m,2m,\ldots,\left\lfloor\frac xm\right\rfloor$. The nest multiple of $m$ is $\left(\left\lfloor\frac xm\right\rfloor+1\right)m$, which is greater than $x$.

0
On

The multiples of $m=2$ are: $\{2,4,6,8,...\}$.

The closed interval $[1,x] = [1,4]$ contains 2 of these multiples, namely $\{2,4\}$.

This is the same as $\lfloor \frac{x}{m} \rfloor = \lfloor \frac{4}{2} \rfloor = 2$.