Docsity

Mathematical Logic: Propositional Logic and Truth Tables, Exams of Mathematical logic

Partial preview of the text

Download Mathematical Logic: Propositional Logic and Truth Tables and more Exams Mathematical logic in PDF only on Docsity!

Mathematical Logic

Part One

Question: How do we formalize the logic

we've been using in our proofs?

Propositional Logic

A proposition is a statement that is,

by itself, either true or false.

More Propositions ●

Got kiss myself

●

I'm so pretty

●

I'm too hot

●

Called a policeman and a fireman

●

Made a dragon want to retire, man

Things That Aren't Propositions Commands cannot be true or false. Commands cannot be true or false.

Things That Aren't Propositions

I am the walrus,

goo goo g'joob

The first half is a valid proposition. The first half is a valid proposition. Jibberish cannot be true or false. Jibberish cannot be true or false.

Propositional Logic ●

Propositional logic is a mathematical system

for reasoning about propositions and how they

relate to one another.

●

Every statement in propositional logic consists

of propositional variables combined via

propositional connectives.

● Each variable represents some proposition, such as

“You liked it” or “You should have put a ring on it.”

● Connectives encode how propositions are related,

such as “If you liked it, then you should have put a

ring on it.”

Propositional Connectives

● Logical NOT: ¬ p

● (^) Read “ not p ” ● (^) ¬ p is true if and only if p is false. ● (^) Also called logical negation.

● Logical AND: p ∧ q

● (^) Read “ p and q .” ● (^) p ∧ q is true if both p and q are true. ● (^) Also called logical conjunction.

● Logical OR: p ∨ q

● (^) Read “ p or q .” ● (^) p ∨ q is true if at least one of p or q are true (inclusive OR) ● (^) Also called logical disjunction.

Truth Tables ●

A truth table is a table showing the

truth value of a propositional logic

formula as a function of its inputs.

●

Useful for several reasons:

●

Formally defining what a connective

“means.”

● Deciphering what a complex propositional

formula means.

Summary of Important Points ●

The ∨ operator is an inclusive “or.” It's

true if at least one of the operands is

true.

●

Similar to the || operator in C, C++, Java and

the or operator in Python.

●

If we need an exclusive “or” operator, we

can build it out of what we already have.

Mathematical Implication

Why This Truth Table? ● The truth values of the → are the way they are because they're defined that way. ● The intuition:

● We want p → q to mean “whenever p is true, q is true

as well.”

●

The only way this doesn't happen is if p is true and q

is false.

● In other words, p → q should be true whenever

¬( p ∧ ¬ q ) is true.

● What's the truth table for ¬( p ∧ ¬ q )?

T F T T Truth Table for Implication p q p → q F F T T F F T T The only way for p → q to be false is for p to be true and q to be false. Otherwise, p → q is by definition true. The only way for p → q to be false is for p to be true and q to be false. Otherwise, p → q is by definition true.