0% found this document useful (0 votes)
32 views15 pages

L01 Logic

This document contains lecture slides on propositional logic from a discrete mathematics course. The slides cover key concepts in propositional logic including propositions, logical connectives like negation, conjunction, disjunction, implication, logical equivalence, truth tables, and special logical relationships like contrapositives, converses, and inverses. Examples are provided to illustrate each logical connective. The slides also discuss applications of propositional logic in areas like software development, programming languages, and artificial intelligence.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views15 pages

L01 Logic

This document contains lecture slides on propositional logic from a discrete mathematics course. The slides cover key concepts in propositional logic including propositions, logical connectives like negation, conjunction, disjunction, implication, logical equivalence, truth tables, and special logical relationships like contrapositives, converses, and inverses. Examples are provided to illustrate each logical connective. The slides also discuss applications of propositional logic in areas like software development, programming languages, and artificial intelligence.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 15

CSE 1107

Discrete Mathematics
M.M.A. Hashem, PhD
Expectations
 This is really a fun course!
 This class contains some of the most beautiful math you’ll
ever learn.
 It’s even useful, beyond giving you techniques to use
solving the puzzles in Games Magazine.

Hints for success


 Read the textbook.
 Lectures really do help!
 Set up study groups and attend sections.
 Do the homework.

10/03/20
Logic
a tool for careful reasoning
◦ Software and hardware development
 Formal logic can lead to defect-free products
 Used in chip design (since Pentium disaster)
 Used in safety-critical software
 Used in network-secure software
 Positive influence on all software development
◦ Foundation for programming languages
 Lambda calculus – semantic base for all PLs
 Type checking and type inference – basis in logic
 Computation models – limits of computability
◦ Artificial intelligence, database systems
 Grounded in formal logic

10/03/20
Proof………
Here’s what you know:
Ellen is a math major or a CS major.
If Ellen does not like discrete math, she is not
a CS major.
If Ellen likes discrete math, she is smart.
Ellen is not a math major.

Can you conclude Ellen is smart?

10/03/20
Propositional Logic

proposition
AWhat’s a proposition?
is a declarative statement that’s either TRUE or
FALSE (but not both).

Propositions Not Propositions


3 + 2 = 32 Bring me coffee!

CS1207 is Belal’s favorite CS1207 is her favorite


class. class.
Every cow has 4 legs. 3+2

There is other life in the Do you like Cake?


universe.

10/03/20
Propositional Logic - negation

Suppose p is a proposition.
The negation of p is written p and has meaning:
“It is not the case that p.”

 Ex. CS1207 is NOT Belal’s favorite class.

p p
Truth table for negation:
T F Notice that
F T p is a
proposition!

10/03/20
Propositional Logic - conjunction

Conjunction corresponds to English “and.”


p  q is true exactly when p and q are both true.

 Ex. Amy is curious AND clever.

p q pq

Truth table for conjunction: T T T


T F F
F T F
F F F
10/03/20
Propositional Logic - disjunction

Disjunction corresponds to English “or.”


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

 Ex. Michael is brave OR nuts.

p q pq

Truth table for disjunction: T T T


T F T
F T T
F F F
10/03/20
Propositional Logic - implication

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.
p q pq

Truth table for implication: T T T


T F F
F T T
F F T
10/03/20
Propositional Logic - logical equivalence

How many different logical connectives could we


define? 16

How many different logical connectives do we


need? ??

To answer, we need the notion of


“logical equivalence.”

p is logically equivalent to q if their truth tables


are the same. We write p  q.

10/03/20
Propositional Logic - logical equivalence

Challenge: Try to find a proposition that is equivalent


to p  q, but that uses only the connectives , ,
and .

p q pq p q p q  p

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

10/03/20
Propositional Logic - proof of 1 famous 
I could say “prove
a law of
Distributivity: p  (q  r)  (p  q)  (p  r) distributivity.”

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
All truth
F F T
assignments F F F T F
for p,Fq, and
F F F F F F F
r.
10/03/20
Propositional Logic - special definitions
One of these
things is not
like the others.
Contrapositives: p  q and q  p
 Ex. “If it is noon, then I am hungry.”
“If I am not hungry, then it is not noon.”
Converses: p  q and q  p
 Ex. “If it is noon, then I am hungry.”
“If I am hungry, then it is noon.” Hint: In one
instance, the pair
Inverses: p  q and p  q of propositions is
 Ex. “If it is noon, then I am hungry.” equivalent.
“If it is not noon, then I am not hungry.”

p  q   q  p
10/03/20
Propositional Logic - 2 more defn…

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 T F
F T T F

10/03/20
Propositional Logic - say a bit…
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.

10/03/20

You might also like