Download presentation

Presentation is loading. Please wait.

Published byKaya Barley Modified over 2 years ago

1
Tutorial 1: Logic Peter Poon

2
Self Introduction You can call me Peter Email: cypoon@cse.cuhk.edu.hkcypoon@cse.cuhk.edu.hk Office: SHB117 Office hour: Friday 10:00am – 12:00 noon Topics responsible: Logic and proofs

3
Agenda Proof Distributive Law Construct and simplify Contrapositive Story

4
Proof How to prove two statement are logically equivalent / not equivalent? Prove or disprove

5
Proof Use truth table or equivalence laws to prove pq TTT TFT FTF FFF

6
Proof pqr TTTTT TTFTT TFTTT TFFFF FTTFF FTFFF FFTFF FFFFF

7
Distributive Law

8
Construct and simplify Construct and simplify the formulas of f(x, y, z) xyzf(x, y, z) TTTT TTFF TFTT TFFT FTTT FTFF FFTT FFFF

9
Construct and simplify Construct and simplify the formulas of f(x, y, z) Very long!!! xyzf(x, y, z) TTTT TTFF TFTT TFFT FTTT FTFF FFTT FFFF

10
Construct and simplify Construct and simplify the formulas of f(x, y, z) We can find the opposite xyzf(x, y, z) TTTT TTFF TFTT TFFT FTTT FTFF FFTT FFFF

11
Construct and simplify Simplify the formulas of f(x, y, z) De Morgan’s law Distribution Law Negation Law

12
Contrapositive Sometime you may want the contrapositive form Find out the contrapositive form of

13
Contrapositive Find out the contrapositive form of Use De Morgan’s law to help Ans:

14
Story A detective has interviewed four witnesses to a crime. From their stories, the detective has concluded that (a) If the butler is telling the truth, then so is the cook. (b) The cook and the gardener cannot both be telling the truth. (c) The gardener and the handyman are not both lying. (d) If the handyman is telling the truth then the cook is lying. Deduce who MUST be lying? (There may be more than one liar.)

15
Story First, define the variable There are four people – Butler, Cook, Gardener, Handyman Let B be “Butler is telling the truth” C be “Cook is telling the truth” G be “Gardener is telling the truth” H be “Handyman is telling the truth”

16
Story Then, write down the expression (a) If the butler is telling the truth, then so is the cook. (b) The cook and the gardener cannot both be telling the truth. (c) The gardener and the handyman are not both lying. (d) If the handyman is telling the truth then the cook is lying.

17
Story Make some assumption Eg If B is true Since, C is true Since, G is false Since, H is true Since, C is false (contradiction!!!) So, – B must be false – and C must be false

18
Story How about G and H? We can’t determine them Eg G = True, H = False and G = false, H = True are both valid solution. GH TFTTTT FTTTTT

19
You are visiting a town. The people in the town either always tell the truth or always lie. One day you ask help from one townsman. He said: "Don't worry, I will help you if and only if I tell the truth." Should you feel happy?

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google