Upload
theresapainter
View
219
Download
0
Embed Size (px)
Citation preview
8/13/2019 Discrete Maths 2003 Lecture 12 3 Slides Pp
1/3
Lecture 12, 15-August-200Discrete Mathematics 2003
1
Using the Laws of Logic
Last lecture: We introduced the laws of logic(listed on page 55 of the text)
This lecture: The aim is to illustrate how to
use the laws to simplify logical expressions
Example: Use the laws of logic to simplify
the expression (p q) q
Law(s) of Logic Name
pq(pq) (qp) equivalence
pqp q implication
pp double negation
ppp ppp idempotent
pqqp pqqp commutative
(pq) rp(qr) (pq) rp(qr) associative
p(qr)
(pq) (pr)
p(qr)
(pq) (pr)distributive
(pq) pq (pq) pq de Morgans
pT p pF p identity
pF F pT T annihilation
ppF ppT inversep(pq) p p(pq) p absorption
3
Example of Using the Laws
Example: Use the laws of logic to simplify the
expression (p q) q
Solution: (p q) q
q (p q) (2nd commutative law) (q p) (q q) (2nd distributive law)
(q p) T (2nd inverse law)
q p (1st identity law)
p q (2nd commutative law)
Therefore (p q) q p q
8/13/2019 Discrete Maths 2003 Lecture 12 3 Slides Pp
2/3
Lecture 12, 15-August-200Discrete Mathematics 2003
4
Why not use Truth Tables?
Note that we could nothave used truth tables
in the previous example This is because at the outset we didnt know
what (p q) q might be equivalent to
Thus truth tables can be used to verify logicalequivalences, but the laws of logic are neededto determine the equivalences in the first place
Thus truth tables could be used to answer thequestion Verify (p q) q p q
5
How to decide which law(s) to use
There are no fixed rules to determine which
law(s) to use when simplifying expressions
However, begin by eliminating and
(if they appear) using the first 2 laws
After this, try a law to see if it helps to
simplify the expression if it doesnt, then
try another law
The process gets easier with practice!
6
Another Example
Example: Simplify the expression (p q) p
Solution: (p q) p
(p q) p (implication law)
(p q) p (2nd de Morgans law)
(p q) p (double negation law)
p (p q) (1st commutative law)
(p p) q (1st associative law)
p q (1st idempotent law)
8/13/2019 Discrete Maths 2003 Lecture 12 3 Slides Pp
3/3
Lecture 12, 15-August-200Discrete Mathematics 2003
7
Yet More Examples
Exercise: Simplify the logical expression(p q) p
Example: Use the laws of logic to verify that(p r) (p q) p q
This example could also have been answered byusing truth tables
Using truth tables may be a lengthy method, butit is a mechanical process that will always work
Using the laws of logic is usually shorter, butoften its not easy to know which law to apply