CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA
Todays topics Final review A few words about the final Concluding remarks
What did we learn? Concepts Basic algorithms Number representations Boolean logic Sets Functions Relations Modular arithmetic Proof techniques Direct Contraposition Contradiction Cases Induction Strong induction Analyzing and proving properties of all the new concepts that we learned, using the various proof techniques
CONCEPTS
Basic algorithms 1. Russian peasant multiplication 2. Fast powering 3. Casting out 9s 4. Euclid’s algorithm Main questions: Do they always terminate? Do they return the correct answer? How fast?
Number representations Representation integers in different bases Converting between bases Addition, subtraction
Boolean logic Propositional logic Truth tables, formulas, DeMorgan laws… Predicate logic Free variables Quantified variables
Propositional logic: basic connectives Basic connectives on 1 and 2 bits: NOT AND OR XOR IMPLIES IFF Representation of these basic connectives as truth tables
Propositional logic: general formulas More complicated predicates: Representation as a truth table Representation as a formula using the basic connectives Converting between these representations: formula truth table Truth table formula (in fact, DNF) Special cases: tautology, contradiction
Propositional logic: negation Negation: How to negate a truth table How to negate a Boolean formula: 1. Converting formula to use only AND,OR,NOT 2. DeMorgan laws
Predicate logic
Simplifying formulas
Sets
Functions
Relations
Equivalence relations Relations which are reflexive, symmetric, transitive Examples Equivalent definition: partition the universe to equivalence classes Important example: modular arithmetic
Modular arithmetic Definition of modular classes Addition Multiplication Subtraction Division (when possible) Examples of applications
Order relations
PROOF STRATEGIES
Direct proof
Contrapositive proof
Proof by contradiction
Proof by cases
Proof by induction
Proof by strong induction
PROOFS FOR CONCEPTS
Proofs for algorithms We proved that all the algorithms that we learned Terminate Return the correct answer Analyzed their time complexity (how fast do they terminate) We proved various properties of them loop invariants
Proofs for sets
Proofs for functions
Proofs for relations Proved that the two definitions of equivalence relations are indeed equivalent: 1. Reflexive, symmetric, transitive 2. Partitions the universe to equivalence classes Modular arithmetic: Given by equivalence classes (a mod m) Proved that is allows for addition, subtraction, multiplication and division (whenever possible) Used it to prove theorems about numbers
Arithmetic proofs
FINAL
The final Monday 3/16, 3-6pm, in class Bring only a pen, no other material is allowed Material: everything we learned, except for the last week (eg no Knights & Knaves, no infinite sets) Questions: 6 questions 1 bonus question Level: similar to the midterms
How to prepare? Go over all the lectures, make sure that you understand everything. Make sure that you can prove for yourself all the problems we discussed in class Go over homework. Make sure that you can solve all the questions. Review questions: same
How to prepare? Proofs: go over solutions of homeworks, midterms, review questions Make sure that you know that difference between good proofs and bad proofs If some of your proofs in homework/midterm were not good, make sure that you know why, and know not to repeat the same mistake again
CONCLUDING REMARKS
Concluding remarks I enjoyed teaching you the class; I hope that you enjoyed taking it, and that you learned some new concepts, and some new ways of rational thinking I want to keep improving the class, so that students next year will have an even better experience, so: Please fill in your CAPEs today. I want to know all that is good and bad about the class. I will send a survey after the final, with various questions on the class. Please take the time to fill it in. If you feel comfortable, I appreciate any feedback Please try to make constructive comments
Thanks, and good luck in your finals !