Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Introduction to Abstract Mathematics The Logic of Compound Statements 2.1 and 2.2 Instructor: Hayk Melikya

Similar presentations


Presentation on theme: "1 Introduction to Abstract Mathematics The Logic of Compound Statements 2.1 and 2.2 Instructor: Hayk Melikya"— Presentation transcript:

1 1 Introduction to Abstract Mathematics The Logic of Compound Statements 2.1 and 2.2 Instructor: Hayk Melikya melikyan@nccu.edu

2 2 Introduction to Abstract Mathematics Logic Logic is not only the foundation of mathematics, but also is important in numerous fields including law, medicine, and science. Although the study of logic originated in antiquity, it was rebuilt and formalized in the 19 th and early 20 th century. George Boole (Boolean algebra) introduced Mathematical methods to logic in 1847 while Georg Cantor did Theoretical work on sets and discovered that there are many different sizes of infinite sets.

3 3 Introduction to Abstract Mathematics Logic v Mathematical logic is a tool for dealing with formal reasoning v Logic does: –Assess if an argument is valid/invalid v Logic does not directly: –Assess the truth of atomic statements

4 4 Introduction to Abstract Mathematics v Logic can deduce that: –NCCU is in North Carolina v given these facts: –NCCU is in Durham –Durham is in North Carolina v Logic knows nothing of whether these facts actually hold in real life!

5 5 Introduction to Abstract Mathematics Argument #1 v All men are mortal v Socrates is a man v Therefore, Socrates is mortal

6 6 Introduction to Abstract Mathematics Where is COMP2200 ? v How do we find such bugs in software? –Tracing –Debug statements –Test cases –Many software testers working in parallel… v All of that had been employed in the previous cases v Yet the disasters occurred … Logic : means to prove correctness of software Sometimes can be semi-automated Can also verify a provided correctness proof

7 7 Introduction to Abstract Mathematics Validity v An argument is valid if and only if given that its premises hold its conclusion also holds –Socrates argument: Valid or Invalid? –Sandwich argument: Valid or Invalid? How can we tell ? v Common sense? v Voting? v Authority? v What is valid argument anyway? v Who cares? v ???

8 8 Introduction to Abstract Mathematics Arguments in Puzzles v The Island of Knights and Knaves Never lie Always lie v You meet two people: A, B v A says: I am a Knave or B is a Knight v B says A and I are of opposite type v Who is A? v Who is B?

9 9 Introduction to Abstract Mathematics Solution v The original statement can be written as: v S = X or Y v X = “A is a Knave” v Y = “B is a Knight” v Suppose A is a Knave v Then S must be false since A said it v Then both X and Y are false v If X is false then A is not a Knave v Contradiction : A cannot be a Knave and not a Knave v So A must be a Knight v So S is true and X is not true v Thus, to keep S true Y must be true v So B is a Knight too v You meet just one guy : A v A says:“I’m a Knave!” v Who is A?

10 10 Introduction to Abstract Mathematics Statements or Propositions v A proposition or statement is a declaration (sentence) which is either true or false (but not both same time). v Some examples: v 2+2 = 5 is a statement because it is a false declaration. v Orange juice contains vitamin C is a statement that is true. v Open the door. This is not considered a statement since we cannot assign a true or false value to this sentence. It is a command, but not a statement or proposition. v WHAT TIME IS IT?. v 5 + 7. v X + 5 = 13.

11 11 Introduction to Abstract Mathematics Negation( or denial) v The negation of a statement, p, is “not p” and is denoted by ~p ( also ┐ p ) v If p is true, then its negation is false. If p is false, then its negation is true.  Truth table: u p ┐p u T F u F T If p : “Jack went up the hill” then ~ p : “ Jack did not go up the hill”

12 12 Introduction to Abstract Mathematics Conjunction (Logical AND) In ordinary English, we are building new propositions from old ones via connectors. Similar way we will construct new propositions from old ones in mathematics too. Definition: If P and Q are proposition then P  Q is a new proposition which referred to as the conjunction of “P and Q”. The proposition P  Q is true if both P and Q are true propositions and it is false otherwise. PQ P  Q TT T TF F FT F FF F

13 13 Introduction to Abstract Mathematics Disjunction (Logical OR) Definition: If P and Q are proposition then P  Q is a new proposition which referred to as the disjunction of P and Q. The proposition P  Q is false if both P and Q are false propositions and it is true otherwise. PQ P  Q TT T TF T FT T FF F

14 14 Introduction to Abstract Mathematics The Implication (Conditional) Definition: If P and Q are proposition then P  Q is a new proposition which referred to as “P implies Q”. The proposition P  Q is false if P is true and Q is false and it is true otherwise PQ P  Q TT T TF F FT T FF T In conditional statements: p  q v p is called the hypothesis and q is called the conclusion v The only combination of circumstances in which a conditional sentence is false is when the hypothesis is true and the conclusion is false

15 15 Introduction to Abstract Mathematics Conditional Statements: P  Q P is also called: assumption or premise or antecedent A conditional statements is called vacuously true or true by default when its hypothesis is false Q is called : conclusion v There are several ways of expressing P  Q : 1. If P, then Q 2. Q if P 3. P implies Q 4. P only if Q 5. Q is necessary for P 6 P is sufficient for Q

16 16 Introduction to Abstract Mathematics Exercise: Rewrite each of the following sentences in "if, then" form ( a) You will pass the test only if you study for at least four hours. (b) Attending class regularly is a necessary condition for passing the course. (c) In order to be a square, it is sufficient that the quadrilateral have four equal angles. (d) In order to be a square, it is necessary that the quadrilateral have four equal angles. (e) An integer is an odd prime only if it is greater than 22

17 17 Introduction to Abstract Mathematics Conditional Statement : p  q v Contrapositive of p  q is another conditional statement ~q  ~p A conditional statement is equivalent to its contrapositive v The converse of p  q is q  p v The inverse of p  q is ~p  ~q v Conditional statement and its converse are not equivalent v Conditional statement and its inverse are not equivalent v What do you think about convers and inverse of statement???????

18 18 Introduction to Abstract Mathematics Conditional Statements v The converse and the inverse of a conditional statement are equivalent to each other v p only if q means ~q  ~p, or p  q v Biconditional of p and q means “p if and only if q” and is denoted as p  q v r is a sufficient condition for s means r  s v r is a necessary condition for s means ~r  ~ s “if not r then not s” which is same as s  r

19 19 Introduction to Abstract Mathematics Exercises: Write contrapositive, converse and inverse statements for –If P is a square, then P is a rectangle –If today is Thanksgiving, then tomorrow is Friday –If c is rational, then the decimal expansion of c is repeating –If n is prime, then n is odd or n is 2 –If x is nonnegative, then x is positive or x is 0 –If Tom is Ann’s father, then Jim is her uncle and Sue is her aunt –If n is divisible by 6, then n is divisible by 2 and n is divisible by 3

20 20 Introduction to Abstract Mathematics Contrapositive: Examples The contrapositive of “if p then q” is “if ~q then ~p”. Statement: If you don’t give me all your money, then you will die immediately. Statement: If you are a CS year 1 student, then you are taking COMP 2200. Contrapositive: If you don’t want to die immediately,then you give me all your money. Contrapositive: If you are not taking COMP 2200, then you are not a CS year 1 student. Fact: A conditional statement is logically equivalent to its contrapositive.

21 21 Introduction to Abstract Mathematics Biconditional v P  Q is often read as : P if and only if Q or P iff Q for shorthand. v phrasing of P  Q is P is a necessary and sufficient condition for Q. Definition: If P and Q are propositions then the biconditional P and Q is a proposition denoted by P  Q whose truth value is given by the truth table PQ P  Q TT T TF F FT F FF T

22 22 Introduction to Abstract Mathematics Propositional forms/ formulas /expressions: Alphabet: variables (letters upper/lower X, Y, Z, … A, B, C ) symbols , , ~, and parentheses (, ) also we add two more , , Propositional expressions (propositional forms) are formed using these elements of alphabet as follows: 1. Each variable is propositional expression 2. IF p and q are propositinal expressions then ~ p, p  q, p  q, p  q, p  q, (p), all are propositional expressions 3. Any expression is obtained by applying repeatedly steps 1 or 2.

23 23 Introduction to Abstract Mathematics Truth Tables Recall that propositional forms are made up of propositional variables and logical connectors in such a way that if one substitute the propositional variables by actual propositions then it becomes proposition. The truth table for a given propositional form displays the truth values that corresponds to all possible combinations of truth values for its propositional variables. Let us construct the truth table for propositional form (p  q)  ~(p  q) which often denoted as p  q (p XOR q) exclusive or pqp  qp  q~(p  q)p  q TTTTFF TFTFTT FTTFTT FFTTFF

24 24 Introduction to Abstract Mathematics Logical Equivalence Two propositional forms are cold logically equivalent if they have identical truth tables. If propositional forms p and q are logically equivalent we write p  q, p qp  q~p~p  q TTTFT TFFFF FTTTT FFTTT Show that p  q is logically equivalent to ~p  q

25 25 Introduction to Abstract Mathematics Tautology and contradiction Definition: A propositional form (compound proposition) is called a tautology if it is true for all possible combinations of truth values assigned to propositional variables (component propositions ). ( p  ~p )  t ( toutalogy) Definition: A propositional form (compound proposition ) is called a contradiction if it is false for all possible combinations of truth values of the propositional variables (component propositions) ( p  ~p )  c (contradiction) A compound proposition is a proposition composed of one or more given propositions (called the component propositions in this context) and at least one logical connective.

26 26 Introduction to Abstract Mathematics Examples: v Write truth table for: p  q  ~p v Show that (p  q)  r  (p  r)  (q  r) v Representation of  : p  q  ~p  q Re-write using if- then: Either you get in class on time, or you risk missing some material v Negation of  : ~(p  q)  p  ~q Write negation for: If it is raining, then I cannot go to the beach

27 27 Introduction to Abstract Mathematics Theorem RR ( See theorem 1.1.1) ( replacement rules) 1. Commutative Law [Com] 2. Associative Law [Assoc] P  Q  Q  P, (P  Q )  R  P  (Q  R) P  Q  Q  P (P  Q )  R  P  (Q  R) 3. Distributive Law [Dist] 4. Contrapositive Law [Contr] P  (Q  R)  (P  Q)  (P  R) (P  Q)  (~ Q  ~ P) P  (Q  R)  (P  Q)  (P  R) 5. DeMorgan Law [DeM] 6. Double Negation [DN] ~ ( P  Q)  (~ P  ~ Q ) ~ ~ (P)  P ~ ( P  Q)  (~ P  ~ Q ) 7. Implication Law [Impl] 8. Equivalence Law [Equiv] (P  Q)  (~ P  Q) P  Q  ( P  Q)  (Q  P) P  Q  (P  Q)  (~ Q  ~ P) 9. Exportation [Exp] 10. Tautology (Identity) [Taut] (P  Q)  R  P  (Q  R) P  P  P or P  P  P 11. P  t  P and P  c  c 12 P  t  t and P  c  P t-tautolagy and c-contradiction

28 28 Introduction to Abstract Mathematics Practice problems 1. Study the Sections 2.1 and 2.2 from your textbook. 2. Be sure that you understand all the examples discussed in class and in textbook. 3. Only after you complete the proof of the Theorem_RR from the notes 4. Do the following problems from the textbook: Exercise 2.1, # 2, 3, 7, 8, 15, 26, 36, 43, 44, 46, 51. Exercise 2.2, # 9, 15, 18, 21, 25, 27, 36, 44, 46, 48.


Download ppt "1 Introduction to Abstract Mathematics The Logic of Compound Statements 2.1 and 2.2 Instructor: Hayk Melikya"

Similar presentations


Ads by Google