l2 supplementary notes page 1 04-02-2010: recap l sum principle n applied to selection sort l...

25
Page 1 L2 Supplementary Notes 04-02-2010: Recap Sum Principle Applied to selection sort Product Principle Applied to matrix multiplication and the next item Two element-subsets Set concepts and notations Sets, mutually disjoint sets, size, union, partition Set does not allow duplicates

Post on 22-Dec-2015

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1L2 Supplementary Notes

04-02-2010: Recap

Sum Principle Applied to selection sort

Product Principle Applied to matrix multiplication and the next item

Two element-subsets

Set concepts and notations Sets, mutually disjoint sets, size, union, partition Set does not allow duplicates

Page 2L2 Supplementary Notes

04-02-2010 Recap: Sum Principle

Page 3L2 Supplementary Notes

04-02-2010 Recap: Product Principle

Si and Sj are disjoint, |Si| = n

S = S1 U S2 U … U Sm

|S| = m |Si| = mn

Page 4L2 Supplementary Notes

04-02-2010 Today First 3 items on Page 2 of “ More Counting”

Page 5L2 Supplementary Notes

More counting, Page 4 (MC 4)

Page 6L2 Supplementary Notes

Use of Product Principle in Entry Code Example (MC 4)

Page 7L2 Supplementary Notes

MC 5-9

Page 8L2 Supplementary Notes

Suppl 4, MC10, 11

Page 9L2 Supplementary Notes

Discrete Function (MC 11, 12)

S = {1, 2, 3}: domain of function f

T={Sam, Mary, Sarah}: range of function f

Page 10L2 Supplementary Notes

Notes (MC 11)

For each element s of S, f gives one element of T, f(s)

In general NOT: For each element of T,…

There may be t of T, such that f(s) \= t for all s of S

Only a special kind of function has this property, onto

Page 11L2 Supplementary Notes

MC 14

Page 12L2 Supplementary Notes

Exercise on Functions (MC 15)

All functions from {1, 2} ->{a, b}

Page 13L2 Supplementary Notes

Counting Functions (MC 16)

Page 14L2 Supplementary Notes

Counting Functions (MC17)

Page 15L2 Supplementary Notes

Injection (MC 18)

f: {1, 2} {a, b}

Page 16L2 Supplementary Notes

Surjection (MC 18)

f: {1, 2} {a, b}

Page 17L2 Supplementary Notes

Examples (MC 19)

Page 18L2 Supplementary Notes

Bijection (MC 20)

Domain and range have same number of elements.

Page 19L2 Supplementary Notes

Permutation (MC 20)

Page 20L2 Supplementary Notes

Bijection Principle

Counting elements in S

May be difficult directly

Find another set T that is easy to count

Define a function f: S T

Prove that f is a bijection

Count T

Page 21L2 Supplementary Notes

Three Increasing Triples

Page 22L2 Supplementary Notes

Increasing Triples

Page 23L2 Supplementary Notes

3-element subsets/3-element permutations

Page 24L2 Supplementary Notes

K-th falling factorial

Page 25L2 Supplementary Notes

k-element subsets/k-elemen permutations