------------------------------------------------------------------------------ Mohamed G. Gouda CS 311 Fall 2014 Homework 2 ------------------------------------------------------------------------------ 1. (2 points) Let G be a disconnected graph that has 13 edges. G consists of two connected components G1 and G2. G1 has 4 vertices whose degrees are 2, 3, 3, x. G2 has 8 edges and 5 vertices whose degrees are 3, 3, 3, 3, y. Compute the values of x and y. ------------------------------------------------------------------------------- 2. (2 points) A tree is defined as a connected graph that has no cycle of length at least 3. (a) Can a tree be also defined as a connected graph that has no cycle? Explain your answer. (b) Can a tree be also defined as a connected graph that has no cycle of length at least 1? Explain your answer. ------------------------------------------------------------------------------- 3. (2 points) Prove by induction the predicate (All n, n >= 1, any tree with n vertices has (n-1) edges). ------------------------------------------------------------------------------- 4. (2 points) Let G = (V, E) be a planar connected graph that has 6 vertices whose degrees are 1, 1, 2, 2, 3, 3. Compute the number of regions in G. ------------------------------------------------------------------------------- 5. (2 points) Let G be a planar disconnected graph that consists of 2 connected componenets G1 and G2. G1 has 3 edges and the two sides of each edge in G1 belong to distinct regions. G2 has 7 edges and the two sides of each edge in G2 belong to the same region. Compute the sum of region degrees in G. ------------------------------------------------------------------------------- Solutions: ------------------------------------------------------------------------------- 1. G1 = (V1, E1) has 13-8 = 5 edges Applying Handshake Theorem to G1, 2*|E1| = 2*5 = 10 = Sum of deg(u)'s in G1 = 2+3+3+x = 8+x Thus x = 2. Applying Handshake Theorem to G2, 2*|E2| = 2*8 = 16 = Sum of deg(u)'s in G2 = 3+3+3+3+y = 12+y Thus y = 4. -------------------------------------------------------------------------------- 2. (a) No because each graph (whether a tree or not) has at least one vertex and so has a cycle of length 0. (b) Yes because no cycle is of length 1 or of length 2. Thus, stating that a tree has no cycle of length at least 3 is the same as stating that a tree has no cycle of length at least 1. --------------------------------------------------------------------------------- 3. Let P(n) be the predicate "any tree with n vertices has (n-1) edges" Base case: n = 1: P(1) <=> {any tree with 1 vertex has no edges} T Induction step: A direct inference proof of (All n, n >= 1, P(n) => P(n+1)) proceeds as follows P(n) => {big hint: Let TR be any tree with (n+1) vertices; from the Theorem of Tree Leaves, TR has a leaf u that is connected with an edge (u,v) to a tree TR' with n vertices; from P(n), tree TR' has (n-1) edges; thus, TR has n edges} P(n+1) --------------------------------------------------------------------------------- 4. From Handshake Theorem, 2*|E| = Sum of deg(u)'s = 1+1+2+2+3+3 = 12 Thus, |E| = 6 From Euler Formula, (|V| - |E| + |R|) = 2 Thus from |V|=6 and |E|=6, |R| = 2 ---------------------------------------------------------------------------------- 5. Applying the Region Handshake Theorem to G1, Sum of region degrees in G1 = 2*|E1| = 6 Applying the Region Handshake Theorem to G2, Sum of region degrees in G2 = 1*|E2| = 7 Sum of region degrees in G = 6+7 = 13 -----------------------------------------------------------------------------------