Presentation is loading. Please wait.

# CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.

## Presentation on theme: "CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA."— Presentation transcript:

CSE 20 DISCRETE MATH Prof. Shachar Lovett http://cseweb.ucsd.edu/classes/wi15/cse20-a/ Clicker frequency: CA

Todays topics Boolean logic: simplifications, derivation rules Sections 3.2-3.4 in Jenkyns, Stephenson

Simplifications Which of the following Boolean expressions is equivalent to A. B. C. D. E. None of the above / more than one of the above.

Simplifications Which of the following Boolean expressions is equivalent to A. B. C. D. E. None of the above / more than one of the above.

Simplifications DeMorgan’s Laws Identity Idempotence Commutativity Distributivity Absorption

Negation

Conditional operator JS p. 85 PQP  Q TTT TFF FTT FFT

Conditional operator PQP  Q ~(P  ~Q) ~P v Q TTT TFF FTT FFT Antecedent aka hypothesis or assumption or “given” Consequent aka conclusion or goal

Contrapositive form P  Q is equivalent to ~Q  ~P How can we prove it? A. Compare truth tables B. Derive one from the other using simplification rules C. Both D. Neither

Contrapositive form Proof sequence: Formulas are equivalent in consecutive steps 1. ~Q  ~P(given) 2. ~(~Q)  (~P) (definition of  ) 3. Q  ~P(double negation) 4. ~P  Q(commutativity) 5. P  Q(definition of  )

Contrapositive form What’s the contrapositive of the statement “If you know Java, then you know a programming language?” A. If you know a programming language, then you know Java. B. If you don’t know a programming language, then you don’t know Java. C. If you don’t know Java, then you don’t know a programming language. D. None of the above.

Implication JS p. 86 vs.

Implication JS p. 86 vs. What’s enough to make a conditional statement false? A.P being false. B.Q being false. C.P and Q both false. D.Either P or Q (or both) false. E.None of the above / more than one of the above.

What does it mean: IMPLIES 14 Your roommate: “If you come to my party Friday, you will have fun” Under which of the following scenarios is your roommate a liar? A. You stayed home studying Friday and you did not have fun. B. You stayed home studying Friday and you had fun. C. You went to the party Friday and did not have fun. D. You went to the party Friday and you had fun E. None/More/Other

What does it mean: IMPLIES 15 Prof Lovett says: “If you win the CA state lottery between now and the end of quarter, you will get an A+ in this class.” 4 months later… under which of the following scenarios is Prof. Lovett a liar? A. You won the lottery and got an A+ B. You won the lottery and got a B+ C. You did not win the lottery and got an A+ D. You did not win the lottery and got a B+ E. None/More/Other

Implication Is P  Q equivalent to Q  P? A. Yes B. No

Implication Is P  Q equivalent to Q  P? A. Yes B. No PQP  QQ  P TTTT TFFT FTTF FFTT

Here is an example with the same form: If this shape is a square, then this shape is a rectangle. Therefore, if this shape is a rectangle, then this shape is a square. No! p→ q and q→p are the converse of each other. It is not safe to assume that if p→q is true, then q→p is also true! The converse could be true though…as in the equal sides/square example. If both p→q and q→p are true, then we say p↔q (“p iff q”). 18 Converse error

“If something is made out of wood, then it floats. Therefore, if she floats, then she is made out of wood [and therefore a witch!]” 20 Converse error

Contradictions Recall definition of IMPLIES If P is false, then P  Q is true, doesn’t matter what Q is Example: If pigs can fly, then hell freezes over If 1+1=3 then 2+2=5 PQP  Q TTT TFF FTT FFT

Next class Sets Read section 2.1 in Jenkyns, Stephenson

Download ppt "CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA."

Similar presentations

Ads by Google