Discrete Structures Final Exam Study Guide In what follows, I will give examples for questions similar to the questions in the fjnal exam with a short solution for them. Given a set of possible characters, how many strings of a certain length can be made with this? Examples: ś Characters: aśz Length: 10 Strings: 26 10 ś Characters: aśz, AśZ, 0ś9, !, @, $, %, & Length: 10 ś 25 25 � 67 l Strings: l =10 For each character, there are 67 options. For length 10, this makes 67 10 possible string. For length 11, 67 11 possible strings, and so on. Adding the possibilities for each length together, we get � 25 l =10 67 l . Given a grid where you can only move up or right, how many paths are there from one point to another? (See Section 6.4, Problem 33) B Width: 5 Height: 3 Paths from A to B : C (5 + 3 , 3) A Paths from A to X : C (2 + 2 , 2) B Paths from X to Y : C (3 + 1 , 1) Paths from Y to B : C (2 + 2 , 2) Y Paths from A to B passing X and Y : X C (2 + 2 , 2) · C (3 + 1 , 1) · C (2 + 2 , 2) A Pigeonhole Principle There are 38 difgerent time periods during which classes at a university can be scheduled. If there are 677 difgerent classes, how many difgerent rooms will be needed? � 677 � = 18 38
Prove that at a party where there are at least two people, there are two people who know the same number of other people there. We assume that łknowing" is symmetric. Therefore, there cannot be a person who knows everybody and a person who knows nobody at the same time. Thus, there are n − 1 łboxes" we can assign people to. However, because here are n people on the party, there is at least one box with two people. Bernoulli Trails You fmip a coin 20 times where the chance for heads is 0 . 7 for each fmip. What is the probability, that you get heads exactly 5 times? � 20 � · 0 . 7 5 · (1 − 0 . 7) 20 − 5 5 You generate a bit string of length 8 . The chance to get a ‘0’ is 0 . 25 . What is the probability, that you get a string with at most 2 ‘0’s? � 8 � � 8 � � 8 � · 0 . 25 0 · (1 − 0 . 25) 8 − 0 + · 0 . 25 1 · (1 − 0 . 25) 8 − 1 + · 0 . 25 2 · (1 − 0 . 25) 8 − 2 0 1 2 General formula: � n � · p k · (1 − p ) n − k k Independence of Events (See Section 7.2, Problem 16 ) Assume, E and F are independent events. Show that E and F are independent. p ( E ∩ F ) = p ( E ∪ F ) = 1 − p ( E ∪ F ) = 1 − p ( E ) − p ( F ) + p ( E ∩ F ) = 1 − p ( E ) − p ( F ) + p ( E ) p ( F ) = (1 − p ( E ))(1 − p ( F )) = p ( E ) p ( F ) Useful formulas: ś p ( E ) = 1 − p ( E ) ś p ( E ∪ F ) = p ( E ) + p ( F ) − p ( E ∩ F ) ś If E and F are independent, p ( E ∩ F ) = p ( E ) p ( F ) Given a relation, determine if it is refmexive, symmetric, antisymmetric, and/or transitive. Defjnitions (short form): Refmexive ∀ a : aRa Symmetric ∀ a, b : aRb → bRa
Anti-Symmetric ∀ a, b : aRb, bRa → a = b Transitive ∀ a, b, c : aRb, bRc → aRc Example: R = { ( A, B ) | A ∩ B ̸ = ∅ } for all sets A and B ś Not refmexive, because ( ∅ , ∅ ) / ∈ R . ś Symmetric, because A ∩ B = B ∩ A . ś Not anti-symmetric. Counterexample: { 1 , 2 } and { 1 } . ś Not transitive. Counterexample: { 1 , 2 } , { 2 , 3 } and { 3 , 4 } . Given a graph representing a relation, add edges such that it becomes an equivalence relation or partial ordering. Equivalence relation: refmexive, symmetric, transitive Partial ordering: refmexive, anti-symmetric, transitive 1 6 3 4 Given Graph 1 6 4 3 Equivalence Relation Partial Ordering
Recommend
More recommend