Docsity

Propositional Logic - Discrete Mathematics - Lecture Slides, Slides of Discrete Mathematics

Partial preview of the text

Download Propositional Logic - Discrete Mathematics - Lecture Slides and more Slides Discrete Mathematics in PDF only on Docsity!

Propositional Logic

What’s a proposition?

4/20/

Propositions Not Propositions

3 + 2 = 32 Bring me coffee!

CS173 is Bryan’s favorite class.

CS173 is her favorite class. Every cow has 4 legs. 3 + 2

There is other life in the universe.

Do you like Cake?

A proposition is a declarative statement that’s either TRUE or

FALSE (but not both).

Propositional Logic - negation

4/20/

Suppose p is a proposition.

The negation of p is written ¬p and has meaning:

“It is not the case that p.”

 Ex. CS173 is NOT Bryan’s favorite class.

Truth table for negation:

p ¬p

T

F

F

T

Notice that

¬p is a

proposition!

Propositional Logic - disjunction

4/20/

Disjunction corresponds to English “or.”

p ∨ q is when p or q (or both) are true.

 Ex. Michael is brave OR nuts.

Truth table for disjunction:

p q p ∨ q

T

T

F

F

T

F

T

F

T

T

T

F

Propositional Logic - implication

4/20/

Implication: p → q corresponds to English “if p

then q,” or “p implies q.”

 If it is raining then it is cloudy.

 If there are 200 people in the room, then I am

the Easter Bunny.

 If p then 2+2=4.

Truth table for implication:

p q p → q

T

T

F

F

T

F

T

F

T

F

T

T

Propositional Logic - logical equivalence

4/20/

Challenge: Try to find a proposition that is equivalent

to p → q, but that uses only the connectives ¬, ∧,

and ∨.

p q p → q

T

T

F

F

T

F

T

F

T

F

T

T

p q ¬ p q ∨ ¬p

T

T

F

F

T

F

T

F

F

F

T

T

T

F

T

T

Propositional Logic - proof of 1 famous ≡

4/20/

Distributivity: p ∨ ( q ∧ r ) ≡ (p ∨ q ) ∧ ( p ∨ r )

p q r q ∧ r p ∨ ( q ∧ r ) p ∨ q p ∨ r (p ∨ q ) ∧ ( p ∨ r )

T T T T T T T T T T F F T T T T T F T F T T T T T F F F T T T T F T T T T T T T F T F F F T F F F F T F F F T F F F F F F F F F

All truth assignment s for p , q , and r.

I could say “prove a law of distributivity.”

Propositional Logic - 2 more defn…

4/20/

A tautology is a proposition that’s always TRUE.

A contradiction is a proposition that’s always FALSE.

p ¬ p^ p^ ∨^ ¬ p^ p^ ∧^ ¬ p

T F

F T

T

T

F

F

Propositional Logic - say a bit…

4/20/

This week we’re using propositional logic as a foundation for formal proofs.

Propositional logic is also the key to writing good code…you can’t do any kind of conditional (if) statement without understanding the condition you’re testing.

All the logical connectives we’ve discussed are also found in hardware and are called “gates.”

We’ll talk about more applications next time.