1. The sum and the inclusion-exclusion principle

The sum

Cardinality

We denote the size, or cardinality, of a finite set by: $\boxed{|S|}$

Note:

For example:

  • Let hence . It is said that the cardinality of is 3, or has 3 elements.
  • If then .
Link to original

The sum rule

The sum rule states that if and are disjoint sets then $|A| + |B|$.

According to the sum rule, if are parwise disjoint sets then $|A_1| + |A_2| + ... + |A_n|$.

title: Example
A student can choose one project from project lists of three lecturers.
- John's list has 11.
- Bill's has 10.
- Eve's has 8.
 
No project occurs twice. How many possible projects are there to choose from?
- $A = \{ p | p \text{ is a project on John's list} \}$
- $B = \{ p | p \text{ is a project on Bill's list} \}$
- $C = \{ p | p \text{ is a project on Eve's list} \}$
 
Hence $|A \cup B \cup C| = |A| + |B| + |C| = 29$.
Link to original

Inclusion-exclusion principle

Inclusion-exclusion principle

The inclusion-exclusion principle states that $|A| + |B| - |A \cap B|$.

The inclusion-exclusion principle can be applied for three sets, by applying the same rule twice, , giving us: ?

Link to original

Link to original

2. The product rule

The product rule

The product rule

If there is a sequence of tasks such that:

  • there are ways to do the first task
  • to do the second
  • to do the th task ? Then, there are ways to do the whole sequence of tasks
title: Example 1
If each number plate contains a sequence of three letters followed by three digits (and no such sequence is prohibited), then the number of available different number plates is:
 
$$
	26 \cdot 26 \cdot 26 \cdot 10 \cdot 10 \cdot 10 = 17, 576, 000
$$

Usage with functions

If and then the number of different functions is: ?

title: Example 2 (with functions)
Let $A = \{ a,b,c \}, B = \{ d,e \} \rightsquigarrow n = 3, m = 2$.
- There are $2$ ways to choose a value for $a$.
Then there are $2$ ways to choose a value for $b$ and then $c$.
 
Hence $2^3 = 8$.
Link to original

Counting the subsets of a finite set

Let be a finite set having elements. How many subsets does have? Or otherwise, what is the cardinality of ?

We list the elements of . We can choose a subset of by going through this list and decide for each element whether it is in or not.

  • We have one ‘task’ for each element: tasks total
  • Each task can be done in two ways: IN or OUT We choose whether to leave it in or leave it out.

Hence, by product rule:

Combining sum and product rules

Take for example, how many four-digit numbers can begin with either or ?

  • The set can be broken down into two disjoint sets:
    1. four-digit numbers beginning with
    2. four-digit numbers beginning with
  • In case (1), if we begin with , there are digits to be filled in with choices each. Hence by product rule:
  • In case (2), there are digits to be filled with choices each. So .
  • Hence by sum rule, we combine these to be .
Link to original

3. The pigeonhole principle

The pigeonhole principle

Pigeonhole principle

If and or more objects are placed into boxes, then there is at least one box containing two or more objects.

If there are at least cocks and holes such that , then there must be at least hole with more than cock.

Link to original

For example:

  • Among any group of people, there must be at least two with the same birthdays.
  • If an exam is marked on a scale from to , then from students, there must be at least two with the same mark.
  • If and are finite sets with and is a function, then is not one-to-one.
  • For every , there is a multiple of that is not , and has only s and s for its digits. Take any , consider many numbers.
    • Observe that there are possible different remainders when a natural number is divided by , these are .
    • Because there are numbers on the above list, by the pigeonhole principle, there must be two with the same remainder when divided by .
    • Then “the larger of these numbers minus the smaller one”
      • is divisible by and so is a multiple of
      • has only s and s for its digits

Generalised pigeonhole principle

Generalised pigeonhole principle

The pigeonhole principle states that if objects are placed into boxes, then there is at least one box containing at least $\lceil n/k \rceil$ objects.

Link to original

For example:

  • Given people, there are at minimum who were born in the same month.
  • If the possible grades for a module are A through F, then among students, there are always at least with the same module grade, as .
Link to original

4-7. Four ways of selecting items

Four ways of selecting items

Say someone is given a bag containing three condiments:

  • A: pepper
  • B: salt
  • C: sugar

In how many ways can they select two sweets? We can follow different principles.

  • Order matters means whether we count and as different elements.
  • Repetition allowed means whether we allow elements to pair with themselves, e.g. , , .
HeaderOrder matters?Repetition allowed?Result
AAB, AC, BA, BC, CA, CB
BAA, AB, AC, BA, BB, BC, CA, CB, CC
CAB, AC, BC
DAA, AB, AC, BB, BC, CC

In summary:

Order matters
permutations
Order doesn’t matter
combinations
Repetitions
not allowed

Repetitions
allowed

Where is the total number of items, is the number of items we want to select.

Order matters, repetition not allowed

Order matters, repetition not allowed

How many ways can we select persons from a group of people to stand in line for a photo shoot? There are:

  • ways to select the first person
  • ways to select the second person
  • and so on until the ways to select the th person

So, using the product rule, we find that:

There is a special case when :

Link to original

Order matters, repetition allowed

Order matters, repetition allowed

How many words of length can be formed from the letters of an letter alphabet?

  • There are ways to select the first letter.
  • ways to select the second.
  • ways to select the th letter.

So by the product rule, the overall number is:

Link to original

Order does not matter, repetition not allowed

Order does not matter, repetition not allowed

How many ways can we select persons from a group of people if the order of selection does not matter?

  • As seen before, if the order of selection matters, there are ways.
  • But then for each set of people, we counted the the people in the number of ways persons can be ordered. ()
  • So, if the selection order does not matter, then the number of ways is: This leaves us with the binomial coefficient equation.
Link to original

Order does not matter, repetition allowed

Order does not matter, repetition allowed

Given we have an unlimited supply of types of fruit:

  • A: apples
  • O: oranges
  • P: peaches

How many ways are there to select pieces of fruit, if the order of selection does not matter, only the type of fruit / not the individual piece matters?

We could consider a box which can store 4 pieces of fruit, the box can have 3 compartments, each can store one of 3 types of fruit. Compartments are divided by 2 movable dividers that can be shifted depending on how many types of each fruit we want to store. For example:

  • 2 apples, 1 orange, 1 peach:
  • 4 oranges:
  • 1 apple, 3 peaches:
  • 4 apples:

So if we have to choose objects from a set of objects, with repetition allowed, we need a box with places for the chosen object and places for the dividers dividing the box into compartments.

Given any random box: , we have places.

The number of ways we can choose our objects is the number of ways we can distribute the dividers in the box. Out of the places, we hace to choose for the dividers. The number of ways of doing this is:

This formula should be remembered!

Going back to the example, we find that:

Link to original

Link to original