5

I am looking for how to find integer approximations to scalar multiples of real valued vectors. This is close to the problem of finding a best rational approximation to a real number, but kind of generalized. Given an integer $k$, I would like to find an integer vector $z=(z_1, ..., z_n)\approx \lambda x$ for some $\lambda \ne 0$ which satisfies:

  1. $|z-\lambda x|$ is minimized.
  2. $z_i\leq k$ for all $i=1, ..., n$
  3. $\max_i z_i$ is minimized if there are multiple solutions that satisfy the above.

So, for example, given $x=(\pi, 2\pi)$ and $k=2$, a solution would be $(1, 2)$. I thought that something with continued fractions would work in the case where $n=2$ but I'm not sure how to generalize that for larger values of $n$.

EDIT

If it helps, I have a little bit more information about $x$. $x$ is a solution to $Ax=0$ where $A$ is $m\times n$ with $m=n-1$. The solution to this is given parametrically as $x=s(1, x_2, x_3, ..., x_n)$, and then I set $s=1$ to obtain $x=(1, x_2, ..., x_n)$. This is the $x$ that I am looking for the corresponding $z$ for in the problem above. So alternatively, I could say that I am looking for an integer valued "near-solution" to $Ax=0$. Maybe there is a different approach to my problem using this information? Although a general solution to the above problem that doesn't make use of this extra information would be nice both for application and to satisfy my curiosity.

crf
  • 5,551

1 Answers1

0

This is not a solution to your problem, but longer than a comment which hopefully may be of use to you.

Consider you linear system $Ax=0$. Apply row operations to bring it reduced row echelon form $Rx=0$. Approximate all entries of $R$ with rational numbers as accurately as you like. This produces a perturbed matrix $R'$ with rational entries. Solve the linear system $R'x'=0$, using, say, $x'_n = 1$. This gives you a rational solution $x'$ of a linear system which is "close" to yours. Whether $x'$ is close your $x$ hinges on how ill-conditioned the original linear system is, but you can always compensate by doing a better approximation of $R$. Returning to $x'$. Consider all the denominators of the components of $x'$. Obtain the least common multiple $m$ of those numbers and compute $y = m \cdot x'$. You now have an integer solution $y$ of $R'y=0$. Obviously, the entries of $y$ may be very large, so you will want to divide with the greatest common divisor.

Carl Christian
  • 12,583
  • 1
  • 14
  • 37