0% found this document useful (0 votes)
8 views11 pages

Compre 2018 2 (Solved)

The document outlines a comprehensive exam for the Design and Analysis of Algorithms course (CS F364) consisting of 8 questions totaling 80 marks. It covers various algorithmic concepts, including Modular FFT, Matroid Algorithm for scheduling, Longest Common Subsequence, Ford-Fulkerson for bipartite matching, complexity classes, Weighted Vertex Cover, online auction systems, and efficient algorithms for large computations. The exam is closed book, calculators are not allowed, and students are required to show all steps in their computations or proofs.

Uploaded by

h20240086
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views11 pages

Compre 2018 2 (Solved)

The document outlines a comprehensive exam for the Design and Analysis of Algorithms course (CS F364) consisting of 8 questions totaling 80 marks. It covers various algorithmic concepts, including Modular FFT, Matroid Algorithm for scheduling, Longest Common Subsequence, Ford-Fulkerson for bipartite matching, complexity classes, Weighted Vertex Cover, online auction systems, and efficient algorithms for large computations. The exam is closed book, calculators are not allowed, and students are required to show all steps in their computations or proofs.

Uploaded by

h20240086
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Design and Analysis of Algorithms (CS F364) Comprehensive Exam (2018)

There are 8 questions in all and total marks is 10+10+10+10+10+(1+8+1)+10+10 = 80.


Please show all steps in computations or proofs. This is a closed book exam. Calculators
are not allowed. Time: 180 minutes.
1. In the Modular FFT Algorithm, instead of performing an n−element FFT over
complex numbers (where n is even), we use the complete residue system modulo
tn
m (Zm ), where m = 2 2 + 1 and t is an arbitrary positive integer. Instead of
addition of complex numbers, we use addition modulo m. Instead of multiplication
of complex numbers, we use multiplication modulo m. We use ω = 2t instead of ωn
as a principal nth root of unity, modulo m. Instead of ωn−1 , we use the inverse ω −1
of ω computed in Zm using efficient algorithms. Find (2x + 1) × (3x + 2) using the
Modular FFT Algorithm (by taking t = 8) showing its divide and conquer graphs.
2. Using the Matroid Algorithm, solve the following instance of the scheduling problem
(scheduling unit-time tasks with deadlines and penalties for a single processor that
minimizes the total penalty incurred for missed deadlines):
Set of tasks: (ai )7i=1 = (1, 2, 3, 4, 5, 6, 7)
Deadline of tasks: (di )7i=1 = (4, 2, 4, 3, 1, 4, 6)
Penalty of tasks (if ai is not completed within time di ): (wi )7i=1 = (10, 20, 30, 40, 50, 60, 70)
3. Determine a Longest Common Subsequence of < 1, 0, 0, 1, 0, 1, 0, 1, 1, 0 > and <
0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0 > using the Dynamic Programming Algorithm.
4. Using the Ford-Fulkerson Algorithm, solve the Bipartite Matching Problem for the
instance of the graph given in problem 6 (only the adjacency matrix, not the
weights).
5. Under the assumption of P = NP (all complexity classes are defined for binary
alphabet Σ = {0, 1}), prove that P − NPComplete = {{}, {0 ∪ 1}∗ }
6. Consider the following instance of the Weighted Vertex Cover Problem with ver-
tices {v1 , v2 , v3 , v4 , v5 , v6 }, having weight of vertices defined as w(v1 ) = 1, w(v2 ) =
3, w(v3 ) = 5, w(v4 ) = 2, w(v5 ) = 4, w(v6 ) = 4, for an undirected graph having the
following adjacency matrix: (edge between vi and vj is lebelled as eij )
 
0 0 0 1 1 1
0 0 0 1 1 1
 
0 0 0 1 1 1
 
1 1 1 0 0 0
 
1 1 1 0 0 0
1 1 1 0 0 0
(a) Formulate the above problem as a Set Cover Problem.
(b) Using the Primal Dual Approximation Algorithm for the Set Cover Problem,
solve the above instance of the Set Cover Problem.
(c) Now, from the above solution, get back your original solution of the Weighted
Vertex Cover Problem.
7. Consider a very simple online auction system that works as follows. There are n
bidding agents; agent i has a bid bi , which is a positive natural number. We will
assume that all bids bi are distinct from one another. The bidding agents appear
in an order chosen uniformly at random, each proposes its bid bi in turn, and at
all times the system maintains a variable b∗ equal to the highest bid seen so far.
(Initially b∗ is set to 0.) What is the expected number of times that b∗ is updated
when this process is executed, as a function of the parameters in the problem?
Example. Suppose b1 = 20, b2 = 25, and b3 = 10, and the bidders arrive in the order
1, 3, 2. Then b∗ is updated for 1 and 2, but not for 3.
8. By making use of efficient algorithms, find the last three digits in the decimal ex-
pansion of 320182018201820182018

You might also like