Download Discrete Math Cram Cheat Sheet and more Cheat Sheet Discrete Mathematics in PDF only on Docsity! Discrete Math Cram Sheet October 6, 2016 Contents 1 Propositional Logic 2 1.1 Truth Tables . . . . . . . . . . . . . . . . . . . 2 1.2 Logical Equivalences . . . . . . . . . . . . . . 2 1.3 Rules of Inference . . . . . . . . . . . . . . . . 2 1.4 Satisfiability . . . . . . . . . . . . . . . . . . . 3 2 Proofs 3 2.1 Well-Ordering Principle . . . . . . . . . . . . 3 2.2 Mathematical Induction . . . . . . . . . . . . 3 2.3 Strong Induction . . . . . . . . . . . . . . . . 3 3 Recurrence Relations 3 4 Number Theory 3 4.1 Divisibility . . . . . . . . . . . . . . . . . . . . 3 4.2 Primes and Factors . . . . . . . . . . . . . . . 3 4.3 Divisors . . . . . . . . . . . . . . . . . . . . . 3 4.4 Modular Arithmetic . . . . . . . . . . . . . . . 3 5 Graph Theory 4 5.1 Notation . . . . . . . . . . . . . . . . . . . . . 4 5.2 Definitions . . . . . . . . . . . . . . . . . . . . 4 5.3 Properties . . . . . . . . . . . . . . . . . . . . 4 6 Linear Algebra 4 7 Combinatorics 4 7.1 Permutations and Combinations . . . . . . . 4 7.2 Binomial Coefficients . . . . . . . . . . . . . . 5 7.3 Generalized Permutations and Combinations 5 7.4 Principle of Inclusion-Exclusion . . . . . . . . 5 7.5 Derangements . . . . . . . . . . . . . . . . . . 5 7.6 Catalan Numbers . . . . . . . . . . . . . . . . 6 7.7 Partitions . . . . . . . . . . . . . . . . . . . . . 6 7.8 Stirling Numbers . . . . . . . . . . . . . . . . 6 8 Probability 6 1 Discrete Math Cram Sheet alltootechnical.tk 1 Propositional Logic 1.1 Truth Tables p T T F F q T F T F F F F F F contradiction p ∨ q F F F T joint denial p 8 q F F T F converse nonimplication ¬p F F T T left negation p 9 q F T F F nonimplication ¬q F T F T right negation p⊕ q F T T F exclusive disjunction p Z q F T T T alternative denial p ∧ q T F F F conjunction p↔ q T F F T biconditional/equivalence q T F T F right projection p→ q T F T T implication p T T F F left projection p← q T T F T converse implication p ∨ q T T T F disjunction T T T T T tautology 1.2 Logical Equivalences Identity p ∧ T ≡ p p ∨ F ≡ p Domination p ∨ T ≡ T p ∧ F ≡ F Idempotent p ∧ p ≡ p p ∨ p ≡ p Commutative p ∧ q ≡ q ∧ p p ∨ q ≡ q ∨ p Associative p ∧ (q ∧ r) ≡ (p ∧ q) ∧ r p ∨ (q ∨ r) ≡ (p ∨ q) ∨ r Distributive p∨ (q ∧ r) ≡ (p ∨ q)∧ (p ∨ r) p∧ (q ∨ r) ≡ (p ∧ q)∨ (p ∧ r) De Morgan’s ¬ (p ∧ q) ≡ ¬p ∨ ¬q ¬ (p ∨ q) ≡ ¬p ∧ ¬q Absorption p ∧ (p ∨ q) ≡ p p ∨ (p ∧ q) ≡ p Negation p ∨ ¬p ≡ T p ∧ ¬p ≡ F Double Negation ¬ (¬p) ≡ p Involving Biconditionals p↔ q ≡ (p→ q) ∧ (q→ p) p↔ q ≡ ¬p↔ ¬q p↔ q ≡ (p ∧ q) ∨ (¬p ∧ ¬q) ¬ (p↔ q) ≡ p↔ ¬q Involving Conditional Statements p→ q ≡ ¬p ∨ q p→ q ≡ ¬q→ ¬p p ∨ q ≡ ¬p→ q p ∧ q ≡ ¬ (p→ ¬q) (p→ q) ∧ (p→ r) ≡ p→ (q ∧ r) (p→ r) ∧ (q→ r) ≡ (p ∨ q)→ r (p→ q) ∨ (p→ r) ≡ p→ (q ∨ r) (p→ r) ∨ (q→ r) ≡ (p ∧ q)→ r 1.3 Rules of Inference Modus Ponens p→ q p q Modus Tollens ¬q p→ q ¬p Associative (p ∨ q) ∨ r p ∨ (q ∨ r) Commutative p ∧ q q ∧ p Biconditional p→ q q→ p p↔ q Exportation (p ∧ q)→ r p→ (q→ r) Contraposition p→ q ¬q→ ¬p Hypothetical Syllogism p→ q q→ r p→ r Material Implication p→ q ¬p ∨ q Distributive (p ∨ q) ∧ r (p ∧ r) ∨ (q ∧ r) Absorption p→ q p→ (p ∧ q) Disjunctive Syllogism p ∨ q ¬p q Addition p p ∨ q Simplification p ∧ q p Conjunction p q p ∧ q Double Negation p ¬¬p Disjunctive Simplification p ∨ p p Resolution p ∨ q ¬p ∨ r q ∨ r 2 Discrete Math Cram Sheet alltootechnical.tk 7.2 Binomial Coefficients The binomial coefficient (nk) can be defined as the co- efficient of the xk term in the polynomial expansion of (x + 1)n, which occurs in the binomial formula (x + y)n = n ∑ k=0 ( n k ) xn−kyk ( n k ) = n! k! (n− k)! = ( n− 1 k− 1 ) + ( n− 1 k ) = ( n n− k ) Pascal’s Triangle Row 0: 1 Row 1: 1 1 Row 2: 1 2 1 Row 3: 1 3 3 1 Row 4: 1 4 6 4 1 Row 5: 1 5 10 10 5 1 Row 6: 1 6 15 20 15 6 1 Row 7: 1 7 21 35 35 21 7 1 Row 8: 1 8 28 56 70 56 28 8 1 Row 9: 1 9 36 84 126 126 84 36 9 1 Row 10: 1 10 45 120 210 252 210 120 45 10 1 7.3 Generalized Permutations and Combina- tions Permutations with Repetitions The number of permutations of length k from n distinct ob- jects where repetition is allowed is nk. Permutations with Duplicate Objects The number of permutations of a multiset of n objects made up of k distinct objects can be expressed as follows:( n n1, n2, . . . , nk ) = n! n1!n2! · · · nk! where ni represents the multiplicity of a distinct object i in the multiset. Combinations with Repetition (Stars and Bars) The number of combinations of length n using k different kinds of objects is nRk = ( n + k− 1 n− 1 ) = ( n + k− 1 k ) = (n + k− 1)! k! (n− 1)! Number of Non-negative Integer Solutions The num- ber of solutions of the equation x1 + x2 + · · ·+ xk = n in non-negative integers is (n+k−1k−1 ). Number of Positive Integer Solutions The number of solutions of the equation x1 + x2 + · · · + xk = n in posi- tive integers is (n−1k−1). 7.4 Principle of Inclusion-Exclusion This provides an organized method/formula to find the number of elements in the union of a given group of sets, the size of each set, and the size of all possible intersections among the sets. Two/Three Sets Suppose that A,B, and C are finite sets. Then: • |A ∪ B| = |A|+ |B| − |A ∩ B| • |A ∪ B ∪ C| = |A|+ |B|+ |C| − |A ∩ B| − |A ∩ C| − |B ∩ C|+ |A ∩ B ∩ C| General Form For finite sets A1, . . . , An, one has the identity: ∣∣∣∣ n⋃ i=1 Ai ∣∣∣∣ = n∑ i=1 |Ai| − ∑ 1≤i<j≤n ∣∣Ai ∩ Aj∣∣ + ∑ 1≤i<j<k≤n ∣∣Ai ∩ Aj ∩ Ak∣∣ − . . . + (−1)n−1 |A1 ∩ · · · ∩ An| = n ∑ k=1 (−1)k+1 ( ∑ 1≤i1<···<ik≤n ∣∣Ai1 ∩ · · · ∩ Aik ∣∣ ) 7.5 Derangements A derangement is a permutation of the elements of a set, such that no element appears in its original position. The number of derangements of n elements can be determined as follows: !n = (n− 1) (! (n− 1) +! (n− 2)) = n! n ∑ k=0 (−1)k k! OEIS A000166: 0, 1, 2, 9, 44, 265, 1854, 14833, 133496, 1334961, 14684570, 176214841, 2290792932, . . . 5 Discrete Math Cram Sheet alltootechnical.tk 7.6 Catalan Numbers Cn = 1 n + 1 ( 2n n ) = (2n)! (n + 1)! n! = n ∏ k=2 n + k k for n ≥ 0 = ( 2n n ) − ( 2n n + 1 ) = n−1 ∑ i=0 CiCn−i−1 OEIS A000108: 1, 1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796, 58786, 208012, 742900, 2674440, 9694845, 35357670, . . . Applications 1. number of expressions containing n pairs of paren- theses which are correctly matched 2. number of different ways n + 1 factors can be com- pletely parenthesized 3. number of full binary trees with n + 1 leaves 4. number of monotonic lattice paths along the edges of a grid with n× n square cells, which do not pass above the diagonal 5. number of triangulations of a convex polygon with n + 2 sides 6. number of permutations of {1, . . . , n} that avoid the pattern 123 (or any of the other patterns of length 3) 7. number of noncrossing partitions of the set {1, . . . , n} 8. number of ways to tile a stairstep shape of height n with n rectangles 9. number of ways to form a “mountain range” with n upstrokes and n downstrokes that all stay above the original line 10. number of semiorders on n unlabeled items 7.7 Partitions The function p (n, k) denotes the number of ways of writ- ing n as a sum of exactly k terms. p (n, k) = 1 if n = k = 0 0 if n < k p (n− 1, k− 1) + p (n− k, k) if n ≥ k 7.8 Stirling Numbers First Kind (Cycles) Counts number of permutations of n elements with k dis- joint cycles. [n k ] = 1 if n = k = 0 0 if n 6= k ∧ k = 0 (n− 1) [ n−1 k ] + [ n−1 k−1 ] if n, k > 0 Second Kind (Subsets) Counts the number of ways to partition a set of n objects into k non-empty subsets. {n k } = 1 if n = k = 0 0 if n 6= k ∧ k = 0 (k− 1) { n−1 k } + { n−1 k−1 } if n, k > 0 8 Probability 6