Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 2 Symbolic Logic. Section 2-1 Truth, Equivalence and Implication.

Similar presentations


Presentation on theme: "Chapter 2 Symbolic Logic. Section 2-1 Truth, Equivalence and Implication."— Presentation transcript:

1 Chapter 2 Symbolic Logic

2 Section 2-1 Truth, Equivalence and Implication

3 More on Implication Universal Implication: A statement p implies a statement q, if q is true in every situation that makes p true. p  q EX: (x>2)  (x>1)

4 More on Implication Ex: Show that p ^ q implies p V (¬p ^ q)

5 Def. A universally true statement is true for each element of the universe. Ex: Universe: Flipping 2 coins. p: if there is one tail then there is one head. - p is a universally true statement.

6 Tautology A tautologically true statement is a statement that is always true ( it can be written as a symbolic statement whose truth table has only Trues in the final column). Ex: “The result has 2 H’s or the result doesn’t have 2 H’s” ( p V ¬p) The statement is always true (tautology).

7 Contradiction A statement that is always false. Ex: p ^ ¬ p is always false ( a contradiction).

8 Example p is the statement: x<=0 q is the statement: x>=10 Show that ¬(p V q) and ¬p ^ ¬q are equivalent.

9 Section 2.3 Predicate Logic

10 Propositional Logic In propositional logic we used symbols to represent simple statements ( p, q, r, s) we also used symbols and logical connectives ( V, ^, , ⊕, ¬ ) to represent compound statements.

11 Predicate Logic A predicate is a function that always evaluates to either true or false. A predicate has the form: Predicate-name( List of Arguments). Ex: x is a positive number Predicate: positive number (x) Positive number (5)= True Positive number (-5)= False

12 Predicate Logic Ex: “ 5 is greater than 2” We define the predicate greater than as: Greater than( x, y): x>y P (x, y): x>y P(2,5)= False P(5,2)= True

13 Predicate Logic 1- Uses predicates to represent simple statements. 2- Uses Logical connectives ( V, ^, , ⊕, ¬ ) 3- Quantifiers: Universal quantifier:  Existential quantifier:  4- Variables: x, y, z…...

14 Predicate Logic Ex: Consider the statement “ x is greater than 14”. Predicate: p( x, y): x>y P( x,14): x>14 - There is a value greater than 14 is represented as......... - All values are greater than 14 is represented as ………. - All values are less than 14 as……………..

15 Predicate Logic Ex: Element x belongs to set A. B (x, A): Element x belongs to set A. - Every element in A belongs also to B is represented as:  x [ b( x, A)  b( x, B)]

16 Free and Bound variables The variable x is said to be bound by  x or by  x if x lies in the scope of the quantifier. A variable that is not bound by a quantifier is said to be free.

17 Free and Bound Variables Ex: Below, describe the scope of each quantifier, and describe which variables are bound and which are free. -  x ( p (x) ^  y (t( x, y) ^ r(x))) No free variables. - ¬  x (p(x) ^  y (t(x,y)) V r(z)) Z is free. - ¬  x (p(x) ^  y (t(x,y)) V r(y)). Y in t(x,y) is bound but the y in r(y) is free.

18 Free and Bound Variables Ex: -  x [ b( x, A)]  b( x, B) Means: If A is the universe, x belongs to B. What is the scope of the quantifier? -  x [ b( x, A)]   x [b( x, B)] It means: If A is the universe then B is the universe.

19 Predicate Logic Ex: Assume b(x,y) represents the statement “x belongs to y”. Represent each of the following in predicate logic: - 2 belongs to S. - 1 belongs to A and 2 belongs to B. - All elements in A are positive. - There is an element in A that is not in B. - There is an element in A that is greater then any element in B. - A is a subset in B.

20 Predicate Logic ( quantifiers) The statement  x s(x) is true iff s is true for every element in the universe. The statement  x s(x) is true iff s is true for at least one element in the universe.

21 Predicate Logic (quantifiers) Ex: Suppose Universe: the set of +ve integers s(x) represents “x is an even integer” p(x) represents “x is a prime integer” r(x) represents “ x>2” Which of the following are true and which are false? -  x p(x) …. True( try x=2) -  x p(x) …. False (try x=4) -  x (p(x) ^ s(x)) … true ( x=2) -  x (p(x) ^ s(x) ^ r(x)) …false -  x (s(x)  p(x))…false ( try x=4) -  x (p(x)  s(x))…false (try x=3) -  x (p(x)  s(x))… true (x=2) -  x [(r(x)^s(x))  p(x)] …. true(x=2)

22 Equivalence Two statements p and q in predicate logic are equivalent if for any universe and for any statements about the universe we substitute for p,q the resulting statements about the universe are equivalent. Ex:  x(¬ s (x)) is equivalent to ¬  x (s (x))

23 Equivalence Rules The following quantified statements are equivalent. -  x(¬ s (x)) ↔ ¬  x (s (x)) - (  x s(x)) ^t ↔  x (s(x) ^t) - (  x s(x)) ^t ↔  x (s(x) ^t) - (  x s(x)) v t ↔  x (s(x) vt) - (  x s(x)) v t ↔  x (s(x) v t) - [  x p(x)] ^ [  x q(x)] ↔  x [p(x) ^ q(x)] - [  x p(x)] v [  z q(z)] ↔  x [p(x) v q(x)]

24 Equivalence Ex: - [  w p(w)] ^ [  w q(w)] -  w [p(w) ^ q(w)] Are they equivalent? Why?

25 Equivalence Ex: -  y [  x p(x,y)] -  x [  y p(x,y)] Are they equivalent? Why?

26 Section 2.2 Proof Methods: - Direct proof - Indirect proofs: a- Contra positive inference b- Proof by contradiction

27 Converses The statement q  p is the converse of the statement p  q. If p  q is true, it does not mean that q  p is true. -Ex: -If n is a positive even integer, then n>1. (p  q) - 5>1, then 5 is a positive even integer (q  p)....false

28 Counter-example To show that a statement is theorem we give a proof. To show that a statement is false (not theorem), we give a counter-example. Ex: “ If n is a positive integer, then n >5” Counter-example: n=4 (positive and <5)

29 Direct proof or principle of direct inference (also called modes ponens) If we know that r is true, and r  s is true, we conclude that s is true. A direct proof has the form: Statement1 Statement 2. Statement n Where statement n is the one we want to prove and each other statement is: a- a hypothesis b- an accepted mathematical fact c- the result of applying direct inference to earlier statements

30 Direct proof Ex: Prove that if the integers n and m are each multiple of 3, then m+n is a multiple of 3. Note: The word assume precedes the hypothesis and the words ( therefore, then) precedes the inference.

31 Contra positive Inference To show that p  q, we show that ¬q  ¬p Ex: Prove that for each number n of the universe of positive integers, if n 2 >100 then n>10.

32 Proof by Contradiction From p and p^¬q  ¬p we conclude q. If assuming that ¬p leads to contradiction, the p is true. Ex: Prove that if x 2 +x-2 =0 then x ≠ 0 Also, see example 15 page 74

33 Example Show that if the following statements are true p p  q q  r r  s Then s is also true. (Prove it by both direct and contradiction).


Download ppt "Chapter 2 Symbolic Logic. Section 2-1 Truth, Equivalence and Implication."

Similar presentations


Ads by Google