Presentation is loading. Please wait.

Presentation is loading. Please wait.

COMP 170 L2 Page 1 Review for Midterm 1 l Part I: Counting n L01-L03 l Part II: Number Theory and Cryptography n L04, L05.

Similar presentations


Presentation on theme: "COMP 170 L2 Page 1 Review for Midterm 1 l Part I: Counting n L01-L03 l Part II: Number Theory and Cryptography n L04, L05."— Presentation transcript:

1 COMP 170 L2 Page 1 Review for Midterm 1 l Part I: Counting n L01-L03 l Part II: Number Theory and Cryptography n L04, L05

2 COMP 170 L2 Counting l Why counting? Page 2

3 COMP 170 L2 Counting Overview l Principles n Sum principle, Product Principle, Bijection Principle l Objects to count n Lists, functions, subsets, permutations, partitions Page 3

4 COMP 170 L2 Page 4 Sum Principle

5 COMP 170 L2 Page 5 Product Principle l Si and Sj are disjoint, |Si| = n l S = S1 U S2 U … U Sm l |S| = m |Si| = mn

6 COMP 170 L2 Page 6 Product Principle

7 COMP 170 L2 Page 7 Bijection Principle

8 COMP 170 L2 Counting Overview l Principles n Sum principle, Product Principle, Bijection Principle l Objects to count n Lists, functions, permutations, subsets, partitions Page 8

9 COMP 170 L2 Page 9 Counting Lists

10 COMP 170 L2 Page 10 Counting Functions

11 COMP 170 L2 Counting Functions Page 11

12 COMP 170 L2 Page 12 Counting Permutations l Number of k-element permutations l Number of permutations of a set of size n

13 COMP 170 L2 Page 13 k-element subsets/k-elemen permutations

14 COMP 170 L2 Counting Subsets Page 14

15 COMP 170 L2 Page 15 Counting Subsets

16 COMP 170 L2 Avoid Double Counting Page 16 l Exco Members: Year 1: 4; Year 2: 5; Year 3: 3 l WRONG ANSWER: l First choose 1 from each year l Then pick 3 from remaining 9 members l Answer

17 COMP 170 L2 Page 17 Counting Partitions/Labelings

18 COMP 170 L2 Page 18 Review for Midterm 1 l Part I: Counting n L01-L03 l Part II: Number Theory and Cryptography n L04, L05

19 COMP 170 L2 Part II of Course: Objective Page 19 n Show how to make e-commerce secure using Number theory. n Three logic lectures: L04-L06 n L04-05 covered in Midterm 1

20 COMP 170 L2 L04-L05 Overview l Addition and multiplication mod n n Basic properties l Multiplicative inverse n GCD n Extended GCD algorithm l Introduction to cryptography Page 20

21 COMP 170 L2 Modular Arithmetic Page 21

22 COMP 170 L2 Euclid’s Division Theorem l Proved: Page 22 l Proof technique l Proof by contradiction l Proof by smallest counter example

23 COMP 170 L2 Basic Properties Page 23

24 COMP 170 L2 L04-L05 Overview l Addition and multiplication mod n n Basic properties l Multiplicative inverse n GCD n Extended GCD algorithm l Introduction to cryptography Page 24

25 COMP 170 L2 Link to GCD Page 25

26 COMP 170 L2 GCD Algorithm Page 26

27 COMP 170 L2 Page 27 The Extended GCD Algorithm

28 COMP 170 L2 Multiplicative Inverse Page 28 l a has multiplicative inverse in Zn iff gcd(a, n) =1 l In that case, inverse of a = x mod n.

29 COMP 170 L2 L04-L05 Overview l Addition and multiplication mod n n Basic properties l Multiplicative inverse n GCD n Extended GCD algorithm l Introduction to cryptography Page 29

30 COMP 170 L2 Introduction to Cryptography


Download ppt "COMP 170 L2 Page 1 Review for Midterm 1 l Part I: Counting n L01-L03 l Part II: Number Theory and Cryptography n L04, L05."

Similar presentations


Ads by Google