06.03.2017 Views

Mathematics for Computer Science

e9ck2Ar

e9ck2Ar

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

“mcs” — 2017/3/3 — 11:21 — page 57 — #65<br />

3.4. The Algebra of Propositions 57<br />

Associativity (3.8) justifies writing A AND B AND C without specifying whether<br />

it is parenthesized as A AND .B AND C / or .A AND B/ AND C . Both ways of<br />

inserting parentheses yield equivalent <strong>for</strong>mulas.<br />

Unlike arithmetic rules <strong>for</strong> numbers, there is also a distributivity law <strong>for</strong> “sums”<br />

over “products:”<br />

A OR .B AND C / ! .A OR B/ AND .A OR C /<br />

(distributivity of OR over AND)<br />

(3.10)<br />

Three more axioms that don’t directly correspond to number properties are<br />

A AND A ! A<br />

(idempotence <strong>for</strong> AND)<br />

A AND A ! F (contradiction <strong>for</strong> AND) (3.11)<br />

NOT.A/ ! A (double negation) (3.12)<br />

There are a corresponding set of equivalences <strong>for</strong> OR which we won’t bother to<br />

list, except <strong>for</strong> the OR rule corresponding to contradiction <strong>for</strong> AND (3.11):<br />

A OR A ! T (validity <strong>for</strong> OR) (3.13)<br />

Finally, there are DeMorgan’s Laws which explain how to distribute NOT’s over<br />

AND’s and OR’s:<br />

NOT.A AND B/ ! A OR B (DeMorgan <strong>for</strong> AND) (3.14)<br />

NOT.A OR B/ ! A AND B (DeMorgan <strong>for</strong> OR) (3.15)<br />

All of these axioms can be verified easily with truth tables.<br />

These axioms are all that’s needed to convert any <strong>for</strong>mula to a disjunctive normal<br />

<strong>for</strong>m. We can illustrate how they work by applying them to turn the negation of<br />

<strong>for</strong>mula (3.5),<br />

NOT..A AND B/ OR .A AND C //: (3.16)<br />

into disjunctive normal <strong>for</strong>m.<br />

We start by applying DeMorgan’s Law <strong>for</strong> OR (3.15) to (3.16) in order to move<br />

the NOT deeper into the <strong>for</strong>mula. This gives<br />

NOT.A AND B/ AND NOT.A AND C /:<br />

Now applying DeMorgan’s Law <strong>for</strong> AND (3.14) to the two innermost AND-terms,<br />

gives<br />

.A OR B/ AND .A OR C /: (3.17)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!