Docsity

Algorithms Problem Set: Identity Proofs, Recurrences, and Strongly Connected Components, Assignments of Algorithms and Programming

Toggle sidebar
bg1
Head-Banging Session 2
CS 473ug: Algorithms
Problem 1.[Algebraic Manipulation]
1. Prove the following identity: n
X
m=im
i=n+ 1
i+ 1
2. Using the previous identity, evaluate Pk
t=1 tand Pk
t=1 t2.
3. Prove Pk
t=1 tc= Θ(kc+1), for any c∈N. (Food for thought: Is the identity true when c∈R+?)
Problem 2.[Couple of Recurrences]
1. Solve the recurrence f(n) = 1 + f(√n).
2. If f(·) satisfies the recurrence f(n) = n+Pk
i=1 f(ain), where ai>0 (1 ≤i≤k) and Pk
i=1 ai<1,
then prove that f(n) = O(n). (You are not allowed to use the Master Theorem)
Problem 3.[Strongly Connected Components] We are given two black boxes:
1. BlackBox A: Given a directed graph Git outputs a list of strongly connected components in G.
2. BlackBox B: It takes as input a DAG G= (V, E ) and weight wvassociated with every vertex
v∈V. Given two vertices sand tin Gand a threshold τ, it outputs whether there exists a path
P={s=vi1→ ··· → vik=t}between sand t, such that Pv∈Pwv≥τ.
Using the above mentioned black boxes solve the following problems:
1. Given a DAG G= (V, E), how do we find whether there exists a path from sto t(s, t ∈V) such that
it visits at least cdifferent vertices.
2. Given a directed graph G, how do we find whether there exists a walk from sto t(s,t ∈V) such that
it visits at least cdifferent vertices.
Give an efficient algorithm to implement BlackBox B.
1

Partial preview of the text

Download Algorithms Problem Set: Identity Proofs, Recurrences, and Strongly Connected Components and more Assignments Algorithms and Programming in PDF only on Docsity!

Head-Banging Session 2 CS 473ug: Algorithms

Problem 1.[Algebraic Manipulation]

  1. Prove the following identity: (^) ∑n m=i

(m i

) = (n + 1 i + 1

  1. Using the previous identity, evaluate ∑kt=1 t and ∑kt=1 t^2.
  2. Prove ∑kt=1 tc^ = Θ(kc+1), for any c ∈ N. (Food for thought: Is the identity true when c ∈ R+?) Problem 2.[Couple of Recurrences]
  3. Solve the recurrence f (n) = 1 + f (√n).
  4. Ifthen prove that f (·) satisfies the recurrence f (n) = O(n). (You are not allowed to use the Master Theorem) f (n) = n + ∑ki=1 f (ain), where ai > 0 (1 ≤ i ≤ k) and ∑ki=1 ai < 1,

Problem 3.[Strongly Connected Components] We are given two black boxes:

  1. BlackBox A: Given a directed graph G it outputs a list of strongly connected components in G.
  2. BlackBox B v ∈ V. Given two vertices: It takes as input a DAG s and t in G and a thresholdG = (V, E) and weight τ , it outputs whether there exists a path wv associated with every vertex P = {s = vi 1 → · · · → vik = t} between s and t, such that ∑ v∈P wv ≥ τ. Using the above mentioned black boxes solve the following problems:
  3. Given a DAGit visits at least G c= ( different vertices.V, E), how do we find whether there exists a path from s to t (s, t ∈ V ) such that
  4. Given a directed graphit visits at least c different vertices. G, how do we find whether there exists a walk from s to t (s, t ∈ V ) such that

Give an efficient algorithm to implement BlackBox B.