* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download BU-CmpE 220 Discrete Mathematics bingol/Spring 2009 Final, 3
Survey
Document related concepts
Transcript
BU-CmpE 220 Discrete Mathematics Final, 3 hours bingol/Spring 2009 Jan 14, 2010 Read me. Answer n should go to page n. Be clear, precise, short, necessary and sufficient in your answers. Otherwise prepare to lose points. Open textbook, course handouts and your own handwritten notes, only. ”Rosen 85/8” means the question 8 on page 85 of the textbook (Rosen 6e). Keep the question sheet. Show your own work. No questions. No exchange of information, books, notes, pencils etc. No photocopied material. No phones. Good luck. Q1 [20] 5109094x171709440000 = 21!, find the missing digit x. Solution. Note that 21! is divisible by 9. A number is divisible by 3 (or 9) iff the sum of its digits is divisible by 3 (or 9). So sum the digits is 61 + x which is divisible by 9 when x = 2. Q2 [20] Positive integers 1, 2, . . . , 4n − 1 are written on the board. At each step, two numbers are erased and the difference of the two is written back. After 4n − 2 steps there would be one number left on the board. Prove that the last number is even. Solution. Initially there are 2n odd numbers on the board. At each step there are three cases depending on selection of the two numbers: Even, even: Two even numbers are erased. The difference is even. The number of odd numbers is not changed. Even, odd: An even and an odd number are erased. Their difference is odd. The number of odd numbers is not changed. Odd, odd: Two odd numbers are erased. Their difference is even. The number of odd numbers is reduced by 2. So at each step the number of odd numbers is either not changed or reduced by 2. Therefore starting 2n odd numbers, the number of odd numbers reduces by 2. Hence the last number cannot be odd. Q3 [20] Suppose 2n people, each has at least n friends, are invited to a diner. The host wishes to seat everyone around a circle table such that everyone is seated next to at least one of her friends. Is it possible? Solution. Construct the following graph: represent each person at this party with a node, and if two people x and y are friends then place an edge between nodes corresponding to x and y in the graph. The desired seating arrangement can be achieved if this graph contains a cycle which contains all the nodes exactly once. If such a cycle exists, people who are adjacent on this cycle will be seated next to each other. Since an edge between nodes represents acquaintance, everyone will be seating next to one of her friends. A cycle which contains all the vertices exactly once is called an Hamiltonian cycle 1 and according to the Dirac’s Theorem in the textbook, a simple graph G with m vertices with m ≥ 3 such that the degree of every vertex in G is at least m/2 has a Hamiltonian cycle. Since every person at this party has at least n friends, the degree of each node in the graph we constructed is at least m/2 where m = 2n is the number of vertices. Hence, if there are more than 3 people at the party, Dirac’s theorem guarantees that the people at the party can be seated around a table so that everyone is seated at least one of her friends. For the case where there are only 2 people at the party, they should be friends, since each of them should have at least 1 friend at the party. When these two people are seated around a table, they will be sitting next to each other. Hence, each one will be sitting next to a friend. Q4 [20] n Consider the set { 0, 1, 2 } of n-bit ternary strings. How many of these strings has even number of 0s in it? Find a recurrence and solve it. Solution. Let a(n) denote the number of ternary strings of length n which contain an even number of 0’s. A ternary string of length n which contain an even number of 0’s can be obtained from a ternary string of length n − 2 as follows: • if the string contains an even number of 0’s append a ternary string of length 2 – which does not contain any 0’s. Hence the number of 0’s in the string does not change and remains even. This can be done 2*2 ways since for every symbol we add, there are two choices 1 or 2. 11 12 (1) .......... + | {z } 21 n − 2 symbols even number of 0’s 22 | {z } 4 ways – which contain exactly two 0’s. Hence the number of 0’s in the string is still even. This can be done in only one way by appending 00 .......... + |{z} 00 | {z } 1 way n − 2 symbols even number of 0’s (2) Hence for every string of length n−2 which contain an even number of 0’s, 5 strings of length n which contain an even number of 0’s can be obtained. The number of such strings become 5 ∗ a(n − 2) • if the string contains an odd number of 0’s append a ternary string of length 2 which contains an odd number of 0’s, namely just one 0. 01 02 + (3) .......... | {z } 10 n − 2 symbols odd number of 0’s 20 | {z } 4 ways 2 Hence for every string of length n − 2 which contain an odd number of 0’s, 4 strings of length n which contain an even number of 0’s can be obtained. The number of strings of length n − 2 with odd number of 0’s is 3n−2 −a(n−2), total number of ternary strings of length n minus a(n−2). The number of such strings become 4 ∗ (3n−2 − a(n − 2)) 5 ∗ a(n − 2) + 4 ∗ (3n−2 − a(n − 2)) a(n) = 5 ∗ a(n − 2) + 4 ∗ 3n−2 − 4 ∗ a(n − 2) a(n − 2) + 4 ∗ 3n−2 = = a(n) = a(n − 2) + 4 ∗ 3n−2 a(1) = 2 a(2) = 5 n≥3 (1 and 2) (00, 11, 12, 21, 22) Solving the Recurrence: a(n) a(n − 2) a(n − 4) ...... a(4) = a(n − 2) + 4 ∗ 3n−2 = a(n − 4) + 4 ∗ 3n−4 = a(n − 6) + 4 ∗ 3n−6 ........... = a(2) + 4 ∗ 32 by adding the above equations side by side we get: a(n) = = a(2) + 4 ∗ (32 + 34 + ... + 3n−2 ) 5 + 4 ∗ 32 ∗ (1 + 32 + .... + 3n−4 ) | {z } A 3n−2 − 3 = 5 + 4 ∗ 32 ∗ ( ) 8 n 3 − 27 = 5+( ) 2 Q5 [20] Theorem 0.1. Let G be a group. G abelian if the order of G ≤ 5. Prove the theorem for orders 2, 3, and 4. No need to prove for 5. Solution. Case i Order of G is 2. Hence G has two elements. Since G is a group, one of these elements must be the identity element, say e. Then, for the other element of G, say a, e ∗ a = a ∗ e = a must hold since e is the identity element. Since a and e are the only elements of G, commutativity is satisfied for every element of G. Hence G is abelian group. 3 Case ii Order of G is 3. Let G = {e, a, b} where e is the identity element. Then a ∗ e = e ∗ a = a and b ∗ e = e ∗ b = b by the definition of identity element. For G to be abelian group, a ∗ b = b ∗ a must hold too. Note that a ∗ b or b ∗ a can not be equal to a or b since a and b are not identity elements. (a ∗ b = a ⇒ b = e ) Hence, a ∗ b = e and b ∗ a = e ⇒ a ∗ b = b ∗ a So, ∀x, y ∈ G(x ∗ y = y ∗ x) ⇒ G is abelian. Case iii Order of G is 4. Let G = {e, a, b, c} where e is the identity element. a∗e=e∗a=a b ∗ e = e ∗ b = b since e is the identity element c∗e=e∗c=c For G to be commutative a ∗ b = b ∗ a, b ∗ c = c ∗ b and a ∗ c = c ∗ a must hold too. Consider a ∗ b. It cannot be equal to a or b since e is the only identity element. If a ∗ b = e, then a is the inverse of b. Since in a group inverses are unique, a ∗ b = b ∗ a = e must hold. If a ∗ b = c, then b ∗ a = c must be true, since otherwise b ∗ a = e will imply that a ∗ b = b ∗ a = e by the definition of inverses. The same argument will show that b ∗ c = c ∗ b and a ∗ c = c ∗ a hold. Hence G is abelian. Q6 [20] If G = [ V, E ] be a graph, then either G or Ḡ (or both) are connected. Solution. If G is connected, then there is nothing to prove. Suppose G is not connected. We will show that Ḡ is connected. Pick any two vertices a and b. case 1) a and b are from different components of G. Since a and b are from different components, the edge { a, b } ∈ Ḡ. Hence a and b are connected. case 2) a and b are from the same component of G. Pick any c from a different component of G. Due to case 1, we have { a, c } ∈ Ḡ and { c, b } ∈ Ḡ. Hence a and b are connected. Quotation of the day: Russell, Bertrand (1872-1970) “If I were a medical man, I should prescribe a holiday to any patient who considered his work important.” In The Autobiography of Bertrand Russell. source: http://math.furman.edu/˜mwoodard/mqs/mquot.shtml. 4