finite field to rational fraction

1.3k Views Asked by At

Suppose I have a number $n\in\mathbb F_p$, i.e. an element of the finite field obtained by arithmetic modulo some (odd) prime $p$. I'm looking for a way to find a simple description of $n$ as a fraction $\frac ab$. In other words, I'd like a way to obtain integers $a,b$ with

$$ bn = a \pmod p $$

Obviously $a=n, b=1$ is one solution, but I'd like to find the pair which minimizes $\lvert ab\rvert$, which roughly corresponds to minimizing the number of digits involved in writing this down. $b$ must not be a multiple of $p$, though, as that would represent a division by zero in $\mathbb F_p$. I'd expect every result to satisfy the following constraints, which simply boils down to choosing signs reasonably, and canceling common factors:

\begin{gather*} \tfrac{1-p}{2} \leq a \leq \tfrac{p-1}{2} \\ 0 < b \leq \tfrac{p-1}{2} \\ \gcd(a, b) = 1 \end{gather*}

One possible way is enumerating all fractions satisfying the above conditions, and building a dictionary from these where $n$ can be looked up. But that becomes unfeasible for larger $p$.

Is there some better algorithm to find $a$ and $b$?

1

There are 1 best solutions below

0
On BEST ANSWER

There's a paper here1 which says Thue proved if $a$, $b$ and $m$ are relatively prime, then $$ax-by\equiv0\pmod m$$ can be solved by integers $x$ and $y$ such that $|x|\le\sqrt m$, $|y|\le\sqrt m$.

$a=1$, $b=n$ reduces to your congruence. The result's not exactly what you want, but surely Thue's method of proof will get you what you want.

1 Alfred Brauer and T. L. Reynolds: On a theorem of Aubry-Thue, Canad. J. Math. 3(1951), 367-374. http://dx.doi.org/10.4153/CJM-1951-042-6