csc165
play

CSC165 Larry Zhang, September 23, 2014 Tutorial classrooms T0101, - PowerPoint PPT Presentation

CSC165 Larry Zhang, September 23, 2014 Tutorial classrooms T0101, Tuesday 9:10am~10:30am: BA3102 A-F (Jason/Jason) BA3116 G-L (Eleni/Eleni) BA2185 M-T (Madina/Madina) BA2175 V-Z (Siamak/Siamak) T0201: Monday


  1. CSC165 Larry Zhang, September 23, 2014

  2. Tutorial classrooms T0101, Tuesday 9:10am~10:30am: BA3102 A-F (Jason/Jason) BA3116 G-L (Eleni/Eleni) BA2185 M-T (Madina/Madina) BA2175 V-Z (Siamak/Siamak) T0201: Monday 7:10~8:30pm BA2175* A-D (Ekaterina/Ekaterina) BA1240* E-Li (Gal/Gal) BA2185* Liang-S (Yana/Adam) BA3116 T-Z (Christina/Nadira) T5101: Thursday 7:10~8:30pm BA3116 A-F (Christine/Christine) BA2135 G-Li (Elias/Elias) BA1200* Lin-U (Yiyan/Yiyan) GB244* V-Z (Natalie/Natalie)

  3. slogURL.txt ➔ 393 / 447 submitted ➔ can still submit on MarkUS if you haven’t. ➔ can still fix it if you did it wrong a plain TXT file: slogURL.txt ◆ NOT slogURL. pdf , slogURL. doc , slogURL. txt.pdf , slogURL. txt. ● doc , or PDF/DOC renamed to TXT Submit individually ◆ If you formed a group with more than one person, email ● Danny and me with both of your URLs.

  4. Assignment 1 is out http://www.cdf.toronto.edu/~heap/165/F14/Assignments/a1.pdf ➔ Due on October 3rd, 10:00pm. ➔ May work in groups of up to 3 people. ➔ Submit on MarkUs: a1.pdf ➔ Prefer to use LaTeX , try the following tools ◆ www.writelatex.com ◆ www.sharelatex.com

  5. Today’s agenda ➔ More elements of the language of Math ◆ Conjunctions ◆ Disjunctions ◆ Negations ◆ Truth tables ◆ Manipulation laws

  6. Lecture 3.1 Conjunctions, Disjunctions Course Notes: Chapter 2

  7. Conjunction (AND, ∧ ) noun “the action or an instance of two or more events or things occurring at the same point in time or space.” Synonyms : co-occurrence, coexistence, simultaneity.

  8. Conjunction (AND, ∧ ) Combine two statements by claiming they are both true. predicates! R(x) : Car x is red. F(x) : Car x is a Ferrari. R(x) and F(x) : Car x is red and a Ferrari. R(x) ∧ F(x)

  9. Which ones are R(x) ∧ F(x)

  10. Conjunction (AND, ∧ ) As sets (instead of predicates) : R : the set of red cars F : the set of Ferrari cars Intersection

  11. What are R , F , R ∩ F

  12. ➔ Using predicates: R(x) ∧ F(x) ➔ Using sets: R ∩ F

  13. Be careful with English “and” There is a pen, and a telephone. O : the set of all objects P(x) : x is a pen. T(x) : x is a telephone. There is a pen-phone!

  14. Be careful with English “and” There is a pen, and a telephone. O : the set of all objects P(x) : x is a pen. T(x) : x is a telephone.

  15. Be careful, even in math The solutions are x < 20 and x > 10 . A B A ∩ B The solutions are x > 20 and x < 10 . A B A ∪ B

  16. Disjunction

  17. Disjunction (OR, ∨ ) Combine two statements by claiming that at least one of them is true . R(x) : Car x is red. F(x) : Car x is a Ferrari. R(x) or F(x) : Car x is red or a Ferrari. R(x) ∨ F(x)

  18. Which ones are R(x) ∨ F(x)

  19. Disjunction (OR, ∨ ) As sets (instead of predicates) : R : the set of red cars F : the set of Ferrari cars Union

  20. What are R , F , R ∪ F

  21. ➔ Using predicates: R(x) ∨ F(x) ➔ Using sets: R ∪ F

  22. Be careful with English “or” Either we play the game my way, or I’m taking my ball and going home. “exclusive or”, not “or”!

  23. Summary ➔ Conjunction: AND, ∧ , ∩ ➔ Disjunction: OR, ∨ , ∪

  24. Quick test A logician’s wife is having a baby. The doctor immediately hands the newborn to the dad. His wife asks impatiently: “So, is it a boy or a girl?” The logician replies: “ Yes. ” Source: “21 jokes for super smart people.” http://www.buzzfeed.com/tabathaleggett/jokes-youll-only-get-if-youre-really-smart#1ml5j1x

  25. Lecture 3.2 Negations Course Notes: Chapter 2

  26. Negation (NOT, ¬) C : set of all cars All red cars are Ferrari. negation Not all red cars are Ferrari.

  27. Negation (NOT, ¬) Not all red cars are Ferrari. equivalent There exists a car that is red and not Ferrari.

  28. Exercise: Negate-it!

  29. Exercise: Negate-it! Rule : the negation sign should apply to the smallest possible part of the expression. NO GOOD! GOOD!

  30. Exercise: Negate-it! All cars are red. NEG Not all cars are red. There exists a car that is not red.

  31. Exercise: Negate-it! There exists a car that is red. NEG There does not exists a car that is red. All cars are not red.

  32. Exercise: Negate-it! Every red car is a Ferrari. NEG Not every red car is a Ferrari. There is a car that is red and not a Ferrari.

  33. Exercise: Negate-it! There exists a car that is red and Ferrari. NEG There does not exists a car that is red and Ferrari. For all cars, if it is red, then it is not Ferrari.

  34. Exercise: Negate-it! There exists a car that is red and Ferrari. NEG There does not exists a car that is red and Ferrari. For all cars, it is red , then it is not Ferrari . For all cars, it is Ferrari , then it is not red .

  35. Some tips ➔ The negation of a universal quantification is an existential quantification (“ not all... ” means “ there is one that is not... ”). ➔ The negation of a existential quantification is an universal quantification (“ there does not exist... ” means “ all...are not... ”) ➔ Push the negation sign inside layer by layer ( like peeling an onion ).

  36. Exercise: Negate-it! NEG

  37. Scope

  38. Parentheses are important! NO GOOD! GOOD! GOOD!

  39. Scope inside parentheses is the same as Everything happens in parentheses stays in parentheses.

  40. Summary ➔ Negations ◆ understand them in human language ◆ practice is the key! ➔ Parentheses ◆ use them properly to avoid ambiguity

  41. Lecture 3.3 Truth tables, and some laws Course Notes: Chapter 2

  42. About visualization... Q P Venn diagram works pretty well… ... for TWO predicates.

  43. What if we have 3 predicates? P Q R

  44. What if we have 4 predicates?

  45. What if we have 5 predicates?

  46. What if we have 20 predicates? There must be a better way!

  47. It’s called the truth table

  48. Truth table with 2 predicates INPUTS OUTPUTS Enumerate the outputs over all possible combinations of input values of P and Q . 2² = 4 How many rows are there?

  49. Truth table with 3 predicates 2³ = 8 How many rows are there?

  50. Truth table with 20 predicates 2²⁰ rows It’s not a mess, it just a larger table, which computers can process easily!

  51. What can truth tables be used for?

  52. for evaluating expressions

  53. It’s a boy and it’s not a boy. It’s a boy or it’s not a boy. for determining satisfiability unsatisfiable tautology (contradiction) (universal truth) satisfiable P Q P ∧ Q P ∧ ¬ P P ∨ ¬ P T T T F T T F F F T F T F T F F F F F T

  54. for proving equivalence P Q ¬ P ∨ Q P => Q T T T T F F T F F T T T T T F F

  55. for proving equivalence P Q ¬ ( P ∨ Q ) ¬ P ∧ ¬ Q T T F F F F T F F F T F T T F F We just proved De Morgan’s Law!

  56. De Morgan’s Law

  57. Augustus De Morgan (1806-1871) ➔ De Morgan’s Law ➔ Mathematical Induction

  58. there are more laws...

  59. Other laws Commutative laws

  60. Other laws Associative laws

  61. Other laws Distributive laws

  62. Other laws Identity laws always true always false

  63. Other laws Idempotent laws

  64. Other laws For a full list of laws to be used in CSC165, read Chapter 2.17 of Course Notes.

  65. About these laws... ➔ Similar to those for arithmetics. ➔ Only use when you are sure. ➔ Understand them , be able to verify them, rather than memorizing them. ➔ Practice is the key!

  66. Summary for today ➔ Conjunctions ➔ Disjunctions ➔ Negations ➔ Truth tables ➔ Manipulation laws ➔ We are almost done with learning the language of math.

  67. Next week ➔ finish learning the language ➔ start learning proofs

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend