UC Berkeley — CS170 : Algorithms, Spring 2014 Cheat Sheet, Lecture notes of Algorithms and Programming

U.C. Berkeley — CS170 : Algorithms, Spring 2014. Cheat Sheet. Professor: Elchanan Mossel. Feb 20, 2014. Do not write on this page.

Typology: Lecture notes

2022/2023

Uploaded on 05/11/2023

anshula
anshula 🇺🇸

4.4

(12)

243 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
U.C. Berkeley CS170 : Algorithms, Spring 2014 Cheat Sheet
Professor: Elchanan Mossel Feb 20, 2014
Do not write on this page
For two positive functions fand gdefined for positive integers:
f=O(g)iff f(n)Cg(n)for some positive Cand all n>n0for some positive n0.
f= Ω(g)if g=O(f)
f= Θ(g)if f=O(g)and g=O(f)
Euclid’s Algorithm: if ab > 0then gcd(a, b) = gcd(b, a mod b).
Fermat’s Little Theorem: If pis prime then for every a: 1 a<p,ap11 mod p.
RSA
Primes p, q;N=pq
ed 1 mod (p1)(q1)
Public key: (N, e). Private key: d.
Encryption: xxe. Decryption: yyd.
His universal hash function if for every two items xand y, exactly |H|/n of the functions map xand yto
the same bucket (n= number of buckets).
Master Theorem: Given T(n) = aT (n
b) + O(nd),
T(n) =
O(nd)if d > logba
O(ndlog n)if d= logba
O(nlogba)if d < logba
FFT-recursive: A(ωj) = Ae(ω2j) + ωjAo(ω2j),ω=e2πi/n,
FFT-Matrix : Mn(ω)j,k =ωjk , for 0j, k < n. Inverse: Mn(ω)1=1
nMn(ω1).
1

Partial preview of the text

Download UC Berkeley — CS170 : Algorithms, Spring 2014 Cheat Sheet and more Lecture notes Algorithms and Programming in PDF only on Docsity!

U.C. Berkeley — CS170 : Algorithms, Spring 2014 Cheat Sheet Professor: Elchanan Mossel Feb 20, 2014

Do not write on this page

  • For two positive functions f and g defined for positive integers: - f = O(g) iff f (n) ≤ Cg(n) for some positive C and all n > n 0 for some positive n 0. - f = Ω(g) if g = O(f ) - f = Θ(g) if f = O(g) and g = O(f )
  • Euclid’s Algorithm: if a ≥ b > 0 then gcd(a, b) = gcd(b, a mod b).
  • Fermat’s Little Theorem: If p is prime then for every a : 1 ≤ a < p, ap−^1 ≡ 1 mod p.
  • RSA - Primes p, q; N = pq - ed ≡ 1 mod (p − 1)(q − 1) - Public key: (N, e). Private key: d. - Encryption: x → xe. Decryption: y → yd.
  • H is universal hash function if for every two items x and y, exactly |H|/n of the functions map x and y to the same bucket (n = number of buckets).
  • Master Theorem: Given T (n) = aT ( nb ) + O(nd),

T (n) =

O(nd) if d > logb a O(nd^ log n) if d = logb a O(nlogb^ a) if d < logb a

  • FFT-recursive: A(ωj^ ) = Ae(ω^2 j^ ) + ωj^ Ao(ω^2 j^ ), ω = e^2 πi/n,
  • FFT-Matrix : Mn(ω)j,k = ωjk, for 0 ≤ j, k < n. Inverse: Mn(ω)−^1 = (^1) n Mn(ω−^1 ).