May 31: Syllabus Notation: \Bbb N,Z,Q,R,C Notation {a+bi | a,b \in \Bbb R} Logical connectives Material vs relevant implication Quantifiers four-squares theorem Methods of proof Direct proof Indirect proof Proof by contradiction Proof of contrapositive Example: \sqrt{2} is irrational Translate to statement in language of arithmetic Proof illustrates proof by contradiction, WLOG, pf by cases June 1: Change in syllabus -- 5th edition Rosen, 5.1,5.2 become 6.1,6.2. More semantics \forall n \exists m m>n \forall m \exists n m>n Meaning of these sentences? Who wins the game, and what are strategies? Translate "there are infinitely many primes" into FOL; what is game? More methods of proof direct proof -- example from book indirect proof -- what I called "proof of contrapositive" last time connection between indirect proof and proof by contradiction vacuous proof Ex falso quodlibet trivial proof *did not get to examples of constructive, nonconstructive existence proofs Idea of a set Extensional notion Contrast with intensional classes Set of counterexamples to Goldbach == empty set? Subset notion Empty set is a subset of anything (ex falso quodlibet) Anything is a subset of itself Proper subsets, notation Powerset notion What's powerset of empty set? Russell set June 2: Went over Russell paradox Combinatorial sets vs sets as extensions of properties No biggest set Iterated powerset of empty set -- sequence of cardinalities Ordered pairs, tuples Cartesian product Relation as subset of Cartesian product, as set in plane, as something whose truth depends on two elements Functions Intuitive concept Extensional vs intensional notion FOL definition graphically domain, codomain injection, surjection, bijection Bijection --> same cardinality Inverses, compositions Floor, ceiling functions Big-O notation FOL Game semantics June 3: June 7: A little hwk review More on algos -- linear search, Theta(n) binary search, Theta(log n) Bubble sort Selection sort Insertion sort Theta(n^2) Mentioned, but didn't go over, quicksort, Theta(n log n) Introduced induction Induction/deduction, logical distinction "sheep black on one side" Want to prove (forall n)P(n) So prove P(0), (forall n)(P(n) --> P(n+1)) Why does this work? Iterated modus ponens Why do we need axiom? Would have to use modus ponens inf. many times Example: Sum_{i=0}^n i = frac{n(n+1)}{2} Used Sigma notation to talk about definition by recursion -- similar to proof by induction. June 8: Tower of Hanoi Figured out algorithm Defined recurrence relation for time required Solved recurrence relation; proved solution Induction pitfalls -- "all horses are the same color" Strong induction Applied to sqrt{2} irrationality proof Showed why weak induction==> strong induction Explained quicksort Applied strong induction to complexity of quicksort June 9: review for 1st midterm June 10: 1st midterm June 14: Post-mortem, 1st midterm. Highlights: Y'all have to be able to prove stuff Fermat vs Mersenne primes If f,g onto then gof onto If f is Theta(x^2) then sqrt{f} is Theta(x). Mikebonacci numbers Integers and divisibility Think about it: Is it possible that 17*19=3*107? Why not? Definition of | Basic properties: Reflexive, transitive, antisymmetric (on naturals) (thus partial order) 1|anything anything|0 Drew lattice on board -- 1 at bottom, 0 at top, primes second level a|b, a|c ==> a|nb+mc Division algo -- proof by induction *missed -- infinitude of primes; Fermat primes and compass/straightedge constructions June 15: Recall question: can 17*19=3*107? State fund thm of arith -- goal for class Recall pf of division algo, extend to integers Redraw divisibilty lattice Introduce Euclid's algo Start doing it (with example -- 50 and 90) Show that number obtained at each step is lin comb of orig two #s Why is last number equal to gcd? anything that divides both orig #s divides it -- because it's lin comb of orig two #s It divides orig two #s -- why? Fumbled this a little -- redo, along with better def'n? Now, assuming p|ab and ~p|a, show p|b. (called this key lemma) Now strong induction ==> Fund. Thm of Arith. Didn't present this -- presented the part about existence of prime factorization, by infinite descent. Asked them to think about uniqueness, using specific numbers and key lemma. June 16: Finished off FTA Modular arithmetic: Introduced notation a=b (mod n) (congruence), a mod n (as an operator). Showed why sums, products mod n depend only on the inputs mod n. Asked what numbers you can divide by (have multiplicative inverses) mod n. Showed it's precisely the ones relatively prime to n (i.e. their gcd with n equals 1). Introduced notion of order of a group element. Computed the orders of the elements of the multiplicative group mod 15 (the elements are 1,2,4,7,8,11,13,14). All these orders divide 8; remarked that this is true in general: The order of a group element divides the size of the group. Defined phi(n) as the order of the multiplicative group mod n; that is, the number of numbers less than n that are relatively prime to n. Pointed out this implies extended Fermat's Little Theorem: b^phi(n) = 1 (mod n) (for b relatively prime to n) Mentioned that this is the heart of why RSA works. June 17: Fermat, Mersenne primes Why does order of a group elt divide order of group? Therefore, when computing a^k (mod n), we care about a only mod n, but we care about k only mod phi(n). Compute phi(n) -- simple cases: p, pq Explain RSA Mentioned that the theory we'd developed works only when gcd(M,n)=1, but that this is not a serious restriction, and anyway it works in general, just not by our proof. Parts of RSA -- finding d given e, doing modular exponentiation (using successive squaring and a binary representation of the power). Noted that finding primes also rests (more or less) on Fermat's Little Theorem, and on being able to do modular exponentiation. Mentioned that there are lots of large primes to find. Chinese remainder theorem June 21: Went over practice test. June 22: 2nd midterm; random number generators: "true" versus deterministic randomness, purposes for each (crypto as opposed to Monte Carlo); sources of true randomness, hash functions to "compress" entropy, linear congruential generators, Tausworthe generator. June 23: Postmortem 2nd midterm. Sigma notation for sums. Definition of Sigma notation by recursion. Sigma notation with indices ranging over a set (defined by recursion) or subject to a condition. Sums of powers -- "wouldn't it be nice if" method for getting closed (polynomial) form. Pi notation for products. Analysis of Euclid's algo -- worst case jumps when divisor goes to new Fibonacci number. "Wouldn't it be nice if" to get asymptotic ratio for Fibonaccis. Conclusion--worst number of divisions for Euclid's algo. June 24: Definition of a relation. Drawing relations as (directed) graphs (poss with loops). Special cases: Graphs (symmetric relations). DAGs. Trees. Strong induction, method of infinite descent: Essentially what you're using is no infinite descending chain. What sort of graph can we do this on? Notion of wellfounded relation; proofs by induction on a wellfounced relation (e.g. a finite tree). Explanation of merge sort algo. Tree for a run of merge sort. Proof that merge sort really sorts, by induction on the tree. C++ class implementing a binary tree. WFFs (propositional variables together with ~,^,v,==>). Definition by recursion. Semantics defined by recursion, given an assignment. Positive WFFs (no ~). Proof by induction that any positive WFF evaluates as T, given an assignment that makes all variables T. June 28: Introduced pigeonhole principle. Recalled mergesort algo Suppose selection sort requires Cn^2 comparisons to sort n things. Figured out how many comparisons required to do a one-level mergesort of n things, with selection sort on the pieces: <= 2C(n/2)^2+n. Argued that this was smaller than Cn^2 for suff large n. Now point out we can do 2-level mergesort, get still better result. Generalize to do mergesort all the way down. Get recurrence relation f(n)=2f(n/2)+n for upper bound on number of comparisons. Iterate f a couple times; get pattern; argue that f(n) is O(n log n). Do another example from "Master Theorem", f(n)=2f(n/2)+n^2, see why this is Theta(n^2), no log involved. Working towards lower bound: Suppose a sort algo for vectors of length n depends only on comparisons. Draw tree of brancing based on comparisons made. Argue that correct sort algo can't send vectors ordered differently down the same branch. Recall that there are n! ways of ordering n things. Suppose there were fewer than n! branches? Apply pigeonhole principle. Now how many paths in binary tree of height k? At most 2^k. So have 2^k >= n!. Now compute log_2(n!) -- argue that it's Omega(n log n). P vs NP problem -- define P, give factoring into primes as example of NP, argue P\subseteq NP, define (vaguely) NP-complete, does P=NP? No, but we don't know how to prove it. June 29: 4-color problem colorability of graphs planar graphs--connection with 4-color problem depth-first search of trees (same as preorder traversal) breadth-first search (qualitative comparison of resulting spanning trees) 3-colorability, NP-complete problem, reduced to tree search Qualitiative discussion of Turing machines and nondeterministic Turing machines Quantum computing June 30: Regular expressions Gave an example of a Finite Deterministic Automaton accepting a regular expression Explained how to translate an FDA into parser code Ramsey theory: Showed why R(3,3) > 5, R(3,3) <= 6, so R(3,3)=6. Asked students to see if they can show R(4,3) <= 10 (is it really true?) Began review for final.