Testwiki:Reference desk/Archives/Mathematics/2020 June 16

From testwiki
Revision as of 01:47, 24 June 2020 by imported>Scsbot (edited by robot: archiving June 16)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Template:Error:not substituted

{| width = "100%"

|- ! colspan="3" align="center" | Mathematics desk |- ! width="20%" align="left" | < June 15 ! width="25%" align="center"|<< May | June | Jul >> ! width="20%" align="right" |Current desk > |}

Welcome to the Wikipedia Mathematics Reference Desk Archives
The page you are currently viewing is a transcluded archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


June 16

How to reduce a polynomial modulo using exponentation by squaring?

I try to understand how does the AKS primality test work and I was told that I need to reduce to polynomial (x+a)^n-(x^n+a) modulo (n,x^r-1) using exponentation by squaring, but I don't understand how I can use it. Could anyone please explain this to me? Thanks! — Preceding unsigned comment added by Uri Gluck (talkcontribs) 18:44, 16 June 2020 (UTC)

(In haste.) For a start, see the article Exponentiation by squaring. The article Modular arithmetic has near the end a C function implementing this in modular arithmetic, but the logic is the same for any ring; notice that you only need modular reduction for the multiplication operation. The (modn) bit means you can treat all polynomial coefficients as members of 𝐙n and therefore represent them by integers in the range 0..n1. The (modxr1) bit means that all polynomials can be reduced to have degree less than r, because xsxsr(modxr1) since xs=xsr(xr1)+xsr for sr. This means that all exponents can be treated as elements of 𝐙r.  --Lambiam 02:47, 17 June 2020 (UTC)