Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 CMSC 250 Discrete Structures CMSC 250 Lecture 1.

Similar presentations


Presentation on theme: "1 CMSC 250 Discrete Structures CMSC 250 Lecture 1."— Presentation transcript:

1 1 CMSC 250 Discrete Structures CMSC 250 Lecture 1

2 2 CMSC 250 Administrative l Syllabus l Lecture section: MWF 10-11 l Lab/discussion section l Every week (mostly): –Worksheet –Quiz –Homework l Class webpage l Three midterms, as noted on the syllabus (on the class webpage) l Academic integrity

3 3 CMSC 250 Motivation Why learn this material? l Some things can be directly applied l Some things are good to know l Some things just teach a way of thinking and expressing yourself

4 4 CMSC 250 Examples l Directly applied- circuits to do addition l Conditionals in if statements l Things which are good to know- for example that the square root of 2 can’t be stored l Way of thinking- the number of primes is infinite

5 5 CMSC 250 Overall theme l Proofs of theorems l Examples of theorems

6 6 CMSC 250 Course topics l Propositional logic (and circuits) l Predicate calculus - quantification l Elementary number theory l Mathematical induction l Sets l Counting - combinations and probability l Functions l Relations l Graph theory

7 7 CMSC 250 Chapter 1, Propositional Logic

8 8 CMSC 250 Statement/proposition l Declarative (true or false) l Symbolized by a letter l Examples: –Today is Monday. –5 + 2 = 7 –3 * 6 > 18 –The sky is blue. –Why is the sky blue? –Barack Obama. –Two students in the class have a GPA of 3.275. –This sentence is false. –The current king of France is bald.

9 9 CMSC 250 Other symbols and definitions for constructing compound statements l Conjunction "and" is symbolized by  l Disjunction "or" is symbolized by  l Negation "not" is symbolized by ~ (or sometimes  )

10 10 CMSC 250 Truth table for  pq p  q 11 10 01 00 1 0 0 0

11 11 CMSC 250 Truth table for  pq p  q 11 10 01 00 1 1 1 0

12 12 CMSC 250 Truth table for  p pp 1 0 0 1

13 13 CMSC 250 Translation of English to symbolic logic statements l The sky is blue. –one simple (atomic) statement- assign a letter or name to it, i.e., b l The sky is blue and the grass is green. –one statement –conjunction of two atomic statements –each single statement gets a letter or name, i.e., b, g –and join with ^ i.e., b ^ g l The sky is blue or the sky is purple. –one statement –disjunction of two atomic statements –each single statement gets a name, i.e., b, p –and join with  i.e., b  p

14 14 CMSC 250 Translation #1 l The sky is blue or purple. –two statements "the sky is blue"- name this b "the sky is purple"- name this p –it's still a disjunction "the sky is blue" or "the sky is purple" b  p

15 15 CMSC 250 Translation #2 l The sky is blue but not dark. –two statements "the sky is blue"- name this b "the sky is dark"- name this d –conjunction with negation "the sky is blue" and "the sky is not dark" the sky is blue and it is not the case that the sky is dark "it is not the case that the sky is dark" is ~d b ^ ~ d

16 16 CMSC 250 Translation #3 l 2  x  6 l English: x is greater than or equal to 2 and less than or equal to 6 l Two statements: –"x is greater than or equal to 2"- name this p –"x is less than or equal to 6"- name this q l Becomes p ^ q

17 17 CMSC 250 #3 continued- 2  x  6 l p is actually a compound statement –x is greater than 2 or x is equal to 2 r  s –"x is greater than 2" is symbolized by r –"x is equal to 2" is symbolized by s l q is actually a compound statement –x is less than 6 or x is equal to 6 m  n –"x is less than 6" is symbolized by m –"x is equal to 6" is symbolized by n l p ^ q becomes (r  s) ^ (m  n)

18 18 CMSC 250 The exclusive or l The exclusive or of p and q is p or q, but not both l It’s indicated using  l It’s the same as (p  q)   (p  q) pq p  q 11 10 01 00 0 1 1 0

19 19 CMSC 250 Precedence between the operators l ~ (not) has highest precedence l ^ (and) /  (or) have equal precedence l use parentheses to override the operators' default precedence, or when a statement has operators with the same precedence, or just for clarity l a ^ b  c

20 20 CMSC 250 Other "more advanced" truth tables (p ^ r)  (q ^ r) (p ^ ~r)  (p ^ r) (p ^ q)  (~q  ~p) (p ^ ~r)  (q  ~r)

21 21 CMSC 250 Discrete Structures CMSC 250 Lecture 2

22 22 CMSC 250 Special truth tables p  ~p p ^ ~p (p ^ ~q) vs. (~q ^ p) (p ^ q) vs. ~ (~q  ~p)

23 23 CMSC 250 Special results in the truth table l Tautological proposition –a tautology is a statement that can never be false –all of the lines of the truth table have the result "true" l Contradictory proposition –a contradiction is a statement that can never be true –all of the lines of the truth table have the result "false" l Logical equivalence of two propositions –two statements are logically equivalent if they will be true in exactly the same cases and false in exactly the same cases –all of the lines of one column of the truth table have all of the same truth values as the corresponding lines from another column of the truth table –it's indicated using 

24 24 CMSC 250 Logical equivalences Theorem 1.1.1 - page 14 l Double negative: ~(~p)  p l Commutative: p  q  q  pand p ^ q  q ^ p l Associative: (p  q)  r  p  (q  r)and (p ^ q) ^ r  p ^ (q ^ r) l Distributive: p ^ (q  r)  (p ^ q)  (p ^ r)and p  (q ^ r)  (p  q) ^ (p  r)

25 25 CMSC 250 Further logical equivalences l Idempotent: p ^ p  pand p  p  p l Absorption: p  (p ^ q)  pand p ^ (p  q)  p l Identity: p ^ t  pand p  c  p l Negation: p  ~p  tand p ^ ~p  c l Universal bound: p ^ c  cand p  t  t l Negations of t and c: ~t  cand ~c  t

26 26 CMSC 250 DeMorgan's laws ~(p  q)  ~p ^ ~q –Example in English: It is not the case that Pete or Quincy went to the store.  Pete did not go to the store and Quincy did not go to the store. ~(p ^ q)  ~p  ~q –Example in English: It is not the case that both Pete and Quincy went to the store.  Pete did not go to the store or Quincy did not go to the store.

27 27 CMSC 250 Prove by truth table and by rules ~(p  ~q)  (~q ^ ~p)  ~p ~((~p ^ q)  (~p ^ ~q))  (p ^ q)  p (p  q) ^ ~(p ^ q)  (p ^ ~q)  (q ^ ~p)

28 28 CMSC 250 Discrete Structures CMSC 250 Lecture 3

29 29 CMSC 250 Conditional statements l Hypothesis  conclusion l If this, then that. The hypothesis implies the conclusion. l  has lowest precedence (~ / ^  /  ) l Examples in English: –If it is raining, I will carry my umbrella. –If you don’t eat your dinner, you will not get dessert. pq p  q 11 10 01 00 1 0 1 1

30 30 CMSC 250 Converting  to  l p  q  ~p  q Show with truth table l ~(p  q)  p ^ ~q Show with truth table and rules

31 31 CMSC 250 Contrapositive l Given a conditional statement p  q, form its contrapositive by: –negating the conclusion and negating the hypothesis –using the negated conclusion as the new hypothesis and the negated hypothesis as the conclusion, e.g., ~q  ~p l p  q  ~q  ~p l Examples in English: –"If Paula is here, then Quincy is here." –The contrapositive is "If Quincy is not here, then Paula is not here."

32 32 CMSC 250 Converse and inverse l Given p  q, for example, "If Paula is here, then Quincy is here." l To form its converse: –swap the hypothesis and the conclusion – q  p –If Quincy is here, then Paula is here. l To form its inverse: –negate the hypothesis and negate the conclusion – ~p  ~q –If Paula is not here, then Quincy is not here.

33 33 CMSC 250 Only if l Translation to if-then form –p only if q –p can be true only if q is true –if q is not true then p can't be true –if not q then not p (~q  ~p) –if p then q (p  q) l Translation in English –You will graduate is CS only if you pass this course. G only if P –If you do not pass this course then you will not graduate in CS. ~P  ~G –If you graduate in CS then you passed this course. G  P

34 34 CMSC 250 Biconditional l p if and only if q l p  q l p iff q pq p  q 11 10 01 00 1 0 0 1

35 35 CMSC 250 Other English words for implication l Sufficient condition –"if r, then s" r  s –means r is a sufficient condition for s –the truth of r is sufficient to ensure the truth of s l Necessary condition –"if not x, then not y" ~x  ~y –means x is a necessary condition for y –the truth of x is necessary if y is true l Sufficient and necessary condition –p if, and only if q p  q –the truth of p is enough to ensure the truth of q and vice versa

36 36 CMSC 250 Argument l A sequence of statements where –the last in the sequence is the conclusion –all others are premises (assumptions, hypotheses) l (premise 1 ^ premise 2 ^ …premise n )  conclusion l The critical rows of the truth table are those where all of the premises are true –only one premise being false makes the above conjunction false –but a false hypothesis for a conditional can never make the conditional's result be false l The validity of an argument can be determined from the truth value of the conclusion in the critical rows –it's a valid argument if and only if the conclusion is true in all of the critical rows –it's an invalid argument if the conclusion is false in any of the critical rows

37 37 CMSC 250 Discrete Structures CMSC 250 Lecture 4

38 38 CMSC 250 Rules of Inference (Table 1.3.1- Page 39) Modus Ponens p  q p  q Modus Tollens p  q ~q  ~p Elimination p  q p  q ~q ~p  p  q Generalization p q  p  q Specialization p ^ q p ^ q  p  q Contradiction rule ~p  c  p Transitivity p  q q  r  p  r Conjunction p q  p ^ q Proof by division into cases p  q p  r q  r  r

39 39 CMSC 250 Proofs using rules of inference P1 p  q P2 ~(q  r) P3 p  (m  r)  ~m P1p ^ q P2 p  s P3 ~r  ~q  s ^ r P1 p  q P2 q  r P3~p  r

40 40 CMSC 250 Conditional worlds l Making assumptions are only allowed if you go into a "conditional world" l Two types of results can be derived when an assumption is made: an implication and a negation list of statements that are true in all worlds assume anything a list of statements which are true in the situations where the assumption is true conclusion: the assumption  anything from the conditional world l We'll call this "conditional world without contradiction"

41 41 CMSC 250 Conditional world assumption leads to contradiction l If you make an assumption, and that assumption leads to a contradiction in the conditional world, what can be concluded? list of statements that are true in all worlds assume anything a list of statements which are true in the situations where the assumption is true a contradiction with something else known to be true conclusion: the assumption must be false in all possible worlds l We'll call this "conditional world with contradiction"

42 42 CMSC 250 Prove using the conditional world methods P1 (p  q)  s P2 r  p  r  s P1 m  s P2 s  (q ^ r) P3 q  ~r  ~(m ^ p)

43 43 CMSC 250 Discrete Structures CMSC 250 Lecture 5

44 44 CMSC 250 Use both conditional world methods P1 ~ m  p P2 p  (q  s) P3 ~(s  ~x) P4 q  ~r  ~(m ^ r)


Download ppt "1 CMSC 250 Discrete Structures CMSC 250 Lecture 1."

Similar presentations


Ads by Google