Here is the problem:
The number of positive integers less than or equal to $x$, where $x$ is a positive real number, that are divisible by the positive integer $d$ equals $\big\lfloor{\frac{x}{d}}\big\rfloor$.
I was wondering if the following proof is valid. I made this proof prior to reading the book's proof, which is definitely shorter than the one I wrote, but seems to follow the same idea. However, I think the book's proof is less clear as to why the result $\big\lfloor{\frac{x}{d}}\big\rfloor$ is true. I provided the book's proof after my own.
Consider the sequence of integers $1, 2, \dots, \lfloor{x}\rfloor, x$ where $x$ is a positive real number. Divide the sequence into $q$-subsequences of length $d$ to get
$$1, 2, \dots, d$$
$$d+1, d+2, \dots, 2d$$
$$.$$
$$.$$
$$.$$
$$(q-1)d+1, \dots, qd$$
Since $qd$ is the largest multiple of $d$, we know that
$$\lfloor{x}\rfloor = qd + r $$
where $0 \leq r < d$.
By the division algorithm, we define $q$ explicitly as
$$q = \bigg\lfloor{\frac{\lfloor{x}\rfloor}{d}}\bigg\rfloor = \Big\lfloor{\frac{x}{d}}\Big\rfloor$$
Consequently, the set $\{d, 2d, \dots, qd\}$ has precisely $q = \Big\lfloor{\frac{x}{d}}\Big\rfloor$ terms, as desired.
Book's Proof. The positive integers divisible by the positive integer $d$ are those integers of the form $kd$ where $k$ is a positive integer. The number of these that are less than $x$ is the number of positive integers $k$ with $kd \leq x$, or equivalently with $k \leq \frac{x}{d}$. There are $\big\lfloor{\frac{x}{d}} \big\rfloor$ such integers.
Best Answer
First, you’re right in thinking that it’s essentially the same idea. It’s also basically correct, but it could stand a bit of reorganization. Specifically, it would be better to begin by applying the division algorithm to $\lfloor x\rfloor$ and $d$. And if I were giving a proof more detailed than the one in the book, I’d probably also go into a bit more detail about the manipulation of the floor function. Making those changes but otherwise trying to stay as close as possible to your basic approach, I might end up with something like this: