Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Discrete Math Midterm 2014 Name Student # Note: The numbers used in the question varied from exam to exam, so your exam might have a different numerical answer than the one given below. 1. (3 pts) Sixteen people are to be seated at two circular tables, one seats 10 people and the other seats 6. How many different seating arrangements are possible? Solution There are 16 ways to divide the people amoung the two tables. The number 10 of arrangements at the two tables are 9! and 5!. So 16 · 9! · 5!. 10 2. (8 pts) (a) Count the number of walks in the plane from (0, 0) to (4, 9), using only steps that go one unit up or 1 unit to the right. (b) How many from (a) hit the point (2, 5)? (c) How many from (a) do not hit the point (4, 8)? (d) The walks in (a) are walks of 13 steps. How many walks of 15 steps are there from (0, 0) to (4, 9)? (You can now use steps going one unit down or left and you can visit points more than once. ) Solution (a) 13 : 4 there are 4 + 9 = 13 steps and any four of them can be chosen as the up steps. (b) 72 · 62 : we can go from (0, 0) to (2, 5) in 72 ways, and from (2, 5) to (4, 9) in 13−7 ways. 4−2 (c) 12 : we must go from (0, 0) to (3, 9) and then go right. 3 (d) 15! 15! + 10!4! : we have 9!5! 15! , or 4 steps right, 9!5! either 5 steps right, 1 step left, and 9 steps up: 15! 10 steps up, and 1 one step down: 10!4! . 3. (3 pts) How many ways are there to colour the vertices of a path of length 7, (so having 8 vertices,) so that three vertices are red, two are blue, and three are yellow? Solution 8 5 . 3 3 4. (8 pts) (a) How many integer solutions are there to the following x1 + x2 + x3 + x4 = 8, xi ≥ 0, i = 1, . . . , 4. Solution Arrange three dividers and 8 dots: 8+3 3 = 11 . 3 (b) How many ways are there to distribute 20 indentical dimes among 4 children, if the youngest must get at least one dime, the second youngest must get at least two dimes, the second oldest must get at least 3 dimes, and the oldest must get at least 4 dimes. Solution This leaves 10 dimes to distrubute among the 4 children with no restrictions, so can be done in 13 ways. 3 (c) For which positive integer n ≥ 19 will the equations x1 + x2 + · · · + x19 = n, and x1 + x2 + · · · + x64 = n, have the same number of positive integer solutions. (Note that this question is a lot harder if you allow solutions with zero.) Solution (A bit hard.) The two equations have (n−19)+18 = n−1 and 18 18 (n−64)+63 n−1 = solutions respectively. These are equal when 18 + 63 = 63 63 n − 1. That is, when n = 82. (d) How many nonnegative integer solutions are there to the pair of equations x1 + x2 + · · · + x7 = 37 and x1 + x2 + x4 = 6? Solution There are 6+2 solutions to the second equation, and once one is chosen the 2 first equations reduces to x3 + x5 + x6 + x7 = 31, which has 31+3 solutions. 3 . So 82 · 34 3 5. (3 pts) Determine if ¬(p ∧ ¬q) → ¬p is a tautology. Solution The truth assignments p = 1 and q = 1 yield a false for the statements, so it isn’t a tautology. (You could find this with a truth table.) 6. (3 pts) Define the connectives • ‘↑’ by (p ↑ q) ⇐⇒ ¬(p ∧ q), and • ‘↓’ by (p ↓ q) ⇐⇒ ¬(p ∨ q). Show that ¬(p ↓ q) ⇐⇒ (¬p ↑ ¬q). Solution ¬(p ↓ q) ⇐⇒ ¬(¬(p ∨ q))defn ⇐⇒ ¬(¬p ∧ ¬q)DeMorgan ⇐⇒ ¬(p ↑ q)defn 7. (6 pts) (a) If A = {1, 2, 3, . . . , 10}, what is |P(A)| ? Solution 210 (b) With A as above, what is |{B | (B ∈ P(A)) ∧ (|B| = 4)}|? Solution This is the number of 4-element subsets of a 10-element set, so is 10 . 4 (c) Give an example of three sets X, Y , and Z, such that X ⊆ Y and Y ⊆ Z, but X 6⊆ Z, or show that three such sets cannot exist. Solution Such sets cannot exist. We had a theorem in class that said that if X ⊆ Y and Y ⊆ Z then X ⊆ Z. Three sets meeting the conditions above would be a counterexample to this theorem. (d) Give an example of three sets X, Y , and Z, such that X ∈ Y and Y ∈ Z, but X 6∈ Z, or show that three such sets cannot exist. Solution For any X, X, Y = {X}, and Z = {{X}} are sets meeting these conditions, because X ∈ {X} = Y and Y = {X} ∈ {{X}} = Z, but X 6∈ {{X}} = Z. 8. (6 pts) Let A, B, C ⊂ U . Recall that A − C = A ∩ C. Prove or disprove the following two identities. (a) (A ∪ C) − C = A − C. (b) [(A ∩ C = B ∩ C) ∧ (A ∪ C = B ∪ C)] ⇒ A = B. Solution (i) A∪C−C = = (A ∪ C) ∩ C defn = (A ∩ C) ∪ (C ∩ C)distribution = (A ∩ C) ∪ ∅Inverse = (A ∩ C)Identity = A − C defn (ii) Assume that (A ∩ C = B ∩ C) and (A ∪ C = B ∪ C). Then A = A ∩ (U )identity = A ∩ (C ∪ C)inverse = (A ∩ C) ∪ (A ∩ C)distribution = (A ∩ C) ∪ (A − C)defn = (A ∩ C) ∪ (A ∪ C − C)part (i) = (B ∩ C) ∪ (B ∪ C − C) assumption = B All previous steps in reverse 9. (5 pts) Two integers are selected at random from {1, 2, . . . , 60} (without replacement). (a) What is the probability that they are consecutive? (b) What is the probability that their sum is odd? Solution (a) There are 60 possible choices of two numbers, and there are 59 pairs 2 (i, i + 1) of consecutive numbers. So the probability is 59/ 60 = 2/60. (b) 2 To have an odd sum, we need an even and an odd number. There are 302 ways to choose these out of the 60 possible ways to choose two numbers. So 2 60 the probability is 302 / 2 = 30/59. 10. (3 pts) If the probability that a randomly chosen 6 element subset of [n] = {1, 2, . . . , n} contains the element n is 0.2, what is n. Solution outcomes and the event of chosing an n The universe of choices contains n 6 outcomes- five other elements will be chosen from the remaincontains n−1 5 ing n − 1. So the probability of this event is n−1 (n − 1)! · (n − 6)!6! 6 5 0.2 = = . n = (n − 1 − 5)!5! · n! n 6 Solving 1/5 = 6/n, we get n = 30. 11. (5 pts) Show that for n ≥ 1, n X i3 = i=1 n2 (n + 1)2 4 Solution We do this by induction on n. We take n = 1 for the base case. For this, P 12 (2)2 observe that 1i=1 i1 = 13 = 1 = . The identity holds for n = 1. Now 4 assuming that it holds for n = α − 1 we show that it holds for n = α. Indeed, α X i3 = i=1 i3 + α3 i=1 = = = = = as needed. α−1 X (α − 1)2 (α)2 + α3 by the induction hypoth. 4 (α − 1)2 (α)2 + 4α3 4 (α)2 4α + (α − 1)2 4 (α)2 α2 − 2α + 1 4 (α)2 (α − 1)2 4