ebooksgratis.com

See also ebooksgratis.com: no banners, no cookies, totally FREE.

CLASSICISTRANIERI HOME PAGE - YOUTUBE CHANNEL
Privacy Policy Cookie Policy Terms and Conditions
Number-theoretic transform - Wikipedia, the free encyclopedia

Number-theoretic transform

From Wikipedia, the free encyclopedia

The number-theoretic transform (NTT) is similar to the discrete Fourier transform, but operates with modular arithmetic on integers instead of complex numbers.

Contents

[edit] Definition

The discrete Fourier transform is given by

f_j=\sum_{k=0}^{n-1}x_k\left(e^{-\frac{2\pi i}{n}}\right)^{jk}\quad\quad j=0,\dots,n-1

The number-theoretic transform operates on a sequence of n numbers, modulo a prime number p of the form p=ξn+1, where ξ can be any positive integer.

The number e^{-\frac{2\pi i}{n}} is replaced by a number ωξ where ω is a "primitive root" of p, a number where the lowest positive integer n such that ωn=1 is n=p-1. There should be plenty of ω which fit this condition. Note that both e^{-\frac{2\pi i}{n}} and ωξ raised to the power of n are equal to 1 (mod p), all lesser positive powers not equal to 1.

The number-theoretic transform is then given by

f(x)_j=\sum_{k=0}^{n-1}x_k(\omega^\xi)^{jk}\mod p\quad\quad j=0,\dots,n-1

The inverse number-theoretic transform is given by

f^{-1}(x)_h=n^{p-2}\sum_{j=0}^{n-1}x_j(\omega^{p-1-\xi})^{hj}\mod p\quad\quad h=0,\dots,n-1

Note that ωp-1-ξ=ω-ξ, the reciprocal of ωξ, and np-2=n-1, the reciprocal of n. (mod p)

[edit] Properties

Most of the important attributes of the DFT, including the inverse transform, the convolution theorem, and most fast Fourier transform (FFT) algorithms, depend only on the property that the kernel of the transform, e^{-\frac{2\pi i}{n}}, is a primitive root of unity. Since that same property holds for ωξ, it immediately follows that the NTT has the same useful attributes — the proofs are identical.

In particular, the applicability of O(nlogn) FFT algorithms to compute the NTT, combined with the convolution theorem, mean that the NTT gives an efficient way to compute exact convolutions of integer sequences. While the DFT can perform the same task, it is susceptible to round-off error in finite-precision floating point arithmetic; the NTT has no round-off because it deals purely with integers that can be exactly represented, although arithmetic overflow is still a possibility.

[edit] Proof of inverse NTT

More explicitly, the inverse works because \sum_{k=0}^{n-1}z^k is n for z=1 and 0 for all other z where zn=1. A proof of this (should work for any division algebra) is

z\left(\sum_{k=0}^{n-1}z^k\right)+1=\sum_{k=0}^nz^k
z\sum_{k=0}^{n-1}z^k=\sum_{k=0}^{n-1}z^k (subtracting zn=1)
z=1\ \mathrm{if}\ \sum_{k=0}^{n-1}z^k\ne 0 (dividing both sides)

If z=1 then we could trivially see that \sum_{k=0}^{n-1}z^k=\sum_{k=0}^{n-1}1=n. If z≠1 then the right side must be false to avoid a contradiction.

It is now straightforward to complete the proof. We take the putative inverse transform of the transform.

f^{-1}(f(x))_h=n^{p-2}\sum_{j=0}^{n-1}\left(\sum_{k=0}^{n-1}x_k\left(\omega^\xi\right)^{jk}\right)(\omega^{p-1-\xi})^{hj}\mod p
f^{-1}(f(x))_h=n^{p-2}\sum_{j=0}^{n-1}\sum_{k=0}^{n-1}x_k(\omega^\xi)^{jk-hj}\mod p
f^{-1}(f(x))_h=n^{p-2}\sum_{k=0}^{n-1}x_k\sum_{j=0}^{n-1}(\omega^{\xi(k-h)})^j\mod p
f^{-1}(f(x))_h=n^{p-2}\sum_{k=0}^{n-1}x_k\left\{\begin{matrix}n,&k=h\\0,&k\ne h\end{matrix}\right\}\mod p (since ωξn=1)
f^{-1}(f(x))_h=n^{p-2}x_hn\mod p
f^{-1}(f(x))_h=x_h\mod p (by Fermat's little theorem)

[edit] See also

[edit] External links

Languages


aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu -