Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSRU 1400 Discrete Structure: Logic

Similar presentations


Presentation on theme: "CSRU 1400 Discrete Structure: Logic"— Presentation transcript:

1 CSRU 1400 Discrete Structure: Logic
Ellen Zhang website:

2 What we learned so far ? Set: gives an unambiguous answer about membership Set enumeration Set relationship: subset, proper subset, equality Set operations: cardinality, power set, union, intersection, difference, Cartisian product Focus has been on arithmetic type of quesitons

3 Complement set Universal set, U
depending on the problems we consider, every set is a subset of the universal set U-A called complement of A, denoted as A’. U=N (the set of natural numbers), A: the set of all even numbers U-A is the set of all odd numbers. U A U

4 Properties of set operations
Last class, we discovered many properties: 1. 2. 3. iff.

5 Some more properties For any sets X, Y, Z: Are they true ? Why ? 1. 2.
3. 4. 5. 6. Are they true ? Why ?

6 Laws of set operations Commutative law: Associative law:
Distributive law:

7 More laws Identity laws Complement law De Morgan’s law

8 Set Algebra It also provides systematic procedures for evaluating expressions, and performing calculations, involving these operations and relations From a set of laws about set operations, one can prove the rest of laws (property). We will study proving & reasoning after we are more equipped …

9 Logic a science that deals with the principles and criteria of validity of inference and demonstration : the science of the formal principles of reasoning a branch or variety of logic <modal logic> <Boolean logic>

10 Classical Logic Aristotle’s syllogism
"a discourse in which, certain things having been supposed, something different from the things supposed results of necessity because these things are so." Major premise: All humans are mortal. Minor premise: Socrates is human. Conclusion: Socrates is mortal

11 Formal logic As discussed in the book, it means strings of symbols written down using a prescribed set of symbols. Well formed formulae, such as “2+3=5”, or “2+3=78” Not not “+=3=“ Note: this term is used for different meanings in different literature.

12 Circuit logic Digital electronics: whether it’s MP3 player, digital camera, stores data as digits (numbers), in particular binary numbers. We use base 10 numbers in daily life: where every digits can be 0,1,2, … 9. In computers, and digital electronics, binary numbers are used: where each digit is either 0 or 1. Circuit logic takes input of {0,1} and generates output of {0,1}

13 Circuit logic: OR gate Truth table of OR operation (gate) a b a+b 1

14 Why formal logic ? The attorney for the defense argues:
If my client is guilty, then the knife was in the drawer. Either the knife was not in the drawer or Jason Pritchard saw the knife. If the knife was not there on October 10, it follows that Jason Pritchard did not see the knife. Furthermore, if the knife was there on October 10, then the knife was in the drawer and also the hammer was in the barn. But we all know that the hammer was not in the barn. Therefore, ladies and gentlemen of the jury, my client is innocent.

15 Our subject of today: propositional logic
Def. a proposition is a statement which can be either true or false The cat sat on the mat. All dogs like bones. We use a symbol, i.e., a lower case letter to represent a proposition Let p stands for “the cat sat on the mat”..

16 Compound Proposition Connect simple propositions using “and”, “or”, “not”, “only if”, “if and only if”, etc. Either the cat sat on the mat or all dogs like bones. “The cat sat on the mat” or “all dogs like bones”. Two possible meanings for “or”: At least one of the statement must be true. One and only one of the statement is true.

17 Connective symbols Natural language can be ambiguous
“inclusive or” or “exclusive or” Different phrases mean the same thing Introduce special symbols We use to represent inclusive or Use to represent and Use to represent “not” Use to represent “if…, then…” User to represent “if and only if”

18 Negation It will not rain tomorrow.
Let p stands for “it will rain tomorrow”. It’s not the true that it will rain tomorrow, It’s false that it will rain tomorrow. p T F

19 Disjunction Connective
Either the cat sat on the mat or all dogs like bones. “The cat sat on the mat” (c) or “all dogs like bones” (d), denoted as Two possible meanings: inclusive or, exclusive or c d T F

20 Conjunction Connective
Peter is tall and thin. “Peter is tall” (t) and “Peter is thin” (h) can be written as This statement is true if both t is true and h is true; otherwise it’s false. t h T F

21 Conditional Connective: implication
If you don’t finish your peas, you cannot have dessert. If “you don’t finish your peas”, then “you cannot have dessert”. i.e., if p is true, then q must be true. We use to denote this compound statement. p q T F p only if q. i.e., p can be true only if q is true.

22 Other ways to express p implies q. p, therefore q. q follows p.
“You don’t finish your peas” implies “you cannot have dessert”. p, therefore q. You don’t finish your peas, therefore you cannot have dessert. q follows p. “You cannot have dessert” follows from “you don’t finish your peas”. p if only q. It’s ok that you don’t finish you peas, if only you don’t have dessert.

23 The list goes on… If not q then not p
if you have dessert, then you must have finish peas. If you want to have dessert, then you must have finish the peas. You can have dessert only if you finish your peas. Finish your peas is a necessary condition to have dessert.

24 Biconditional connective
Take intersection operation as example: For any object x, if and only if and There are two parts to this statement: If , then , and If and , then So we write it as

25 Truth table for biconditional
p q T F

26 Examples of compound propositions
The hero is American and the movie is good. Although the villain is French, the movie is good. If the movie is good, then either the hero is American or the heroine is British. The hero is not American, but the villain is French. A British heroine is a necessary condition for the movie to be good.

27 Necessary condition A British heroine is a necessary condition for the movie to be good. b: “The heroine is a British”. m: “The movie is good” b has to be true for m to be true. If m is true, then b is true So the propositional form is Under what condition this statement is true/false ?

28 Necessary condition A British heroine is a necessary condition for the movie to be good. What does propositional form mean ? If the heroine is a British, then the movie is good. m has to be true if b to be true. Under what condition is true, false ?

29 Sufficient Condition, Necessary Condition
Conditional connective: m is sufficient condition for b, meaning Whenever movie is good, the heroine is British. That is, it is impossible for the movie to be good, if the heroine is not British. Whenever the heroine is not British, the movie is not good. b is a necessary condition of m: b has to be true for m to be true Whenever b is false, m is false too. Whenever m is true, b is too

30 An Example World series Suppose a set of seven baseball games
the team that wins four games wins the series. Suppose the Dodgers are playing the Angels in the World Series in the 5th game the Dodgers have won three games so far the Angels have won one game so far

31 For the Dodgers (Winning the 5th game) ____ (Winning the series)
Winning the 5th game is a ______ condition for winning the series. If the Dodgers win the 5th game, they will win the world series. If the Dodgers didn’t win the series, then they didn’t win the 5th game.

32 For the Dodgers Winning the series is a _____ condition for winning the 5th game. Winning the series has to be true if winning the 5th game is true. It’s impossible that the Dodgers win the 5th game, but doesn’t win the series.

33 For the Angels (the Angels win the 5th game) ___ (the Angels win the world series) Winning the 5th game is a _____ condition of winning the series Winning the series is a ______ condition of winning the series

34 Biconditional connective
p if and only if q, Equivalent to , and p is sufficient and necessary condition of q An example:

35 Some exercises Purchasing a lottery ticket is a ______ condition for winning the lottery. An equivalent way to express this ? You have to take the final exam in order to pass the CSRU1400 course. Taking the final exam is a ______ condition of passing CSRU1400. Passing CSRU1400 is a _______ condition of taking the CSRU1400 exam.

36 True or false ? 1. 2. 3.

37 Truth tables We have defined the connectives using truth tables
Specifies the output for all possible combinations of the propositions’ value Like function tables t h T F

38 Combine multiple operations together
A propositional form with multiple connectives p q T F

39 Another example Truth table: # of rows depends on # of simple propositions in the form Each simple proposition takes value from set {T,F} With n simple propositions, there are 2n different combinations of the variable values

40 An example For a form with 3 simple propositions p q r

41 Some exercises Draw truth tables for the following propositions: 1. 2.
3. 4.

42 Smullyan’s Island Puzzle
You meet two inhabitants of Smullyan’s Island (where each one is either a liar or a truth-teller). A says, “Either B is lying or I am” B says, “A is lying” Who is telling the truth ?

43 Smullyan’s Island Puzzle
You meet one inhabitant of Smullyan’s Island (where each inhabitant is either a liar or a truth-teller). He says, “I am lying.” Is he a truth-teller ?

44 Smullyan’s Island Puzzle
You meet three inhabitants of Smullyan’s Island (where each one is either a liar or a truth-teller). A says, “Exactly one of us is telling the truth”. B says, “We are all lying.” C says, “The other two are lying.” Now who is a liar and who is a truth-teller ?

45 Summary Define connectives using truth table
Write English sentences in propositional form And, but, although If …, then … p is sufficient condition of q p is necessary condition of q Write truth table for any propositional form Application: logic puzzle

46 Next class Laws of logic operations
Tautology, equivalent proposition, and contradiction Review of homework 1


Download ppt "CSRU 1400 Discrete Structure: Logic"

Similar presentations


Ads by Google