SlideShare uma empresa Scribd logo
1 de 10
Baixar para ler offline
CHIPTEB 7
Polynomials and the FFT
—=C;=——=€;=——=C;=——«;’“;=——=Q=——=Q=——=C;=——q:=r———4;=n—
2.3.1. Polynomials
A polynomial in the variable x over an algebraic fieldF is a function A(x)
that can be represented as follows:
.-I—|
Alfx] = ELM! .
.I 0
We call n the degree-bound of the polynomial, and we call the values a0, a1,
. ., an - l the coefficients of the polynomial. The coefficients are drawn from the
field F, typically the set C of complex numbers. A polynomial A(x) is said to
have degree k if its highest nonzero coefficient is 011.. The degree of a polynomial of
degree-boundn can be any integer between 0 andn - 1, inclusive. Conversely, a
polynomial of degree k is a polynomial of degree-bound n for any n > k.
There are a variety of operations we might wish to define for polynomials.
For polynomial addition, if A (x) andB (x) are polynomials of degree-bound n, we
say that their sum is a polynomial C (x), also of degree-bound n, such that C (x) :
A (x) + B (x) for all x in the underlying field. That is, if
.‘I—l
AU} = E of?"
JI:-.'L"
and
.'.'—]
8-inch = Z opt! .
_r II
then
:.-—|
("it“) = Z :rI.I-' ,
Fr.
where cj=aj+bjforj= 0,1, . . .,n- 1. For example, ifA(x) = 6x3+ 7X2- le+ 9
and B(x) = -2x3+ 4x - 5, then C(x) = 4x3+ 7x2- 6x + 4.
For polynomial multiplication, if A(x) and B(x) are polynomials of degree-
bound n, we say that their product C(x) is a polynomial of degree-bound 2n - 1 such
that C(x) =A(x)B(x) for all x in the underlying field. You have probably multiplied
polynomials before, by multiplying each term in A(x) by each term in B(x) and
combining terms with equal powers. For example, we can multiply A(x) = 6x3 + 7x2 -
10x + 9 and B(x) = -2x3+ 4x - 5 as follows:
6x3+ 7x2- 10x + 9
- 2x3 + 4x - 5
- 30x3- 35x2+ 50x - 45
24x4+ 28x3- 40x2+ 36x
- 12x6- 14x5+ 20x4 -18x3
- 12x6- 14x5+ 44x4- 20x3- 75x2+ 86x - 45
Another way to express the product C (x) is
3.1.";
Clfix} = Z c,.-.r-' .
3:0
where
c, — Elam): ,1. _
11"”)
Note that degree(C) = degree(A) + degree(B), implying
degree-bound(C) = degree-bound(A) + degree-bound(B) - 1
5 degree-bound(A) + degree-bound(B).
We shall nevertheless speak of the degree-bound of C as being the sum of
the degree-bounds of A and B, since if a polynomial has degree-bound kit also has
degree-bound k + 1.
2.3.2. Representation of polynomials
The coefficient and point-value representations of polynomials are in a
sense equivalent', that is, a polynomial in point-value form has a unique
counterpart in coefficient form.
Coefficient representation
A coefficient representation of a polynomial of degree-bound n is a
vector of coefficients a = (a0, a1, . . ., an-1). In matrix equations in this chapter,
we shall generally treat vectors as column vectors.
A(x) = an + alx + azxz +---+ an_1x"'1
3(1): bc| + blx + bzxz + ---+ bn_1x"‘1
Add : O(n) arithmetic operation
A(x) + B[x) = (a0 + bu ) + (a1 + b1)x + ---+ (an_1 + bn_1)x"_1
Evaluate. O (11) using Horner’s method
A(x) = no + (36(01 + 1:012 + -“+ I (an—2 + x (an—1119)
Multiply. 0 (n2) using Brute force algo
211—2 i
A(x) x 3(x) = Z cL-xi , where Ci = Z ajbi_j
5:0 jzo
Point-value representation
Fundamental theorem of algebra: A degree n polynomial with complex
coefficients has exactly 11 complex roots.
Corollary. A degree n — 1 polynomial A(x) is uniquely specified by its
evaluation at n distinct values of x
A(x) = (Ind/01 , (xfl—lJyfl—l)
B (x) = (xurzu ), : (In—1: Zn—l)
Add. O(n) arithmetic operations.
A(x) + BC?!) = (150.370 + 20). "':(xn-1:yn-1 + Zn-l)
Multiply (convolve). E) (11), but need 2n — 1 points.
A(x) X 305) = (350.310 X 20): "'. (x2n—11y2n—1 X 2211—1)
Evaluate. O(nZ) using Lagrange’s fomiula.
11—1 [.1 . x 7 x-
Arx) = y (—J"‘ ’ )2:” k Hjtk xk 7 xi
Theorem. For any set
Converting between two representations: brute force
Point-value => coefficient
x0, ---.xn_1 a0 + alx + + an_1x”“1Given n distinct points , Evaluate it at n
distinct points
l :01 XS - - - xfif ' .51.; 1'11.
1 x1 .1; - - - 1'1"] 111 1"
l .1'_.,._-_ .1'_-_ I - - - -"5.-li— ' Gin—I 1"11—:J
Running time. 1:9 (n2) for matrix-vector multiply (or n Horner’s)..
Coefficient => point-value.
Given n distinct points x0,-~,xn_1 and values 3’0""!3’11-1 , find unique
n—1
polynomial a0 + “ix + + an_1x ,that has given values at given points.
J. In Ill]: ' ' ' IE I (In 'L'.;_.
1 x. .1; - - - .1":"'] £11 ,1-'1
l .1'_.,._-_ .1'_§_| - - - .1;_,":'_ ' an—I 3"11—'.1
 115.111: is him-eth'ble ifi'xi dishhcl
Running time. 9 (n3) for Gaussian elimination.
Theorem. For any set {(xo, yo), (x1,y1), . . ., (xn-1,yn-1)} of n point-value pairs,
there is a unique polynomial A(x) of degree-bound n such that y, = A(xk) for k =
0,1,...,n-1.
Proof: write out A(xo) = y0,A(x1) = yl... A(xn.1) = yn.1 as
" .I.' 'I
l :01 .15 - - - EU .51.; 11-,
I x. .1; - - - .1'f'] £11 .1-'1
l .1'_..._-_ .1'Ifi_| - - - 351':— J' 61.1— | 111—:
The matrix on the left is denoted V(x0,x1, . . .,x,,—1) and is known as a
Vandermonde matrix. this matrix has determinant
n11. — 1.1 .
Determinant (x0, x1, . . ., xn-l) ¢ 0 since all the x’s are distinct. So the system
has a solution
A: V (x0, x1, . - .1 xn-1)'1y
So the a’s can be uniquely found. Solving such alinear system takes'FJI (n3) tiem,
but we can interpolate faster.
LaGrange formula: given point — value
-'l | H” — X1]
1111:. — "‘ 111—- -—. -:1; Hum. -— x.)
1-1611
Can show that A (x) is a degree bound n polynomial and A(x.) = y1. this takes E)
(n2) teim
A(X) a {(xflryo): (X1,y1), ' ' ':(x"_12y"-1)}
B (X) 9{(x0,y’o), (x1,y’1), - - .1 (xn-l, Y'n-1)}
(note thatA and B are evaluated at the some n points), then a point-value
representation for
C (X) 9{(X01y0+ Y0): (X1: y1+Y'1)= - - ., (Xn.1,yn.1+y’1.1)}.
And conversion takes 0 (n) time. What about multiplication of A (x) and B (x)
both degree bound n polynomials?
C(x) : A(x)B(x) is degree bound 2n—1 , so we must augment the number of point
value pairs used to A (x) and B (x)
A(X) a {(xoryo): (X1,y1), ' ' '2 (x"_1:y"'1)}
B (X) 9 {(Xoa Y0): (X1: Y1): - - -= (Kn-1: Y'n-1)}
C (>09 {(xO,yoy’o),(xl,y1y’1),...,(X2n.1,y2n.1y’2n.1)}
Is 1-) (n) time.if we can find a fast way to convert coefficients of point value
pairs, use the E) (n) multiplication of point value pairs, and convert back, we
will have a very fast algorithm. We do so by choosing the points for the point
value pairs very carefully. These points are complex root of unity.
To multiply A(x)B(x) we:
1. Use the coefficient representations, but up to degree bound 2n by
2 Compute the point value of A(x) and B(x) at eh 2n roots of unity via FFT.
3. Do print wise multiplication
4 lnterpole back from the 2“‘11 roots of unity to a coefficient representation via
inverse DFT
— I ‘ ... .
‘1? '21' "" “11—! ' Omlinary I11u|rip|iL'a‘.io11 lg. r r.” 1 ' .5 (.tmllmlcnr
' . - . "i '9' '1’ -“—- -' rcprusenl'clhom
ha- i’[‘ _' 5.1.4 . Tum.- L'Ju! ) _ . J
A
111-1111111111 Inlurpnlafion
Time (:Jfri lg n} 3 Time 81.11 '.g n}
. g I'
111111;). 1111111.) (1.5.1; .1J |
' " i . — 1 - .
A(EUJFJ.B(M2INJ I’minlwiw11)1J|[ipllt'a:[l[m {(193,} '. Fowl-value
__ - —" Tin 0|”. )- - '3' l'cpl'cscnwnmn-e
.' =3 ‘ . .1 :
— "17 2 |
111%}: 11.311135» ‘1 .153sz: 1 |
This figure shows a graphical outline of an efficient polynomial-
multiplication process. Representations on the top are in coefficient form, while
those on the bottom are in point-value form. The arrows from left to right
correspond to the multiplication operation. The W2“ terms are complex (2n)th
roots of unity.
2.3.3. The DFT and FFT:
A complex nth root of unity is a complex number w such that
w" = .
There are exactly n complex nth roots of unity', these are e2 H W" for k = 0, 1, . . . , n -
1. To interpret this formula, we use the definition of the exponential of a complex
number:
ei" = cos(u) + 1' sin(u)
-. I“J4; (HE
w; cuff: 1.1.1
11 | '.'
.' I’J) . _ . . (U
The values of ”3‘ “- ’ 9‘
principal 8th root of unity.
The figure shows that the n complex roots of unity are equally spaced around the
circle of unit radius centered at the origin of the complex plane. The value
in the complex plane, where ws = e211 i/8 is the
w" = e217 i/n
The DFT (Discrete Fourier Transform)
Recall that we wish to evaluate a polynomial
P: --|
A(x) = 2: 1:13.114
i=0
[1 . I 2 11—1 _
Of degree-bound n at (”R‘- u 1-" a)“, ' ' ' -' m" (that 1s, at the n complex nth roots
of unity).2 Without loss of generality, we assume that n is a power of 2, since a
given degree-bound can always be raised--we can always add new high-order
zero coefficients as necessary. We assume thatA is given in coefficient
form: a = (a0, a1, . . . , an.1). Let us define the resultsyk, fork = 0, 1,. . . , n - 1,
by
11-.- = A1111:-
H l _
—- Z (.1;wa .
_,I'=IiJ
The vector y = (yo,y1, . . . ,y,,-1) is the Discrete Fourier Transform (DFT) of the
coefficient vector or = (a0, a1, . . . , an-l). We also writey = DFTn(a).
2The lengthn is actually what we referred to as Zn in previous section, since we
double the degree-bound of the given polynomials prior to evaluation. In the context
of polynomial multiplication, therefore, we are actually working with complex
(2n)th roots of unity.+
The FFT (Fast Fourier Transform)
By using a method known as the Fast Fourier Transform (FF 1), which
takes advantage of the special properties of the complex roots of unity, we can
compute DFT,,(a)in time E) (n lg n), as opposed to the 1-3012) time of the
straightforward method.
The FFT method employs a divide-and-conquer strategy, using the even-
index and odd-index coefficients of A(x) separately to define the two new degree-
bound n/Z polynomials A[°](x) and A[”(x):
A[0](x) = a0+a2x+a4x2+¢+¢+an-ZX”/2-1,
A[1](x) = a1+a3x+a5x2+***+an-1x”/2-1.
Note thatAm contains all the even-index coefficients of A (the binary representation
of the index ends in 0) andAm contains all the odd-index coefficients (the binary
representation of the index ends in 1). It follows that
14(16): 401062 ) + xAmOC2 )1
C‘ m' ....w"'"
so that the problem of evaluating A(x) at 111 ... ' LI reduces to
1. Evaluating the degree-bound n/Z polynomials A[°](x) and A[”(x) at the points
[cufi ]3. Ii :11]. 1], . . . , (raj:— ! 3'
And then combining the results according to the equation
By the halving lemma, the list of values consists not of n distinct values
but only of the n/Z complex (n/2)th roots of unity, with each root occurring
exactly twice. Therefore, the polynomials Am] and AH] of degree-bound n/Z are
recursively evaluated at the n/Z complex (n/2)th roots of unity. These
subproblems have exactly the same form as the original problem, but are half
the size. We have now successfully divided an n-element DFT" computation
into two n/Z-element DFTn/Z computations. This decomposition is the basis for
the following recursive FFT algorithm, which computes the DFT of an n-
element vector or = (a0, a1, . . . , an.1), where n is a power of 2.
Algorithm
RECUszE—FFHG}
1 n <— lerrgzhm] 1} n is a power of 2.
’2 if n : l
3 then return a
4 (11),: (_ €2.11”
5 w 1— 1
6 .1110] <— (£111,113... .,1’.’i,._9::|
7 allli—(flhafinqflnbfl
8 1'1”] 1— RECURSIvfi-FFTfalfllj
9 ym 1— RECURSIVE-mmmj
10 for 11’ — CF in 111,32 ---1
l 1 do yk .— ){LC'} + wyL”
L2 3J1: ! 1371"?) ‘_ yLUJ _ myil]
13 an 1— U) (1)..
[4 return 1‘ 1:1 y is assumed to be column vector.
The RECURSIVE-FFT procedure works as follows. Lines 2-3
represent the basis of the recursion', the DFT of one element is the element
itself, since in this case
yo = flow?
= ng'l
= {11].
Lines 6-7 define the coefficient vectors for the polynomials Am] and Am. Lines
4, 5, and 13 guarantee that w is updated properly so that whenever lines 11-12
are executed, (1.1 _ m" . (Keep1ng a running value ofwfrom 1terat10n to
iteration saves time over computing 50¢. from scratch each time through
the for loop.) Lines 8-9 perform the recursive DFTn/Z computations, setting,
fork=0,1,...,n/2-1,
'va = 11101111111,
3’1” = Amiwfigl.
or, since 51):” 2 1:11;," by the cancellation lemma,
1111 = 11011-1111.
11” = 111111111.
Lines 11-12 combine the results of the recursive DFTn/Z calculations.
Fory0,y1, . . . ,yn/Z - 1, line 11 yields
0 _ l
111 = 3111+ €111.11]
11111113111 wiA'WwfiH
A((ufi) .
where the last line of this argument follows from equation (32.9). For yn/Z, "/2+1, . .
.,y,,- 1, letting k= 0,1,. . ., n/Z - 1, line 12 yields
l'J') .
.l‘l-‘(H'PL-‘E: ' y}: I — Will;
= 1:10] I Willa-Ill ,".|
_Ir .1
= .zll'iil-iwi'“) - w: ' 3""-"‘1:'A:' '[cufi’i '1.
: ,1[-:1]IILII2_I.1+1-I I a): I '-"""3:.»1“aft-135'":‘1
: I,I.IIL.II:1I—::.I.-'2_III
The second line follows from the first since rm, I I I : fir” . The fourth line
_ .1. __ _ _ (11 = .11...- _
follows from the third because l(“i-'1 1 1mphes A)" (1)” . The last hne
follows from equation (32.9). Thus, the vector yreturned by RECURSIVE-FFT is
indeed the DFT of the input vector a.
To determine the running time of procedure RECURSIVE-FFT, we note that
exclusive of the recursive calls, each invocation takes time 1-3 (n), where n is the
length of the input vector. The recurrence for the running time is therefore
T(n) = 2T(n/2) + B(n)
= E) (n lg n) .
Thus, we can evaluate a polynomial of degree-bound n at the complex nth roots of
unity in time B1 (n lg n) using the Fast Fourier Transform.
The iterative F F T implementation runs in time E) (n lg n). The call to BIT-
REVERSE-COPY(a,A) certainly runs in O(n lg n) time, since we iterate n times and
can reverse an integer between 0 and n - 1, with lg nbits, in 0(lg n) time.
Egu 1" |
1.111} — Z E ;
.1=| '='::'.-
Ig -'l
: —- H__12,1-|
.2:131.1:
_ Z:_4.
1-
— @{nlgn}.
:5

Mais conteúdo relacionado

Mais procurados

29 conservative fields potential functions
29 conservative fields potential functions29 conservative fields potential functions
29 conservative fields potential functionsmath267
 
3.2 implicit equations and implicit differentiation
3.2 implicit equations and implicit differentiation3.2 implicit equations and implicit differentiation
3.2 implicit equations and implicit differentiationmath265
 
Numarical values highlighted
Numarical values highlightedNumarical values highlighted
Numarical values highlightedAmanSaeed11
 
4.4 review on derivatives
4.4 review on derivatives4.4 review on derivatives
4.4 review on derivativesmath265
 
22 01 2014_03_23_31_eee_formula_sheet_final
22 01 2014_03_23_31_eee_formula_sheet_final22 01 2014_03_23_31_eee_formula_sheet_final
22 01 2014_03_23_31_eee_formula_sheet_finalvibhuti bansal
 
Probability cheatsheet
Probability cheatsheetProbability cheatsheet
Probability cheatsheetSuvrat Mishra
 
2.5 computations of derivatives
2.5 computations of derivatives2.5 computations of derivatives
2.5 computations of derivativesmath265
 
Roots equations
Roots equationsRoots equations
Roots equationsoscar
 
1.6 slopes and the difference quotient
1.6 slopes and the difference quotient1.6 slopes and the difference quotient
1.6 slopes and the difference quotientmath265
 
Integration presentation
Integration presentationIntegration presentation
Integration presentationUrmila Bhardwaj
 
2.4 defintion of derivative
2.4 defintion of derivative2.4 defintion of derivative
2.4 defintion of derivativemath265
 
5.4 more areas
5.4 more areas5.4 more areas
5.4 more areasmath265
 
2.3 continuity
2.3 continuity2.3 continuity
2.3 continuitymath265
 
5.3 areas, riemann sums, and the fundamental theorem of calaculus
5.3 areas, riemann sums, and the fundamental theorem of calaculus5.3 areas, riemann sums, and the fundamental theorem of calaculus
5.3 areas, riemann sums, and the fundamental theorem of calaculusmath265
 

Mais procurados (20)

29 conservative fields potential functions
29 conservative fields potential functions29 conservative fields potential functions
29 conservative fields potential functions
 
Lagrange’s interpolation formula
Lagrange’s interpolation formulaLagrange’s interpolation formula
Lagrange’s interpolation formula
 
3.2 implicit equations and implicit differentiation
3.2 implicit equations and implicit differentiation3.2 implicit equations and implicit differentiation
3.2 implicit equations and implicit differentiation
 
Interpolation
InterpolationInterpolation
Interpolation
 
Numarical values highlighted
Numarical values highlightedNumarical values highlighted
Numarical values highlighted
 
4.4 review on derivatives
4.4 review on derivatives4.4 review on derivatives
4.4 review on derivatives
 
Numerical method (curve fitting)
Numerical method (curve fitting)Numerical method (curve fitting)
Numerical method (curve fitting)
 
Numerical Methods 3
Numerical Methods 3Numerical Methods 3
Numerical Methods 3
 
22 01 2014_03_23_31_eee_formula_sheet_final
22 01 2014_03_23_31_eee_formula_sheet_final22 01 2014_03_23_31_eee_formula_sheet_final
22 01 2014_03_23_31_eee_formula_sheet_final
 
Probability cheatsheet
Probability cheatsheetProbability cheatsheet
Probability cheatsheet
 
2.5 computations of derivatives
2.5 computations of derivatives2.5 computations of derivatives
2.5 computations of derivatives
 
Finite difference &amp; interpolation
Finite difference &amp; interpolationFinite difference &amp; interpolation
Finite difference &amp; interpolation
 
Roots equations
Roots equationsRoots equations
Roots equations
 
1.6 slopes and the difference quotient
1.6 slopes and the difference quotient1.6 slopes and the difference quotient
1.6 slopes and the difference quotient
 
Integration presentation
Integration presentationIntegration presentation
Integration presentation
 
2.4 defintion of derivative
2.4 defintion of derivative2.4 defintion of derivative
2.4 defintion of derivative
 
5.4 more areas
5.4 more areas5.4 more areas
5.4 more areas
 
metric spaces
metric spacesmetric spaces
metric spaces
 
2.3 continuity
2.3 continuity2.3 continuity
2.3 continuity
 
5.3 areas, riemann sums, and the fundamental theorem of calaculus
5.3 areas, riemann sums, and the fundamental theorem of calaculus5.3 areas, riemann sums, and the fundamental theorem of calaculus
5.3 areas, riemann sums, and the fundamental theorem of calaculus
 

Semelhante a Daa chapter7

Interpolation techniques - Background and implementation
Interpolation techniques - Background and implementationInterpolation techniques - Background and implementation
Interpolation techniques - Background and implementationQuasar Chunawala
 
Roots equations
Roots equationsRoots equations
Roots equationsoscar
 
Lesson 2: A Catalog of Essential Functions (slides)
Lesson 2: A Catalog of Essential Functions (slides)Lesson 2: A Catalog of Essential Functions (slides)
Lesson 2: A Catalog of Essential Functions (slides)Mel Anthony Pepito
 
Dynamical systems solved ex
Dynamical systems solved exDynamical systems solved ex
Dynamical systems solved exMaths Tutoring
 
Fourier 3
Fourier 3Fourier 3
Fourier 3nugon
 
2nd-year-Math-full-Book-PB.pdf
2nd-year-Math-full-Book-PB.pdf2nd-year-Math-full-Book-PB.pdf
2nd-year-Math-full-Book-PB.pdfproacademyhub
 
Applications of Differential Calculus in real life
Applications of Differential Calculus in real life Applications of Differential Calculus in real life
Applications of Differential Calculus in real life OlooPundit
 
Physical Chemistry Assignment Help
Physical Chemistry Assignment HelpPhysical Chemistry Assignment Help
Physical Chemistry Assignment HelpEdu Assignment Help
 
Lesson20 Tangent Planes Slides+Notes
Lesson20   Tangent Planes Slides+NotesLesson20   Tangent Planes Slides+Notes
Lesson20 Tangent Planes Slides+NotesMatthew Leingang
 
On Application of the Fixed-Point Theorem to the Solution of Ordinary Differe...
On Application of the Fixed-Point Theorem to the Solution of Ordinary Differe...On Application of the Fixed-Point Theorem to the Solution of Ordinary Differe...
On Application of the Fixed-Point Theorem to the Solution of Ordinary Differe...BRNSS Publication Hub
 
On the Seidel’s Method, a Stronger Contraction Fixed Point Iterative Method o...
On the Seidel’s Method, a Stronger Contraction Fixed Point Iterative Method o...On the Seidel’s Method, a Stronger Contraction Fixed Point Iterative Method o...
On the Seidel’s Method, a Stronger Contraction Fixed Point Iterative Method o...BRNSS Publication Hub
 

Semelhante a Daa chapter7 (20)

Interpolation techniques - Background and implementation
Interpolation techniques - Background and implementationInterpolation techniques - Background and implementation
Interpolation techniques - Background and implementation
 
Imc2017 day2-solutions
Imc2017 day2-solutionsImc2017 day2-solutions
Imc2017 day2-solutions
 
Roots equations
Roots equationsRoots equations
Roots equations
 
SlidesL28.pdf
SlidesL28.pdfSlidesL28.pdf
SlidesL28.pdf
 
Lesson 2: A Catalog of Essential Functions (slides)
Lesson 2: A Catalog of Essential Functions (slides)Lesson 2: A Catalog of Essential Functions (slides)
Lesson 2: A Catalog of Essential Functions (slides)
 
Dynamical systems solved ex
Dynamical systems solved exDynamical systems solved ex
Dynamical systems solved ex
 
Lecture_note2.pdf
Lecture_note2.pdfLecture_note2.pdf
Lecture_note2.pdf
 
Fourier 3
Fourier 3Fourier 3
Fourier 3
 
2nd-year-Math-full-Book-PB.pdf
2nd-year-Math-full-Book-PB.pdf2nd-year-Math-full-Book-PB.pdf
2nd-year-Math-full-Book-PB.pdf
 
2018-G12-Math-E.pdf
2018-G12-Math-E.pdf2018-G12-Math-E.pdf
2018-G12-Math-E.pdf
 
Maths 12
Maths 12Maths 12
Maths 12
 
Applications of Differential Calculus in real life
Applications of Differential Calculus in real life Applications of Differential Calculus in real life
Applications of Differential Calculus in real life
 
Ch07 6
Ch07 6Ch07 6
Ch07 6
 
Physical Chemistry Assignment Help
Physical Chemistry Assignment HelpPhysical Chemistry Assignment Help
Physical Chemistry Assignment Help
 
Lesson20 Tangent Planes Slides+Notes
Lesson20   Tangent Planes Slides+NotesLesson20   Tangent Planes Slides+Notes
Lesson20 Tangent Planes Slides+Notes
 
Chapter 3
Chapter 3Chapter 3
Chapter 3
 
On Application of the Fixed-Point Theorem to the Solution of Ordinary Differe...
On Application of the Fixed-Point Theorem to the Solution of Ordinary Differe...On Application of the Fixed-Point Theorem to the Solution of Ordinary Differe...
On Application of the Fixed-Point Theorem to the Solution of Ordinary Differe...
 
On the Seidel’s Method, a Stronger Contraction Fixed Point Iterative Method o...
On the Seidel’s Method, a Stronger Contraction Fixed Point Iterative Method o...On the Seidel’s Method, a Stronger Contraction Fixed Point Iterative Method o...
On the Seidel’s Method, a Stronger Contraction Fixed Point Iterative Method o...
 
02_AJMS_186_19_RA.pdf
02_AJMS_186_19_RA.pdf02_AJMS_186_19_RA.pdf
02_AJMS_186_19_RA.pdf
 
02_AJMS_186_19_RA.pdf
02_AJMS_186_19_RA.pdf02_AJMS_186_19_RA.pdf
02_AJMS_186_19_RA.pdf
 

Mais de B.Kirron Reddi (18)

What after graduation_-_mba
What after graduation_-_mbaWhat after graduation_-_mba
What after graduation_-_mba
 
What after graduation_-_banks
What after graduation_-_banksWhat after graduation_-_banks
What after graduation_-_banks
 
What after graduation_-_mca
What after graduation_-_mcaWhat after graduation_-_mca
What after graduation_-_mca
 
Daa chpater14
Daa chpater14Daa chpater14
Daa chpater14
 
Daa chpater 12
Daa chpater 12Daa chpater 12
Daa chpater 12
 
Daa chapter13
Daa chapter13Daa chapter13
Daa chapter13
 
Daa chapter11
Daa chapter11Daa chapter11
Daa chapter11
 
Daa chapter10
Daa chapter10Daa chapter10
Daa chapter10
 
Daa chapter9
Daa chapter9Daa chapter9
Daa chapter9
 
Daa chapter8
Daa chapter8Daa chapter8
Daa chapter8
 
Daa chapter6
Daa chapter6Daa chapter6
Daa chapter6
 
Daa chapter5
Daa chapter5Daa chapter5
Daa chapter5
 
Daa chapter4
Daa chapter4Daa chapter4
Daa chapter4
 
Daa chapter 3
Daa chapter 3Daa chapter 3
Daa chapter 3
 
Daa chapter 2
Daa chapter 2Daa chapter 2
Daa chapter 2
 
Daa chapter 1
Daa chapter 1Daa chapter 1
Daa chapter 1
 
Daa contents by B.Kirron Reddi
Daa contents by B.Kirron ReddiDaa contents by B.Kirron Reddi
Daa contents by B.Kirron Reddi
 
Searching and sorting by B kirron Reddi
Searching and sorting by B kirron ReddiSearching and sorting by B kirron Reddi
Searching and sorting by B kirron Reddi
 

Último

Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxPoojaSen20
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 

Último (20)

Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 

Daa chapter7

  • 1. CHIPTEB 7 Polynomials and the FFT —=C;=——=€;=——=C;=——«;’“;=——=Q=——=Q=——=C;=——q:=r———4;=n— 2.3.1. Polynomials A polynomial in the variable x over an algebraic fieldF is a function A(x) that can be represented as follows: .-I—| Alfx] = ELM! . .I 0 We call n the degree-bound of the polynomial, and we call the values a0, a1, . ., an - l the coefficients of the polynomial. The coefficients are drawn from the field F, typically the set C of complex numbers. A polynomial A(x) is said to have degree k if its highest nonzero coefficient is 011.. The degree of a polynomial of degree-boundn can be any integer between 0 andn - 1, inclusive. Conversely, a polynomial of degree k is a polynomial of degree-bound n for any n > k. There are a variety of operations we might wish to define for polynomials. For polynomial addition, if A (x) andB (x) are polynomials of degree-bound n, we say that their sum is a polynomial C (x), also of degree-bound n, such that C (x) : A (x) + B (x) for all x in the underlying field. That is, if .‘I—l AU} = E of?" JI:-.'L" and .'.'—] 8-inch = Z opt! . _r II then :.-—| ("it“) = Z :rI.I-' , Fr. where cj=aj+bjforj= 0,1, . . .,n- 1. For example, ifA(x) = 6x3+ 7X2- le+ 9 and B(x) = -2x3+ 4x - 5, then C(x) = 4x3+ 7x2- 6x + 4. For polynomial multiplication, if A(x) and B(x) are polynomials of degree- bound n, we say that their product C(x) is a polynomial of degree-bound 2n - 1 such that C(x) =A(x)B(x) for all x in the underlying field. You have probably multiplied polynomials before, by multiplying each term in A(x) by each term in B(x) and
  • 2. combining terms with equal powers. For example, we can multiply A(x) = 6x3 + 7x2 - 10x + 9 and B(x) = -2x3+ 4x - 5 as follows: 6x3+ 7x2- 10x + 9 - 2x3 + 4x - 5 - 30x3- 35x2+ 50x - 45 24x4+ 28x3- 40x2+ 36x - 12x6- 14x5+ 20x4 -18x3 - 12x6- 14x5+ 44x4- 20x3- 75x2+ 86x - 45 Another way to express the product C (x) is 3.1."; Clfix} = Z c,.-.r-' . 3:0 where c, — Elam): ,1. _ 11"”) Note that degree(C) = degree(A) + degree(B), implying degree-bound(C) = degree-bound(A) + degree-bound(B) - 1 5 degree-bound(A) + degree-bound(B). We shall nevertheless speak of the degree-bound of C as being the sum of the degree-bounds of A and B, since if a polynomial has degree-bound kit also has degree-bound k + 1. 2.3.2. Representation of polynomials The coefficient and point-value representations of polynomials are in a sense equivalent', that is, a polynomial in point-value form has a unique counterpart in coefficient form. Coefficient representation A coefficient representation of a polynomial of degree-bound n is a vector of coefficients a = (a0, a1, . . ., an-1). In matrix equations in this chapter, we shall generally treat vectors as column vectors.
  • 3. A(x) = an + alx + azxz +---+ an_1x"'1 3(1): bc| + blx + bzxz + ---+ bn_1x"‘1 Add : O(n) arithmetic operation A(x) + B[x) = (a0 + bu ) + (a1 + b1)x + ---+ (an_1 + bn_1)x"_1 Evaluate. O (11) using Horner’s method A(x) = no + (36(01 + 1:012 + -“+ I (an—2 + x (an—1119) Multiply. 0 (n2) using Brute force algo 211—2 i A(x) x 3(x) = Z cL-xi , where Ci = Z ajbi_j 5:0 jzo Point-value representation Fundamental theorem of algebra: A degree n polynomial with complex coefficients has exactly 11 complex roots. Corollary. A degree n — 1 polynomial A(x) is uniquely specified by its evaluation at n distinct values of x A(x) = (Ind/01 , (xfl—lJyfl—l) B (x) = (xurzu ), : (In—1: Zn—l) Add. O(n) arithmetic operations. A(x) + BC?!) = (150.370 + 20). "':(xn-1:yn-1 + Zn-l) Multiply (convolve). E) (11), but need 2n — 1 points. A(x) X 305) = (350.310 X 20): "'. (x2n—11y2n—1 X 2211—1) Evaluate. O(nZ) using Lagrange’s fomiula. 11—1 [.1 . x 7 x- Arx) = y (—J"‘ ’ )2:” k Hjtk xk 7 xi Theorem. For any set Converting between two representations: brute force Point-value => coefficient
  • 4. x0, ---.xn_1 a0 + alx + + an_1x”“1Given n distinct points , Evaluate it at n distinct points l :01 XS - - - xfif ' .51.; 1'11. 1 x1 .1; - - - 1'1"] 111 1" l .1'_.,._-_ .1'_-_ I - - - -"5.-li— ' Gin—I 1"11—:J Running time. 1:9 (n2) for matrix-vector multiply (or n Horner’s).. Coefficient => point-value. Given n distinct points x0,-~,xn_1 and values 3’0""!3’11-1 , find unique n—1 polynomial a0 + “ix + + an_1x ,that has given values at given points. J. In Ill]: ' ' ' IE I (In 'L'.;_. 1 x. .1; - - - .1":"'] £11 ,1-'1 l .1'_.,._-_ .1'_§_| - - - .1;_,":'_ ' an—I 3"11—'.1 115.111: is him-eth'ble ifi'xi dishhcl Running time. 9 (n3) for Gaussian elimination. Theorem. For any set {(xo, yo), (x1,y1), . . ., (xn-1,yn-1)} of n point-value pairs, there is a unique polynomial A(x) of degree-bound n such that y, = A(xk) for k = 0,1,...,n-1. Proof: write out A(xo) = y0,A(x1) = yl... A(xn.1) = yn.1 as " .I.' 'I l :01 .15 - - - EU .51.; 11-, I x. .1; - - - .1'f'] £11 .1-'1 l .1'_..._-_ .1'Ifi_| - - - 351':— J' 61.1— | 111—: The matrix on the left is denoted V(x0,x1, . . .,x,,—1) and is known as a Vandermonde matrix. this matrix has determinant n11. — 1.1 . Determinant (x0, x1, . . ., xn-l) ¢ 0 since all the x’s are distinct. So the system has a solution A: V (x0, x1, . - .1 xn-1)'1y
  • 5. So the a’s can be uniquely found. Solving such alinear system takes'FJI (n3) tiem, but we can interpolate faster. LaGrange formula: given point — value -'l | H” — X1] 1111:. — "‘ 111—- -—. -:1; Hum. -— x.) 1-1611 Can show that A (x) is a degree bound n polynomial and A(x.) = y1. this takes E) (n2) teim A(X) a {(xflryo): (X1,y1), ' ' ':(x"_12y"-1)} B (X) 9{(x0,y’o), (x1,y’1), - - .1 (xn-l, Y'n-1)} (note thatA and B are evaluated at the some n points), then a point-value representation for C (X) 9{(X01y0+ Y0): (X1: y1+Y'1)= - - ., (Xn.1,yn.1+y’1.1)}. And conversion takes 0 (n) time. What about multiplication of A (x) and B (x) both degree bound n polynomials? C(x) : A(x)B(x) is degree bound 2n—1 , so we must augment the number of point value pairs used to A (x) and B (x) A(X) a {(xoryo): (X1,y1), ' ' '2 (x"_1:y"'1)} B (X) 9 {(Xoa Y0): (X1: Y1): - - -= (Kn-1: Y'n-1)} C (>09 {(xO,yoy’o),(xl,y1y’1),...,(X2n.1,y2n.1y’2n.1)} Is 1-) (n) time.if we can find a fast way to convert coefficients of point value pairs, use the E) (n) multiplication of point value pairs, and convert back, we will have a very fast algorithm. We do so by choosing the points for the point value pairs very carefully. These points are complex root of unity. To multiply A(x)B(x) we: 1. Use the coefficient representations, but up to degree bound 2n by 2 Compute the point value of A(x) and B(x) at eh 2n roots of unity via FFT. 3. Do print wise multiplication 4 lnterpole back from the 2“‘11 roots of unity to a coefficient representation via inverse DFT
  • 6. — I ‘ ... . ‘1? '21' "" “11—! ' Omlinary I11u|rip|iL'a‘.io11 lg. r r.” 1 ' .5 (.tmllmlcnr ' . - . "i '9' '1’ -“—- -' rcprusenl'clhom ha- i’[‘ _' 5.1.4 . Tum.- L'Ju! ) _ . J A 111-1111111111 Inlurpnlafion Time (:Jfri lg n} 3 Time 81.11 '.g n} . g I' 111111;). 1111111.) (1.5.1; .1J | ' " i . — 1 - . A(EUJFJ.B(M2INJ I’minlwiw11)1J|[ipllt'a:[l[m {(193,} '. Fowl-value __ - —" Tin 0|”. )- - '3' l'cpl'cscnwnmn-e .' =3 ‘ . .1 : — "17 2 | 111%}: 11.311135» ‘1 .153sz: 1 | This figure shows a graphical outline of an efficient polynomial- multiplication process. Representations on the top are in coefficient form, while those on the bottom are in point-value form. The arrows from left to right correspond to the multiplication operation. The W2“ terms are complex (2n)th roots of unity. 2.3.3. The DFT and FFT: A complex nth root of unity is a complex number w such that w" = . There are exactly n complex nth roots of unity', these are e2 H W" for k = 0, 1, . . . , n - 1. To interpret this formula, we use the definition of the exponential of a complex number: ei" = cos(u) + 1' sin(u) -. I“J4; (HE w; cuff: 1.1.1 11 | '.' .' I’J) . _ . . (U The values of ”3‘ “- ’ 9‘ principal 8th root of unity. The figure shows that the n complex roots of unity are equally spaced around the circle of unit radius centered at the origin of the complex plane. The value in the complex plane, where ws = e211 i/8 is the
  • 7. w" = e217 i/n The DFT (Discrete Fourier Transform) Recall that we wish to evaluate a polynomial P: --| A(x) = 2: 1:13.114 i=0 [1 . I 2 11—1 _ Of degree-bound n at (”R‘- u 1-" a)“, ' ' ' -' m" (that 1s, at the n complex nth roots of unity).2 Without loss of generality, we assume that n is a power of 2, since a given degree-bound can always be raised--we can always add new high-order zero coefficients as necessary. We assume thatA is given in coefficient form: a = (a0, a1, . . . , an.1). Let us define the resultsyk, fork = 0, 1,. . . , n - 1, by 11-.- = A1111:- H l _ —- Z (.1;wa . _,I'=IiJ The vector y = (yo,y1, . . . ,y,,-1) is the Discrete Fourier Transform (DFT) of the coefficient vector or = (a0, a1, . . . , an-l). We also writey = DFTn(a). 2The lengthn is actually what we referred to as Zn in previous section, since we double the degree-bound of the given polynomials prior to evaluation. In the context of polynomial multiplication, therefore, we are actually working with complex (2n)th roots of unity.+ The FFT (Fast Fourier Transform) By using a method known as the Fast Fourier Transform (FF 1), which takes advantage of the special properties of the complex roots of unity, we can compute DFT,,(a)in time E) (n lg n), as opposed to the 1-3012) time of the straightforward method. The FFT method employs a divide-and-conquer strategy, using the even- index and odd-index coefficients of A(x) separately to define the two new degree- bound n/Z polynomials A[°](x) and A[”(x): A[0](x) = a0+a2x+a4x2+¢+¢+an-ZX”/2-1, A[1](x) = a1+a3x+a5x2+***+an-1x”/2-1.
  • 8. Note thatAm contains all the even-index coefficients of A (the binary representation of the index ends in 0) andAm contains all the odd-index coefficients (the binary representation of the index ends in 1). It follows that 14(16): 401062 ) + xAmOC2 )1 C‘ m' ....w"'" so that the problem of evaluating A(x) at 111 ... ' LI reduces to 1. Evaluating the degree-bound n/Z polynomials A[°](x) and A[”(x) at the points [cufi ]3. Ii :11]. 1], . . . , (raj:— ! 3' And then combining the results according to the equation By the halving lemma, the list of values consists not of n distinct values but only of the n/Z complex (n/2)th roots of unity, with each root occurring exactly twice. Therefore, the polynomials Am] and AH] of degree-bound n/Z are recursively evaluated at the n/Z complex (n/2)th roots of unity. These subproblems have exactly the same form as the original problem, but are half the size. We have now successfully divided an n-element DFT" computation into two n/Z-element DFTn/Z computations. This decomposition is the basis for the following recursive FFT algorithm, which computes the DFT of an n- element vector or = (a0, a1, . . . , an.1), where n is a power of 2. Algorithm RECUszE—FFHG} 1 n <— lerrgzhm] 1} n is a power of 2. ’2 if n : l 3 then return a 4 (11),: (_ €2.11” 5 w 1— 1 6 .1110] <— (£111,113... .,1’.’i,._9::| 7 allli—(flhafinqflnbfl 8 1'1”] 1— RECURSIvfi-FFTfalfllj 9 ym 1— RECURSIVE-mmmj 10 for 11’ — CF in 111,32 ---1 l 1 do yk .— ){LC'} + wyL” L2 3J1: ! 1371"?) ‘_ yLUJ _ myil] 13 an 1— U) (1).. [4 return 1‘ 1:1 y is assumed to be column vector. The RECURSIVE-FFT procedure works as follows. Lines 2-3 represent the basis of the recursion', the DFT of one element is the element itself, since in this case
  • 9. yo = flow? = ng'l = {11]. Lines 6-7 define the coefficient vectors for the polynomials Am] and Am. Lines 4, 5, and 13 guarantee that w is updated properly so that whenever lines 11-12 are executed, (1.1 _ m" . (Keep1ng a running value ofwfrom 1terat10n to iteration saves time over computing 50¢. from scratch each time through the for loop.) Lines 8-9 perform the recursive DFTn/Z computations, setting, fork=0,1,...,n/2-1, 'va = 11101111111, 3’1” = Amiwfigl. or, since 51):” 2 1:11;," by the cancellation lemma, 1111 = 11011-1111. 11” = 111111111. Lines 11-12 combine the results of the recursive DFTn/Z calculations. Fory0,y1, . . . ,yn/Z - 1, line 11 yields 0 _ l 111 = 3111+ €111.11] 11111113111 wiA'WwfiH A((ufi) . where the last line of this argument follows from equation (32.9). For yn/Z, "/2+1, . . .,y,,- 1, letting k= 0,1,. . ., n/Z - 1, line 12 yields l'J') . .l‘l-‘(H'PL-‘E: ' y}: I — Will; = 1:10] I Willa-Ill ,".| _Ir .1 = .zll'iil-iwi'“) - w: ' 3""-"‘1:'A:' '[cufi’i '1. : ,1[-:1]IILII2_I.1+1-I I a): I '-"""3:.»1“aft-135'":‘1 : I,I.IIL.II:1I—::.I.-'2_III The second line follows from the first since rm, I I I : fir” . The fourth line _ .1. __ _ _ (11 = .11...- _ follows from the third because l(“i-'1 1 1mphes A)" (1)” . The last hne
  • 10. follows from equation (32.9). Thus, the vector yreturned by RECURSIVE-FFT is indeed the DFT of the input vector a. To determine the running time of procedure RECURSIVE-FFT, we note that exclusive of the recursive calls, each invocation takes time 1-3 (n), where n is the length of the input vector. The recurrence for the running time is therefore T(n) = 2T(n/2) + B(n) = E) (n lg n) . Thus, we can evaluate a polynomial of degree-bound n at the complex nth roots of unity in time B1 (n lg n) using the Fast Fourier Transform. The iterative F F T implementation runs in time E) (n lg n). The call to BIT- REVERSE-COPY(a,A) certainly runs in O(n lg n) time, since we iterate n times and can reverse an integer between 0 and n - 1, with lg nbits, in 0(lg n) time. Egu 1" | 1.111} — Z E ; .1=| '='::'.- Ig -'l : —- H__12,1-| .2:131.1: _ Z:_4. 1- — @{nlgn}. :5