Mohamed G. Gouda CS 311 Fall 2013 Homework 3 1) Show that the complete bipartite graph K2,6 is planar. Sol: This graph can be drawn on a plane, without any two edges being crossed, as follows: a. Draw vertex 1 at the top of the plane, draw vertex 8 at the bottom of the plane, and draw the vertices 2 to 7 in a horizontal line in the middle. b. Add the edges (1,2), (1,3), (1,4), (1,5), (1,6), (1,7). c. Add the edges (2,8), (3,8), (4,8), (5,8), (6,8), (7,8). Because the graph K2,6 has more than 2 edges, and it can be drawn on a plane without any two edges being crossed, this graph is planar. 2) Let f be a function whose domain is the set {1,2,5}, (a) Define function f and its codomain such that the inverse of f is f itself. (b) Define function f and its codomain such that the inverse of f is different from f. Define the inverse of f in this case. Sol: (a) Codomain of f is {1,2,5}. Function f is defined as: f(1) = 1, f(2) = 2, f(5) = 5. (b) Codomain of f is {1,2,5}. Function f is defined as: f(1) = 2, f(2) = 5, f(5) = 1. The inverse f' of f is defined as: Domain = {1,2,5} Codomain = {1,2,5} f'(1) = 5, f'(2) = 1, f'(5) = 2 3) Let f:A->B be a function and let A1 and A2 be two nonempty subsets of A. Give a two-sided inference proof that proves (f(A1) v f(A2)) = (f(A1 v A2)). Sol: y in (f(A1) v f(A2)) <=> {definition of "v"} (y in f(A1)) or (y in f(A2)) <=> {definition of function f} (Exist x in A1, f(x) = y) or (Exist x in A2, f(x) = y) <=> {property of Exist, definition of "v"} (Exist x in (A1 v A2), f(x) = y) <=> {definition of function f} y in f(A1 v A2) 4) Let f:A->B be a function and let A1 and A2 be two overlapping nonempty subsets of A. (a) Guess values for A, B, f, A1, and A2 that make f(A1 ^ A2) unequal to f(A1) ^ f(A2). (b) Guess values for A, B, f, A1, and A2 that make f(A1 ^ A2) equal to f(A1) ^ f(A2). Sol: (a) A = {x,x',x"} B = {y,y'} f : f(x) = y, f(x') = y', f(x") = y A1 = {x,x'} A2 = {x',x"} f(A1 ^ A2) = f{x'} = {y'} f(A1) ^ f(A2) = {y,y'} ^ {y',y} = {y,y'} f(A1 ^ A2) != f(A1) ^ f(A2). (b) A = {x,x'} B = {y,y'} f : f(x) = y, f(x') = y' A1 = {x} A2 = {x} f(A1 ^ A2) = f{x} = {y} f(A1) ^ f(A2) = {y} ^ {y} = {y} f(A1 ^ A2) = f(A1) ^ f(A2). 5) Let f: A->B be a bijective function, and let g: B->A be the inverse of f. Show that the composite function (g.f) has an inverse. Sol: We need to prove by direct inference that (g.f) is both 1-1 and onto. Proving (g.f) is 1-1: (g.f)(x1) = (g.f)(x2) => {definition of (g.f)} g(f(x1)) = g(f(x2)) => {g is 1-1 since g is bijective} f(x1) = f(x2) => {f is 1-1 since f is bijective} x1 = x2 Proving (g.f) is onto: x in A => {g is inverse of f} (g.f)(x) = x => {property of Exist} Exist x1 in A, (g.f)(x1) = x