Cheatsheet 5
CONTINUOUS FOURIER SERIES (CFS)
Represents a periodic function
- General Form:
- Coefficients (for
): (Average value) (for ) (for )
- Orthogonality (for
): Used to find coefficients. (for ) (for ) , (for )
COMPLEX EXPONENTIAL FORM
- Euler's Formula:
- Sine/Cosine:
, - Complex CFS:
(for ) - Complex Coefficients (for
): - Relation to
: , , (for ) - Magnitude:
- Truncation Approx:
DISCRETE FOURIER TRANSFORM (DFT)
Transforms discrete data
Root of Unity: . Satisfies . are points on the unit circle in the complex plane. - Inverse DFT (Synthesis):
- Forward DFT (Analysis):
- Orthogonality:
- Properties:
- Periodicity:
- Conjugate Symmetry (if
real): . Implies .
- Periodicity:
Coefficient: (Average or DC component). - Power Spectrum: Plot of
vs . Shows magnitude of frequencies, ignores phase. Symmetric for real data about .
FAST FOURIER TRANSFORM (FFT)
An efficient algorithm to compute the DFT.
- Complexity: DFT is
, FFT is . - Method: Divide and conquer. Recursively split DFT of size
into two DFTs of size . Requires to be a power of 2 (pad with zeros if needed). - Butterfly Operation: Basic computation combining pairs of inputs.
- Output Order: Coefficients are in bit-reversed order.
- Inverse FFT: Can use the same algorithm structure with
instead of and scaling by . .
APPLICATIONS & ALIASING
- Image Compression (1D/2D):
- Perform DFT/FFT on pixel data (rows then columns for 2D).
- Discard coefficients
(or ) with small magnitude . - Reconstruct using Inverse DFT/FFT with remaining coefficients. Store fewer coefficients = compression.
- 2D DFT:
. Complexity . Often done on blocks ( , ).
- Aliasing: Occurs when sampling rate (1/
) is too low for high frequencies in the continuous signal. High frequencies appear as lower frequencies in the discrete data. - Cause:
. High freq. continuous coefficients contribute to discrete coefficient . - Nyquist Frequency: Max frequency representable is
. Frequencies alias. - Treatment: Increase sampling rate (
for fixed ), or apply a low-pass (anti-aliasing) filter before sampling.
- Cause:
PAGE RANK ALGORITHM
Ranks web pages based on link structure (importance).
- Model: Web as directed graph. Random surfer follows links. Importance
probability of landing on a page. - Markov Matrix:
if link , else 0. Columns sum to 1. - Handling Dead Ends:
where if page is dead end, is vector of 1s, is total pages. Allows teleportation from dead ends. - Handling Cycles (Google Matrix):
. With probability (e.g., 0.85) follow links (via ), with teleport randomly. is a dense Markov matrix (columns sum to 1, ). - Iteration: Start with
(uniform probability). Iterate . - Convergence:
as . is the principal eigenvector of corresponding to eigenvalue . Convergence rate depends on (second largest eigenvalue magnitude), approx . Smaller faster convergence but less reliance on link structure. - Efficiency:
- Precomputation: Compute
offline. - Sparsity: Avoid forming dense
. Compute using sparse : . is sparse, is fast. Iterate until .
- Precomputation: Compute
GAUSSIAN ELIMINATION (GE)
Solves
- LU Factorization: Factor
where is unit lower triangular, is upper triangular. - Algorithm: Eliminate entries below diagonal, column by column. Store multipliers
in . - Cost:
FLOPs.
- Algorithm: Eliminate entries below diagonal, column by column. Store multipliers
- Solving
via LU: - Factor
(or , see Pivoting). Cost . - Solve
(Forward substitution). Cost . - Solve
(Backward substitution). Cost .
- Total cost dominated by factorization. Efficient if solving for multiple
's.
- Factor
- Pivoting (Partial): To avoid division by small/zero
and reduce error. - Strategy: In step
, find row with max . Swap row and row . - Permutation Matrix: Row swaps tracked by
. Factorization becomes . Solve .
- Strategy: In step
- Cost Comparison: GE (
) is cheaper and more stable than finding and computing .
NORMS & CONDITIONING
- Vector Norms (
-norms): Measure vector magnitude. (Manhattan) (Euclidean) (Max) - Properties:
( ), , (Triangle Inequality).
- Matrix Norms (Induced):
(Max abs column sum) (Max abs row sum) (Spectral norm, largest singular value) - Properties: Like vector norms, plus
, .
- Conditioning: Sensitivity of output to input perturbations for a problem (
). - Well-conditioned: Small input change
small output change. - Ill-conditioned: Small input change
large output change.
- Well-conditioned: Small input change
- Condition Number:
. (Uses a consistent norm, often ). . is well-conditioned. is ill-conditioned. - Error Bounds: Relative error in
due to perturbation or :
- Residual:
. Measurable quantity indicating how well satisfies . - Residual vs. Error:
. Small residual only guarantees small error if is small. - GE Accuracy: For GE with pivoting, computed solution
is the exact solution to with . The relative error is bounded: . Accuracy limited by condition number, even with stable algorithms.
LINEAR ALGEBRA HELPER FACTS
- Matrix-Vector Product:
is a linear combination of columns of . . - Matrix-Matrix Product:
. Column of is . - Transposes:
. . . - Isometry (
, e.g., rotation, permutation): , . - Spectral Theorem: If
, there exists an orthonormal basis of eigenvectors for . - Eigenvalues: If
, then . . . invertible is not an eigenvalue.