Polynomial Representations, Fourier Transfer, and other goodies. (Chapters 28-30). CSE 202 - Algorithms. Adjacency matrix M[i,j] = 1 iff (i,j) is an edge. Requires (V 2 ) just to find some edges (if you’re unlucky and graph is sparse). Adjacency lists
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
Polynomial Representations,
Fourier Transfer,
and other goodies.
(Chapters 28-30)
CSE 202 - Algorithms
CSE 202 - FFT,etc
Adjacency matrix
M[i,j] = 1 iff (i,j) is an edge.
Requires (V2) just to find some edges (if you’re unlucky and graph is sparse)
Adjacency lists
M[i] is list of nodes attached to node i by edge
O(E) algorithm for connected components,
O(E lg E) for MST
...
CSE 202 - FFT,etc
Roman numerals
multiplication isn’t hard, but if “size” of instance is number characters, can be O(N2) (why??)
Arabic notation
O(N lg 3), or even better.
CSE 202 - FFT,etc
Assume each is short, (e.g. < 231 )
< i (mod q1), i (mod q2),..., i (mod qk) >
k divides of k-long number by a short one.
+ or x on two such number takes O(k) time.
but comparisons are very time-consuming.
If you have many x’s per convert, you can save time!
CSE 202 - FFT,etc
Use N coefficients
a0 + a1 x + a2 x2 + ... + aN-1 xN-1
Addition: point wise
Multiplication: convolution
ci = ak bi-k
Use N points
b0=f(0), ..., bN-1=f(N-1).
Addition: point wise
Multiplication: point wise
To convert:
Evaluate at N points
O(N2)
Add N basis functions
O(N2)
CSE 202 - FFT,etc
Takes N2 time done naively.
Might take O(N2) time.
O(N) time.
Might take O(N2) time.
CSE 202 - FFT,etc
These are the complex numbers that solve XN = 1.
O(N lg N) to convert to frequency domain
O(N) to form convolution (point wise multiplication)
O(N lg N) to convert back.
CSE 202 - FFT,etc
a0
b0
a1
b1
a2
b2
Each box computes ...
a3
b3
a4
b4
x
x+i y
y
x-i y
where iis some root of unity.
Takes 10 floating-point ops
(these are complex numbers).
Factoid: In 1990, 40% of all
Cray Supercomputer cycles
were devoted to FFT’s
a15
b15
lg N stages
inputs
“Bit reversal”
permutation
CSE 202 - FFT,etc
for multiplying two NxN matrices.
T(N) = 7T(N/2) + c N2. Thus, T(N) is O( ?? ) = O(N2.81...).
It’s faster than naïve method for N > 45-ish.
Gives slightly different answer, due to different rounding.
It can be argued that Strassen is more accurate.
CSE 202 - FFT,etc
a11x1+ a12x2+...+c1nxn b1
...
am1x1+ am2x2+...+cmnxn bm
CSE 202 - FFT,etc
subset element of infinity empty set
for all there exists intersection union
big theta big omega summation
>= <= about equal
not equal natural numbers(N)
reals(R) rationals(Q) integers(Z)
CSE 202 - FFT,etc