Download Problem 1: (Harmonic numbers) Let Hn be the n harmonic number

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Lateral computing wikipedia , lookup

Exact cover wikipedia , lookup

Sieve of Eratosthenes wikipedia , lookup

Knapsack problem wikipedia , lookup

Genetic algorithm wikipedia , lookup

Fast Fourier transform wikipedia , lookup

Clique problem wikipedia , lookup

Selection algorithm wikipedia , lookup

Simplex algorithm wikipedia , lookup

Graph coloring wikipedia , lookup

Computational complexity theory wikipedia , lookup

Smith–Waterman algorithm wikipedia , lookup

Fisher–Yates shuffle wikipedia , lookup

Expectation–maximization algorithm wikipedia , lookup

Algorithm characterizations wikipedia , lookup

Algorithm wikipedia , lookup

Factorization of polynomials over finite fields wikipedia , lookup

Time complexity wikipedia , lookup

Transcript
Problem 1: (Harmonic numbers)
Let Hn be the nth harmonic number:
H n = 1 + 12 + 13 + ... + 1n .
Show that
1 + m2 ≤ H 2m ≤ 1 + m .
and that
∑ H k = (n + 1) H n − n
1≤ k ≤ n
Problem 2: (Graph Algorithm)
Let G = (V,E) be a connected undirected graph. A bridge is an edge e ∈ E
such that removing e disconnects the graph, i.e. breaks the graph into at least two
connected components. Give an O(|E|) time algorithm to find all bridge edges of G.
Hint: use DFS.
Problem 3: (Fast Multiplication)
Analyze the traditional multiplication algorithm for two n bit numbers.
Now assume a divide and conquer strategy. Assume that we want to multiply u and v.
Let m = [n/2]+1. Write
u = a ⋅ 2m + b
and
v = c ⋅ 2m + d .
Then
u ⋅ v = ac 2 2 m + (ad + bc )2 m + bd .
Give a recurrence relation for the resulting divide and conquer algorithm and solve it.
Observe that
ad + bc = (a + b)(c + d ) − ac − bd
Why is this relation helpful to develop a better algorithm? Explain the algorithm, give a
recurrence relation for the run time, and solve the recurrence relationship.