503MidtermExamSolutionsF03

503MidtermExamSolutionsF03 - UML CS 91.503 Midterm Exam...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
UML CS 91.503 Midterm Exam Fall, 2003 MIDTERM EXAM SOLUTIONS 1: (6 points) What can you conclude? First, observe that 3 log log 3 log log 3 3 3 3 4 3 3 27 27 n n n n n = = = < . This implies: ) ( ) ( 3 2 n O n f . n 2 n n 4 lg 3 n 4 log 27 a) (3 points) Can we conclude from statements (1)-(3) that Why or why not? Either prove or provide a counterexample. SOLUTION: No. Counterexample: n n f 3 ) ( 1 = , n n f 2 ) ( 3 = . 1 of 10 ? )) ( ( ) ( 3 1 n f O n f ( 29 n O n f 4 log 2 27 ) ( ) 2 ) 2 ( ) ( ) 3 3 n n f Θ ( 29 n n n f 4 3 1 lg ) ( ) 1 f 2 (n) f 3 (n) f 1 (n)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
UML CS 91.503 Midterm Exam Fall, 2003 b) (3 points) Can we conclude from statements (1)-(3) that Why or why not? Either prove or provide a counterexample. SOLUTION: Yes. Proof: We observed above that ) ( ) ( 3 2 n O n f . This implies that )) ( ( 2 3 n f n . Now, ) ( lg 3 4 3 n n n , so by transitivity we have )) ( ( lg 2 4 3 n f n n . This, together with ) lg ( ) ( 4 3 1 n n n f , imply transitively that )) ( ( ) ( 2 1 n f n f . 2: (24 points) This question involves the paper: “ On calculating connected dominating set for efficient routing in ad hoc wireless networks .” Consider the algorithm that consists of the following two steps: 1) dominating set formation, consisting of the marking process on p. 8; 2) creating all-pair shortest paths for the dominating set resulting from step 1. a) (2 points) Give an example of a best-case input for this algorithm, where “best” relates to the size of the dominating set (not running time). SOLUTION: Since the goal is to minimize the size of the dominating set, “best” here means smallest dominating set size. If we allow a complete graph as input, then a complete graph is a best-case input because the algorithm returns an empty dominating set in this case. To see this, observe that, since each pair of nodes is connected, no node has an unconnected pair of neighbors. If we do not allow a complete graph as input, then a best-case n-node input has one node of degree n-1 that is connected to each other node. Each other node has degree 1. In this case, the algorithm returns a dominating set consisting of the node of degree n-1. 2 of 10 ? )) ( ( ) ( 2 1 n f n f
Background image of page 2
UML CS 91.503 Midterm Exam Fall, 2003 b) (2 points) Give an example of a worst-case input for this algorithm, where “worst” relates to the size of the dominating set (not running time). SOLUTION: A worst-case n-node input produces a maximum -sized dominating set. Such an input consists of a single cycle of nodes. That is, each node has degree 2 and the nodes are connected in a ring shape. In this case, each node’s neighbors are unconnected so each node is part of the dominating set. The dominating set therefore has size = n. c)
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 10

503MidtermExamSolutionsF03 - UML CS 91.503 Midterm Exam...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online