# chapter 5 â€“ logic csnb 143 discrete mathematical structures

Post on 01-Jan-2016

218 views

Category:

## Documents

Tags:

• #### cold q

Embed Size (px)

TRANSCRIPT

• Chapter 5 Logic

CSNB 143 Discrete Mathematical Structures

• OBJECTIVESStudent should be able to know what is it means by statement. Students should be able to identify its connectives and compound statements.Students should be able to use the Truth Table without difficulties.

• LogicStatement or proposition is a declarative sentence with the value of true or false but not both.

Ex 1: Which one is a statement?The world is round.2 + 3 = 5Have you taken your lunch? 3 - x = 5The temperature on the surface of Mars is 800F.Tomorrow is a bright day.Read this!

• Statement usually will be replaced by variables such as p, q, r or s. Ex 2:p: The sun will shine today.q: It is a cold weather. Statements can be combined by logical connectives to obtain compound statements. Ex 3: AND (p and q): The sun will shine today and it is a cold weather.

• Connectives AND is what we called conjunction for p and q, written p q. The compound statement is true if both statements are true. Connectives OR is what we called disjunction for p and q, written p q. The compound statement is false if both statements are false. To prove the value of any statement (or compound statements), we need to use the Truth Table.

• PQP QP QTTTTTFFTFTFTFFFF

• Negation for any statement p is not p. written as ~p or p. The Truth Table for negation is:

Ex 4: Find the value of (~p q) p using Truth Table.

P PTFFT

• PQ P P Q( P Q) PTTFFTTFFFTFTTTTFFTFF

• Conditional StatementsIf p and q are statements, the compound statement if p then q, denoted by p q is called a conditional statement or implication. Statement p is called the antecedent or hypothesis; and statement q is called consequent or conclusion. The connective if then is denoted by the symbol .Ex 5: a) p : I am hungryq : I will eatb) p : It is cold q : 3 + 5 = 8The implication would be: a) If I am hungry, then I will eat.b) If it is cold, then 3 + 5 = 8.

• Take note that, in our daily lives, Ex 5 b) has no connection between statements p and q, that is, statement p has no effect on statement q. However, in logic, this is acceptable. It shows that, in logic, we use conditional statements in a more general sense. Its Truth Table is as below:

To understand, use:p = It is raining q = I used umbrella

PQP QTTTTFFFTTFFT

• Another meaning that use the symbol includes:if p, then qp implies qif p, qp only if qp is sufficient for qq if pq is necessary for p

• If p q is an implications, then the converse of it is the implication q p, and the contrapositive of it is ~q ~p.

Ex 6: p = It is rainingq = I get wetGet its converse and contrapositive.

• If p and q are statements, compound statement p if and only if q, denoted by p q, is called an equivalence or biconditional.Its Truth Table is as below:

To understand, use:p = It is raining q = I used umbrellaNotis that p q is True in two conditions: both p and q are True, or both p and q are false.

PQP QTTTTFFFTFFFT

• Another meaning that use the symbol includes: p is necessary and sufficient for qif p, then q, and conversely

In general, compound statement may contain few parts in which each one of it is yet a statement too. Ex 7: Find the truth value for the statement(p q) (~q ~p)

• A statement that is true for all possible values of its propositional variables is called a tautology.

PQPQ(A)QPQP(B)(A)(B)TTTFFTTTFFTFFTFTTFTTTFFTTTTT

• A statement that is always false for all possible values of its propositional variables is called a contradiction. A statement that can be either true or false, depending on the truth values of its propositional variables is called a contingency

• Logically EquivalentTwo statements p and q are said to be logically equivalent if p q is a tautology.Ex 8: Show that statements p q and (~p) q are logically equivalent.

• QuantifierQuantifier is used to define about all elements that have something in common.Such as in set, one way of writing it is {x | P(x)} where P(x) is called predicate or propositional function, in which each choice of x will produces a proposition P(x) that is either true or false.

• There are two types of quantifier being used:Universal Quantification () of a predicate P(x) is the statement For all values of x, P(x) is true

In other words:for every xevery xfor any x

• Existential Quantification () of a predicate P(x) is the statementThere exists a value of x for which P(x) is true

In other words:there is an xthere is some xthere exists an xthere is at least one x

• Theorem 1Operations on statements are: Commutativep q q pp q q pAssociativep (q r) (p q) rp (q r) (p q) rDistributivep (q r) (p q) (p r)p (q r) (p q) (p r)

• Idempotentp p pp p p

Negations~(~p) p~(p q) (~p) (~q)~(p q) (~p) (~q)

• Theorem 2Operations on implications are:(p q) ((~p) q)(p q) ((~q) ~p)(p q) ((p q) (q p))~(p q) (p ~q)~(p q) ((p ~q) (q ~p))

• Theorem 3Operations on quantifier are:~(x P(x)) x ~P(x)

~(x ~P(x)) x P(x)

x (P(x) Q(x)) x P(x) x Q(x)

x P(x) x Q(x) x (P(x) Q(x))

• x (P(x) Q(x)) x P(x) x Q(x)

x (P(x) Q(x)) x P(x) x Q(x)

((x P(x)) (x Q(x))) x (P(x) Q(x))tautology

x (P(x) Q(x)) x P(x) x Q(x)tautology

• Theorem 4All of these are tautology:a) (p q) p f) (p q) pb) (p q) qg) (p (p q)) qc) p (p q)h) (~p (p q)) qd) q (p q) i) (~q (p q)) ~pe) ~p (p q) j) ((p q) (q r)) (p r)

*

Recommended