Class: CSE 16 Subject: computer-science discrete-math Date: 2024-10-16 Teacher: Prof. Musacchio

Counting

  • If n and k are integers, then denotes the number of subsets that can be made by choosing elements from an -element set. We read as “n choose k.” (Some textbooks write instead of .)

Example

Formula

= 0 if: or

Example

  • How many 5-element subsets of A = {1, 2, 3, 4, 5, 6, 7, 8, 9} have exactly two even elements? Solution
  • First select two of the four even elements from A. There are = 6 ways to do this.
  • There are = 10 ways to select three of the five odd elements of A
  • By the multiplication principle, there are \binom{4}{2}$$\binom{5}{3} = 6 · 10 = 60 ways to select two even and three odd elements from A

Example 1

  • How many ways are there to deal two 5 card hands and have one leftover pile of 42 cards? Solution or
Multinomial Coefficient

Example 2

  • How many ways to pick a 5 card hand(set) from a 52 card deck so that 47 cards are not in hand? Solution *Note:

Example 3

  • How many 5 card hands consist of a straight flush where the Ace can be considered high or low as needed? Solution

  • Let L be the set of all possible card values: L = {2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K, A}

  • Le S be the set of all suits: S = {H, D, S, C}

  • 4 ways to pick suit, 10 cards to pick(card value: max at 10) = 40