Value of $\pi$ modulo a prime

162 Views Asked by At

Given a radius of a circle r and a prime p, you need to tell, what would be the area $A$ of this circle modulo p (the statement of the problem also gives an example: $r = 1, p = 7, A = 3$.

The solution of this problem uses the regular formula for the circle area: $$A = \pi r^{2}$$ However it uses the polynomial ring ${\mathbb{Z}}_{p}[X]$ to find an $a \equiv \pi\pmod p$. First it find an inverse of the polynomial $f(x) = x^{2}+1$: $$g(x)\equiv\frac{1}{x^{2}+1}\pmod p,$$ using the Fast Fourier Transform. Then it computes the integral of $g(x)$, since $$\int \frac{1}{x^2+1}dx=\arctan(x)$$ The final step is to calculate $a\equiv\pi\equiv4\arctan(1)\equiv4G(1)\pmod p$

I know how the Fourier Transform works. I also know that you normally would use the Extended Euclidean Algorithm to compute the inverse of a polynomial modulo another polynomial. So I'm just confused, how would you compute an inverse of a polynomial modulo a prime integer? The solution also suggests that $\deg(g(x))=p-2$.

1

There are 1 best solutions below

0
On

Your question seems to have been answered. Refer: Can you do modulos with irrational numbers?

Basically, $$a\equiv\pi\equiv4\arctan(1)\equiv4G(1)\pmod p$$

in your computations could in fact be construed to mean,

$$a \% p = \pi \% p = 4\arctan(1)\%p = 4G(1)\%p$$

As is stated, it becomes senseless otherwise, since we can't find the multiplicative inverse of $\pi\pmod p$ or do this for any transcendental or irrational number.