how to calculate $ \bmod 2 \pi$

176 Views Asked by At

Context: I wanted to calculate $ \sin( \frac{ \pi (n!)^2}{k})$ through calculating $\frac{ \pi (n!)^2}{k} \bmod 2\pi$

(n!)^2 is too big so I wondered if it was possible to take $\bmod 2 \pi$ at every multiplication. using the fact, that $ (a \bmod c) * (b \bmod c) = ((a * b) \bmod c) $ but that doesn't work in this case since for example: $ a = (7 \bmod 2\pi) \approx 0.716815 $

$ b = (8 \bmod 2\pi) \approx 1.71681$

$ a * b \approx 1.23064$ but $(8 * 7 \bmod 2 \pi) \approx 5.73452$

I also don't understand, what $\frac{1}{k} \bmod 2\pi $ means.

1

There are 1 best solutions below

0
On BEST ANSWER

This may not be pitched at the right level.

The reason multiplication goes wrong is that you are really only able to reduce addition modulo $2\pi$ by working with the additive group $\mathbb R/2\pi \mathbb Z$. The reason multiplication will not work boils down to the fact that $2\pi \mathbb Z$ is not an ideal of $\mathbb R$.

To see this more concretely, take $a + 2\pi m$ and $b + 2\pi n$. Their product is $$ab + 2\pi mb + 2\pi an + (2\pi)^2 mn$$ We would really like to be able to work modulo $2\pi$ to remove all the multiples of $2\pi$, but the problem is that we only allow ourselves to treat integer multiples of $2\pi$ as $0$, but in general none of the terms on the right will be integer multiples of $2\pi$.

In your case, you are able to take $a,b$ to be integers, but there is no way to "fix" the $(2\pi)^2 mn$ in this situation, except if $m$ or $n$ is zero (clearly there's no problem in that situation - for instance if $m=0$ then the product is $ab + 2\pi an$ which does equal $ab$ mod $2\pi$ if $a$ is an integer).