Estimating upper bound for cardinality of this set of integer pairs

93 Views Asked by At

Suppose we fix positive integers $m,n \in \mathbb{N}$ and $C > 0$. How can we estimate the size of the set $$\{(a,b)\mid(a,b)\in\left[0,m\right]\times\left[0,n\right]\cap\mathbb Z^2, \, \, |an-bm| < C \}$$ in terms of $m,n,C$? An effective upper estimate would also work, other than the trivial upper bound $(m+1)(n+1)$.

1

There are 1 best solutions below

1
On BEST ANSWER

Let $r = \sqrt{m^2+n^2}$. Now, $\dfrac1r |xn-ym|$ is the distance from $(x,y)$ to the line $xn-ym=0$.

Now, we estimate by measuring the area of the region satisfying the inequality.

The area inside the green region enclosed by the rectangle of size $m \times n$ is, by similar triangles:

$$\displaystyle mn \left(1 - \left(1-\frac{\frac Cr}{\frac1r|(0)n-(n)m|}\right)^2\right) = mn \left(1 - \left(1-\frac{C}{mn}\right)^2\right) = 2C - \frac{C^2}{mn}$$

But then of course, if $C > mn$, then the area would be $mn$.

Since the trivial upper bound is $(m+1)(n+1)$, we can multiply the correcting factor $\dfrac{(m+1)(n+1)}{mn}$ to our two expressions instead of calculating the area of the green region enclosed by the larger rectangle.

Conclusion:

$$f(m,n,C) \approx \begin{cases}\dfrac{(m+1)(n+1)}{mn}\left(2C-\dfrac{C^2}{mn}\right) & C \le mn \\ (m+1)(n+1) & C > mn\end{cases}$$