26
The Foundation: Logic Propositional Logic, Propositional Equivalence Muhammad Arief download dari http://arief.ismy.web.id

The Foundation: Logic Propositional Logic, Propositional Equivalence Muhammad Arief download dari

Embed Size (px)

Citation preview

The Foundation: LogicPropositional Logic, Propositional Equivalence

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

Propositions / Statements

• A statement (or proposition) is a sentence that is true or false but not both.

• The truth value of a proposition is either TRUE / T / 1 or FALSE / F / 0.

• Ex.– two plus two equals four

• Proposition? Yes• Truth value: true

http://arief.ismy.web.id

Examples• Two plus two equals five

– Proposition? Yes– Truth value: False

• An elephant is bigger than an ant– Proposition? Yes– Truth value: true

• He is a university student – Proposition? No– Truth value: depend on who he is

• C is bigger than 10– Proposition? No – Truth value: unknown

• F plus G equals 9– Proposition? No– Truth value: unknown

http://arief.ismy.web.id

Examples

• Dimana letak kampus UMN – Proposition? No (pertanyaan)

• Jangan memakai sandal ke kampus– Proposition? No (perintah)

• Mudah-mudahan jalan tidak macet – Proposition? No (harapan)

• Indahnya bulan purnama– Proposition? No (ketakjuban / keheranan)

http://arief.ismy.web.id

Compound Propositions / Compound Statements

• A composition of two or more proposition / statement that is true or false but not both

• Example:– Budi is studying at UMN, he is a university student

• Compound statement? Yes• Truth value : True

– Jika x = 1 dan y = 2 maka x lebih besar daripada y• Compound Statement? Yes• Truth value: False

http://arief.ismy.web.id

Formalization of (Compound) Statements

• Translating a (compound) statement to symbols (such as x, y, z) and logical operator.

• Logical operator:~, ¬ not

and

or

http://arief.ismy.web.id

Example~p : not p, negation of p

p q : p and q, conjunction of p and q

p q : p or q, disjunction of p and q

• Order of operation : ( … )

~

Example:

~p q = (~p) qp q r is ambiguous, (p q) r or p (q r)

http://arief.ismy.web.id

Example

• p = it is hot; q = it is sunny

• It is not hot but sunny– It is not hot and it is sunny ~p q

• It is neither hot nor sunny– It is not hot and it is not sunny ~p ~q

http://arief.ismy.web.id

Example

• x ≤ a means x < a or x = a

• a ≤ x ≤ b means a ≤ x and x ≤ b

• 2 ≤ x ≤ 1– compound statement? Yes– Truth value: False

http://arief.ismy.web.id

Truth TableThe list of all possible truth values of a

compound statement.

Truth Table for Negation

http://arief.ismy.web.id

Truth Table for Conjunction p q

http://arief.ismy.web.id

Truth Table for Disjunction p q

http://arief.ismy.web.id

Evaluating the Truth of more General Compound Statements

~p q = (~p) q

Steps: - Evaluate the expressions within the

innermost parentheses- Evaluate the expressions within the next

innermost set of parentheses- Until you have the truth values for the

complete expression.http://arief.ismy.web.id

Evaluating the Truth of more General Compound Statements

p q ~p ~p q

T T F F

T F F F

F T T T

F F T Fhttp://arief.ismy.web.id

Truth Table for Exclusive Or

Definition:• (p q) ~(p q) : p q, p XOR q,

http://arief.ismy.web.id

Truth Table for (p q) ~r

http://arief.ismy.web.id

Logical EquivalenceDefinition:• Two statement forms are called logically

equivalent if, and only if, they have identical truth values for each possible substitution of statements for their statement variable.

P = p qQ = q p

• The logical equivalence of statement forms P and Q is denoted by writing P Q.

http://arief.ismy.web.id

Logical Equivalence P Q

http://arief.ismy.web.id

~(~p) p

http://arief.ismy.web.id

Are ~(p q) and ~p ~q logically equivalent?

http://arief.ismy.web.id

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

De Morgan’s Laws

http://arief.ismy.web.id

Tautologies and Contradictions

• A tautology is a statement form that is always true regardless of the truth values of the individual statements substituted for its statement variables.

p ~p

• A contradiction is a statement form that is always false regardless of the truth values of the individual statements substituted for its statement variables.

p ~p

http://arief.ismy.web.id

Tautologies and Contradictions

http://arief.ismy.web.id

Examples

• x + y > 0 (not a statement)

• For x = 1 and y = 2, x + y > 0

• For x = -1 and y = 0, x + y > 0

http://arief.ismy.web.id

Applying De Morgan’s Laws

• John is six feet tall and he weighs at least 200 pounds.• The bus was late or Tom’s watch was slow.• -1 < x 4• p: jim is tall and jim is thin

• John is not six feet tall or he weighs less than 200 pounds.

• The bus was not late and Tom’s watch was not slow.• -1 < x and x 4• -1 < x or x 4• -1 x and x > 4• ~p: jim is not tall or jim is not thin

http://arief.ismy.web.id