Qualification exam Computer Science

Attribution Non-Commercial (BY-NC)

4 views

Qualification exam Computer Science

Attribution Non-Commercial (BY-NC)

- Alexandria ACM SC | Rigorous Computational Simulation of Dynamical Systems
- Algorithm
- ON THE CLASSIFICATION OF NP COMPLETE PROBLEMS AND THEIR DUALITY FEATURE
- Sample Data Structures Questions - Chapter 1
- Generating Functions - David Rhee - Canada 2008
- Maximum Contiguous Sub Sequence Sum
- lecture15
- Lecture 36: NP-Completeness
- Probabilistic Method
- Combinatorics with Contributions to Modern Mathematics and Physics, by L. Mao
- Quantum Algorithms
- 1.2.1_Complexity Oct 2013
- C analysis
- Complexity 121
- 3.Asymptotic Notations.pptx
- Scimakelatex.24155.Atl
- CS502
- Lecture 1
- Logarithms New June05
- csmpda01

You are on page 1of 11

DEPARTMENT OF COMPUTER SCIENCE 2006 DEPTH EXAMINATION IN THEORY OF OF COMPUTATION AND ALGORITHMS

There are 10 problems on the test. Each problem is worth 10 points. The ordering of the problems is unrelated to their diculty. Answer exactly 8 out of the 10 questions. Indicate below which two problems you do not want to have graded. Write legibly. What cant be read wont be credited. Algorithms can be described informally in pseudo-code. Good luck!

Name:

Skip Problems: 1. 2.

Problem 1: Consider the following procedure which builds a heap when given as input an array A of n integers. BuildHeap(A : array of int) 1. for i n/2 downto 1 do 2. Heapify(A, i) Heapify(A : array of int, i : int) 1. left, right 2i, 2i + 1 2. if (left n) and (A[left] > A[i]) then max left else max i 3. if (right n) and (A[right] > A[max]) then max right 4. if (max = i) then 5. swap A[i] with A[max] 6. Heapify(A, max) BuildHeap() starts with the element at position n/2 and works backwards. Heapify(A, i) pushes the element at position i down the heap as far as necessary. The elements in positions n/2 + 1 through n are leaves, and so they cannot be pushed further down. The other nodes are either in the correct position, or larger than their children; thus, a push-down xes the sub-heap rooted at i without aecting the rest of the heap. a. Express the time-complexity of BuildHeap as the sum of the number of operations performed at each level of the heap. b. Show that the overall time complexity of the procedure BuildHeap is O (n).

Problem 2: We are given a tree T with n nodes and a set X of distinct nodes in T of cardinality 2k (where k n/2). A matching of X in T is a partition of X into k pairs of nodes (x 1 , y1 ), (x2 , y2 ), . . . , (xk , yk ). Given T and X we want to nd a matching such that, for any two matched pairs (xi , yi ) and (xj , yj ), the simple paths pi from xi to yi and pj from xj to yj are edge disjoint. In the example illustrated below, the nodes in X are marked with a square and dashed lines show the paths between the matched vertices.

a. Prove that for each T and X there exists such a matching. b. Give a linear-time algorithm to compute the matching and justify its correctness.

Problem 3: Consider the following Reverse-Delete algorithm for the Minimum Spanning Tree (MST) problem. Start with a connected edge-weighted graph G = (V, E ). Consider edges in order of decreasing cost (breaking ties arbitrarily). When considering an edge e, delete e from E unless doing so would disconnect the current graph. Prove that Reverse-Delete computes a MST.

Problem 4: Consider the following problem. Given a set L of n (assume n even) positive integers, partition the set into two subsets A and B each of size n/2, such that the absolute value of the dierence between the sums of the integers in the two subsets is minimized. In other words, we want to minimize | xA x yB y | where A B = L, A B = and |A| = |B | = n/2. Give a pseudo-polynomial time algorithm for this problem and analyze its time complexity.

Problem 5: State and prove the max-ow/min-cut theorem (as presented in class).

Problem 6: Describe a sequence of languages L 1 , L2 , L3 , . . . such that each Ln is recognized by an n-state deterministic nite automaton, but L n is not recognized by any (n 1)-state deterministic nite automaton. Prove that your languages have the desired property.

Problem 7: Let M be a non-deterministic polynomial-time Turing machine. Dene the probability that M accepts an input w to be the number of accepting computation paths, divided by the total number of computation paths, when M is run on w. Dene L 1/2 (M ) to be the set of words that are accepted by M with probability greater than 1/2. a. Show that SAT equals L1/2 (M ) for some non-deterministic, polynomial-time Turing machine M. b. Dene the complexity class C = {L1/2 (M ) : M is a non-deterministic poly-time TM}. Show that if C = NP, then NP = co-NP.

Problem 8: Recall that the conguration of a Turing machine is dened by a triple (q, w, u), where q is the current state, w is the string to the left of the cursor, and u is the string to the right of cursor (including the symbol scanned by the cursor). Consider the RepeatsConfiguration problem dened below. Instance: A description M of a Turing machine and input tape I ; Query: Does the execution of M on the input I ever repeat a conguration? a. Is RepeatsConfiguration r.e.? b. Is RepeatsConfiguration undecidable? Justify your answers.

Problem 9: Dene Clip(L1 , L2 ) = {u : w L2 such that uw L1 }. If L1 , L2 are Turingrecognizable (r.e.) then so is Clip(L 1 , L2 )? Justify your answer.

Problem 10: A wheel in a graph G = (V, E ) is a subgraph that consists of a cycle and a center node connected to all nodes in this cycle. Prove that nding the largest wheel in a graph G is NP-hard.

- Alexandria ACM SC | Rigorous Computational Simulation of Dynamical SystemsUploaded byAlex ACM SC Library
- AlgorithmUploaded bySahista Machchhar
- ON THE CLASSIFICATION OF NP COMPLETE PROBLEMS AND THEIR DUALITY FEATUREUploaded byAnonymous Gl4IRRjzN
- Sample Data Structures Questions - Chapter 1Uploaded bykarthik
- Generating Functions - David Rhee - Canada 2008Uploaded byTaha
- Maximum Contiguous Sub Sequence SumUploaded byAvinash Kashyap
- lecture15Uploaded byvv
- Lecture 36: NP-CompletenessUploaded byJess
- Probabilistic MethodUploaded byRafih Yahya
- Combinatorics with Contributions to Modern Mathematics and Physics, by L. MaoUploaded byAnonymous 0U9j6BLllB
- Quantum AlgorithmsUploaded bydnunes_lncc
- 1.2.1_Complexity Oct 2013Uploaded byvarunsingh214761
- C analysisUploaded byKritika Khanna
- Complexity 121Uploaded byPavin Ka
- 3.Asymptotic Notations.pptxUploaded bysathwick
- Scimakelatex.24155.AtlUploaded byAnonymous oXL3YI
- CS502Uploaded byaftabyousuf
- Lecture 1Uploaded byspiritedfaraway
- Logarithms New June05Uploaded byAnand Srivastava
- csmpda01Uploaded byMansi Jain
- Mol Biol Evol 1999 Bandelt 37 48Uploaded byJames McInerney
- MetaAware Identifying Metamorphic MalwareUploaded byMukan Kuzey
- Arxiv-cs-Kolmogorov Complexity in Perspective. Part I- Information Theory and RandomnesUploaded bycrisolaris
- Graphing Exponential FunctionsUploaded byErin Ha
- ch13Uploaded byMarxlen Apostol Bedolido
- GeometryUploaded byDinda Ravi Algifari
- CS-E3190_lect01.pdfUploaded byYuri Shukhrov
- Sorting sUploaded byRavi Prasad
- C17_engine_code_05-8.pdfUploaded byalinalela
- Algorithms for Fuzzy SegmentationUploaded byHélio Júlio

- biblioUploaded byDaniel Romero
- Korn Shell 93 Date/Time String Manipulation and ArithmeticUploaded byFinnbarr P. Murphy
- MPLAB XC8 C Compiler User Guide for PICUploaded byadilsondisso
- Assembly Language Lecture6Uploaded bymysticsoul
- Developer’s Guide to Microsoft UnityUploaded bynando_baqueiro
- Array_pt2_&_StringUploaded byong kar weng
- Reg 2017 Syllabus B.E. CSEUploaded byVinod Deenathayalan
- cm303Uploaded byapi-3849444
- MarkUploaded byAnuj Saini
- Penetration TestingUploaded byneelima_sriram
- ResumeUploaded byJulianWeber
- Branch InstructionsUploaded bynikhilesh walde
- dataUploaded byIsaac (Infurious)
- Interpolation techniqueUploaded bySandya Kulkarni
- Ant Colony OptimizationUploaded byahmed_shaheeb
- 3. Architecture 8086.pptUploaded byFatima Irfan
- Vocational Project Report (1)Uploaded bybrang123
- Genetic AlgorithmsUploaded byRemilCv
- ummu ictUploaded byanon_443782841
- Purposeful knowledge about popular Hadoop platformsUploaded byMrigendra k Sharma
- abcwefghij.pdfUploaded byPramod kumar bhandari
- Parallelization of BFS Graph Algorithm Using CUDAUploaded byeditor_ijcat
- Manual de ErrosUploaded bywgghwh
- CUDA C Best Practices GuideUploaded by.xml
- 311165355-Data-Structures.pdfUploaded byGaurav Chopra
- Object Oriented DevelopmentUploaded bysurenyoga
- Introduction to Information SystemsUploaded byAbhishek Roy
- Epitome Apr 2017Uploaded byaayushkhanduja
- PrePhDSyllabus ManagementUploaded byranbir888
- 1Uploaded byRiajimin