# Simple demonstration with real, rational and integers

1. Oct 6, 2017

### Bestfrog

1. The problem statement, all variables and given/known data
Let $\alpha \in \mathbb{R}$ and $n \in \mathbb{N}$. Show that exists a number $m \in \mathbb{Z}$ such that $\alpha - \frac {m}{n} \leq \frac{1}{2n}$ (1).

3. The attempt at a solution
If I take $\alpha= [\alpha] +(\alpha)$ with $[\alpha]=m$ (=the integer part) and $(\alpha)=\frac{1}{2n}$(=the fractional part) I must have an equality in (1). Substituting, I obtain $m(n-1)=0$ and for $n=1$ I can always find a solution to the problem. Is this demonstration correct? How can I find a more general one?

2. Oct 6, 2017

### scottdave

It looks to be it states: given any alpha & n, can you always find an m wich satisfies it. I don't think you choose alpha in advance.

3. Oct 6, 2017

### Staff: Mentor

I'm not sure what you've done there. The usual approach is to take the inequality $\alpha -\frac{m}{n} \leq \frac{1}{2n}$ and transform it until we get a condition on $m$. That is $m$ on one side, the rest on the other. Now chose an $m$ which always satisfies this condition and write all steps from there on backwards to the condition you want to prove. Since $\alpha$ and $n$ are given, we only need a small enough or big enough $m$ to be chosen.

Long explanation short: Don't bother about the choice of $m$ as long as you don't know what it has to provide.

4. Oct 6, 2017

### Bestfrog

Thanks for the reply.
So, rearranging I have $m \geq \alpha n - \frac{1}{2}$.

Now I have to choose m. I tried different values of $\alpha ,n$ and it seems that the right choice of m is $m=\lfloor{\alpha \cdot n}\rfloor$ (=integer part).

5. Oct 6, 2017

### Staff: Mentor

Don't bother $\alpha$ and $n$. They are given and cannot be chosen. Only $m$ is up to your choice. And don't try to estimate as close as possible, there is no need to do so. It won't be rewarded in this example. The situation is a different one, if you try to estimate numerical calculations or the length of algorithms, but here it isn't needed. I took $m=\lceil \alpha \cdot n \rceil$ so I saved an additional thought on what happens at exactly a difference of $0.5$. You could even chose $m=10\cdot |\alpha n|$, it won't matter here.

Anyway, it is correct. Now you have to write down $m = \lceil \alpha n \rceil \geq \alpha n \geq \alpha n - \frac{1}{2} \Rightarrow \ldots$ and so on, until the last line is $\alpha -\frac{m}{n} \leq \frac{1}{2n}\,$.