21
The Foundation: Logic Conditional Statements Muhammad Arief download dari http://arief.ismy.web.id http://arief.ismy.web.id

The Foundation: Logic Conditional Statements Muhammad Arief download dari

Embed Size (px)

Citation preview

Page 1: The Foundation: Logic Conditional Statements Muhammad Arief download dari

The Foundation: Logic Conditional Statements

Muhammad Ariefdownload dari http://arief.ismy.web.id

http://arief.ismy.web.id

Page 2: The Foundation: Logic Conditional Statements Muhammad Arief download dari

Buku Text

• Discrete Mathematics and its Applications

Kenneth H. Rosen – 6th edition

Mc Graw-Hill International Edition

http://arief.ismy.web.id

Page 3: The Foundation: Logic Conditional Statements Muhammad Arief download dari

Conditional Statements• “If p then q”

“p implies q” “p q”; p: hypothesis, q: conclusion.

• Conditional: the truth of statement q is conditioned on the truth of statement p

• Example:IF 36 is divisible by 6, THEN 36 is divisible by 3

• IF you show up for work Monday morning, THEN you will get the job.

• Under what circumstances is the above sentence false?

http://arief.ismy.web.id

Page 4: The Foundation: Logic Conditional Statements Muhammad Arief download dari

Truth Table for Conditional Statements

Definition

• p q is false when p is true and q is false; otherwise it is true.

http://arief.ismy.web.id

Page 5: The Foundation: Logic Conditional Statements Muhammad Arief download dari

Truth Table for p ~q ~p

http://arief.ismy.web.id

Page 6: The Foundation: Logic Conditional Statements Muhammad Arief download dari

p q r (p r) (q r)OR p q r (p r) (q r)

http://arief.ismy.web.id

Page 7: The Foundation: Logic Conditional Statements Muhammad Arief download dari

Representation of IF-THEN as OR

• p: you do not get to work on time

• q: you are fired

• IF you do not get to work on time THEN you are fired

• ~p: you get to work on time

• p q ~p q

• You get to work on time OR you are fired

http://arief.ismy.web.id

Page 8: The Foundation: Logic Conditional Statements Muhammad Arief download dari

Representation of IF-THEN as OR

• Truth table for p q ~p q

http://arief.ismy.web.id

Page 9: The Foundation: Logic Conditional Statements Muhammad Arief download dari

De Morgan’s LawsDefinition:• The negation of an AND statement is

logically equivalent to the OR statement in which each component is negated.

~(p q) ~p ~q

• The negation of an OR statement is logically equivalent to the AND statement in which each component is negated.

~(p q) ~p ~qhttp://arief.ismy.web.id

Page 10: The Foundation: Logic Conditional Statements Muhammad Arief download dari

The Negation of a Conditional Statement

• The negation of “IF p THEN q” is logically equivalent to “p and not q”

~(p q) p ~q• Show the equivalence by using Morgan

Law• ~(p q) ~(~p q) ~(~p) ~q p ~q

http://arief.ismy.web.id

Page 11: The Foundation: Logic Conditional Statements Muhammad Arief download dari

The Negation of a Conditional Statement

• ~(IF my car is in the repair shop, THEN I cannot get the class)

• My car is in the repair shop and I can get to class

• ~(IF Sara lives in Athens, THEN she lives in Greece)

• Sara lives in Athens and she does not live in Greece

http://arief.ismy.web.id

Page 12: The Foundation: Logic Conditional Statements Muhammad Arief download dari

The Contrapositive of a Conditional Statements

Definition• The contrapositive of a conditional statement of

the form “IF p THEN q” is “IF ~q THEN ~p”• The contrapositive of p q is ~q ~p

• A conditional statement is logically equivalent to its contrapositive.

Construct the truth table

http://arief.ismy.web.id

Page 13: The Foundation: Logic Conditional Statements Muhammad Arief download dari

Example

• IF Howard can swim across the lake, THEN Howard can swim to the island

• IF Howard cannot swim to the island, then Howard cannot swim across the lake

• IF today is Easter, THEN tomorrow is Monday• IF tomorrow is not Monday, THEN today is not

Easter

http://arief.ismy.web.id

Page 14: The Foundation: Logic Conditional Statements Muhammad Arief download dari

The Converse and Inverse of a Conditional Statement

Definition• Suppose a conditional statement of the form “IF p

THEN q” is given.• The converse is “IF q THEN p”• The inverse is “IF ~p THEN ~q”

Symbolically• The converse of p q is q p• The inverse of p q is ~p ~q

Are they logically equivalent??

http://arief.ismy.web.id

Page 15: The Foundation: Logic Conditional Statements Muhammad Arief download dari

p q ~p ~q p q q p ~p ~q

T T F F T T T

T F F T F T T

F T T F T F F

F F T T T T T

http://arief.ismy.web.id

Page 16: The Foundation: Logic Conditional Statements Muhammad Arief download dari

Example: Converse, Inverse

• IF Howard can swim across the lake, THEN Howard can swim to the island

• Converse: IF Howard can swim to the island THEN Howard can swim across the lake

• Inverse: IF Howard cannot swim across the lake, THEN Howard cannot swim to the island.

• IF today is Easter, THEN tomorrow is Monday• Converse: IF tomorrow is Monday, THEN today

is Easter• Inverse: IF today is not Easter, THEN tomorrow

is not Mondayhttp://arief.ismy.web.id

Page 17: The Foundation: Logic Conditional Statements Muhammad Arief download dari

Only IfDefinition• p and q are statements,• p only if q means “IF not q THEN not p”• Or, equivalently,• “IF p THEN q”

• John will break the world’s record for the mile run ONLY IF he runs the mile in under four minutes.

• IF John does not run the mile in under four minutes, THEN he will not break the world’s record

• IF John breaks the world’s record, THEN he will have run the mile in under four minutes

http://arief.ismy.web.id

Page 18: The Foundation: Logic Conditional Statements Muhammad Arief download dari

Biconditional

Definition• Given statement variables p and q, the biconditional of p

and q is “ p if, and only if, q” and is denoted p q. The words if and only if are sometimes abbreviated iff.

http://arief.ismy.web.id

Page 19: The Foundation: Logic Conditional Statements Muhammad Arief download dari

Biconditional

• Is “ p if, and only if, q” logically equivalent with “ p if q “ and “ p only if q” ?

p q (q p) (p q)

Construct the truth table

http://arief.ismy.web.id

Page 20: The Foundation: Logic Conditional Statements Muhammad Arief download dari

p q (q p) (p q)

http://arief.ismy.web.id

Page 21: The Foundation: Logic Conditional Statements Muhammad Arief download dari

Necessary and Sufficient Conditions

Definition• If r and s are statements:

– r is a sufficient condition for s means “if r then s”

– r is a necessary condition for s means “if not r then not s” or “if s then r”

• r is a necessary and sufficient condition for s means “r if, and only if, s”.

http://arief.ismy.web.id