0% found this document useful (0 votes)
158 views2 pages

Algo Quiz 1

The quiz will contain 3 questions, one from each of 3 sections. Section A deals with decidability problems related to DFAs, regular expressions, and CFGs. Section B contains problems about analyzing recursive algorithms using techniques like recursion trees and the master method. Section C includes questions about Huffman coding, finding spanning trees, and analyzing Prim's algorithm with negative edges. The maximum marks for the quiz is 30.

Uploaded by

sld;fksa
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)
158 views2 pages

Algo Quiz 1

The quiz will contain 3 questions, one from each of 3 sections. Section A deals with decidability problems related to DFAs, regular expressions, and CFGs. Section B contains problems about analyzing recursive algorithms using techniques like recursion trees and the master method. Section C includes questions about Huffman coding, finding spanning trees, and analyzing Prim's algorithm with negative edges. The maximum marks for the quiz is 30.

Uploaded by

sld;fksa
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/ 2

Algorithms Monsoon 2018

Questions for Quiz 1 28th August

Your Quiz will have 3 questions, one from each of three sections given here.
Please come with sufficient papers to write your answers.
No books, smart phones are allowed. Maximum marks is 30.

Section A
1. (10 points) Consider the problem of determining a DFA and a regular expression are
equivalent. Express the problem as a language and show that it is decidable.
2. (10 points) Let ALLDF A = {hAi| A is a DFA and L(A) = Σ∗ }. Show that ALLDF A is
decidable.
3. (10 points) Let CCF G = {hG, ki| G is a CFG and L(G) contains exactly k strings where
k ≥ 0 or k = ∞}. Show that CCF G is decidable.
4. (10 points) Let A = {hR, Si|R and S are regular expressions and L(R) ⊆ L(S)}. Show
that A is decidable.
Section B
1. (a) (5 points) Show that the solution of T (n) = T (d n2 e) + 1 is O(log n).
(b) (5 points) Use master method to show that the solution to the binary-search re-
currence T (n) = T ( n2 ) + Θ(1) is T (n) = Θ(log n).
2. (a) (5 points) Show that the solution of T (n) = 2T (b n2 c + 17) + n is O(n log n).
(b) (5 points) Use a recursion tree to determine a good asymptotic upper bound on
the recurrence T (n) = T (n − 1) + T ( n2 ) + n. Use substitution method to verify your
answer.
3. (a) (5 points) Use master method to give tight asymptotic bounds for T (n) = 2T ( n4 ) +
n2 .
(b) (5 points) Use a recursion tree to give an asymptotically tight solution to the re-
currence T (n) = T (n − a) + T (a) + cn where a ≥ 1 and c > 0 are constants.
Section C
1. (a) (5 points) Generalize Huffman’s algorithm to ternary codewords (i.e., codewords
using the symbols 0,1 and 2), and prove that it yields optimal ternary codes.
(b) (5 points) Show how to find the maximum spanning tree of a graph, that is, the
spanning tree of largest total weight.
2. (a) (5 points) Let G = (V, E) be a weighted graph with a distinguished vertex s and
all edge weights are positve and distinct. Is it possible for a tree of shortest paths
from s and a minimum spanning tree in G to not share any edges? If so, give an
example. If not, give reason.
Algorithms Questions for Quiz 1 - Page 2 of 2 28th August

(b) (5 points) Suppose the symbols a, b, c, d, e occur with frequencies 12 , 14 , 18 , 16


1 1
, 16 re-
spectively. What is the Huffman coding of the alphabet? If this encoding is applied
to a file consisting of 1,000,000 characters with the given frequencies, what is the
length of the encoded file in bits.

3. (a) (5 points) Suppose that a data file contains a sequence of 8-bit characters such that
all 256 characters are about equally common: the maximum character frequency is
less than twice of the minimum character frequency. Prove that Huffman coding in
this case is no more efficient than using an ordinary 8-bit fixed-length code.
(b) (5 points) Prove or disprove Prim’s algorithm works correctly when there are neg-
ative edges.

Books for reference:


1. Introduction to Theory of Computation, by Micheal Sipser.

2. Introduction to Algorithms, by CLRS.

3. Algorithms, by S.Dasgupta, C.H.Papadimitriou, and U.V.Vazirani.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy