<< Chapter < Page Chapter >> Page >
Representing Boolean functions in CNF and DNF.

Cnf, dnf,(enuff already!)

In high school algebra, you saw that while x 3 4 x and x x 2 x 2 are equivalent, the second form is particularly useful in letting you quickly know the roots of the equation.Similarly, in Boolean algebra there are certain canonicalnormalforms which have nice properties.

A formula in Conjunctive Normal Form , or CNF , is the conjunction of CNF clauses . Each clause is a formula of a simple form:a disjunction of possibly-negated propositions.

c a b is equivalent to a c b c . This latter formula is in CNF, since it is the conjunction ofdisjunctions, and each disjunction consists only of propositions and negated propositions.

The conjunctions and disjunctions need not be binary. The following formula is also is CNF.

a a b c b d e f

Note that its first clause is just one negated proposition. It is still appropriate to think of this as a disjunction, since .

Another format, Disjunctive Normal Form , or DNF is the dual of conjunctive normal form. A DNF formula is the disjunction of DNF clauses , each a conjunction of possibly-negated propositions.

a b c is equivalent to a b c which is in DNF: three disjunctions, each being a clause with only one term.(It also happens to be in CNFa single clause with three terms!) It is also equivalent to the more fleshed out DNF formulawhere we insist that each clause include all three variables. We end up with a formula that includes each possibleclause except a b c : That is, the formula a b c a b c a b c a b c a b c a b c a b c .

Electrical Engineering courses, coming from more of a circuit perspective, sometimes callCNF product-of-sums , and call DNF sum-of-products , based on , being analogous to +,*.

Any Boolean function can be represented in CNF and in DNF. One way to obtain CNF and DNF formulasis based upon the truth table for the function.

  • A DNF formula results from looking at a truth table, and focusing on the rows where the function is true:As if sayingI'm in this row, or in this row, or: For each row where the function is true,form a conjunction of the propositions. ( E.g. , for the row where a is , and b is , form a b .) Now, form the disjunction of all those conjunctions.
  • A CNF formula is the pessimistic approach, focusing on the rows where the function is false:I'm not in this row, and not in this row, and. For each row where the function is false,create a formula fornot in this row: ( E.g. , if in this row a is and b is form a b ; then notice that by DeMorgan's law, this is a b a disjunct. Now, form the conjunction of all those disjunctions.

Truth table example
a b c Unknown function

For CNF, the false rows give us the following five clauses:

  • a b c
  • a b c
  • a b c
  • a b c
  • a b c
and the full formula is the conjunction of these. Essentially, each clause rules out one row as being true.

For DNF, the true rows give us the following three clauses:

  • a b c
  • a b c
  • a b c
and the full formula is the disjunction of these. Essentially, each clause allows one row to be true.

This shows that, for any arbitrarily complicated WFF, we can find an equivalent WFF in CNF or DNF. These provide uswith two very regular and relatively uncomplicated forms to use.

The above example produced CNF and DNF formulas for a Boolean function, but they are not the simplest such formulas. For fun, can you find simpler ones?

  • CNF: a b a b c a b
  • DNF: a b a b c

Karnaugh maps are a general technique for finding minimal CNF and DNF formulas. They are most easily usedwhen only a small number of variables are involved. We won't worry about minimizing formulas ourselves, though.

Notation for dnf, cnf

Sometimes you'll see the form of CNF and DNF expressed in a notation with subscripts.

  • DNF is i i ,where each clause i is j j , where each is a propositional variable ( Prop ), or a negation of one ( Prop ).
  • CNF is i i , where each clause i is j j , where each is again a propositional variable ( Prop ), or a negation of one ( Prop ).
For example, in the CNF formula a b a b c a b we have 2 a b c within that clause we have 1 a .

One question this notation brings up:

  • What is the disjunction of a single clause? Well, it's reasonable to say that . Note that this is also equivalent to .
  • What is the disjunction of zero clauses? Well, if we start with and remove the , that leaves us with ! Alternately, imagine writing a function which takes a list of booleans,and returns the of all of themthe natural base case for this recursive list-processing program turns out to be . Indeed, this is the accepted definition of the empty disjunction.It follows from being the identity element for . Correspondingly, a conjunction of zero clauses is true.
Actually, that subscript notation above isn't quite correct: it forces each clause to be the same length, which isn't actually required for CNF or DNF.For fun, you can think about how to patch it up. (Hint: double-subscripting.)

Note that often one of these forms might be more concise than the other.Here are two equivalently verbose ways of encoding , in CNF and DNF respectively: a a b b z z is equivalent to a b c y z a b c y z a b c y z a b y z . The first version corresponds to enumerating the choices for each locationof a WaterWorld board; it has 26 two-variable clauses. This may seem like a lot, but compare it to the second version, whichcorresponds to enumerating all possible WaterWorld boards explicitly: it has all possible 26-variable clauses;there are 2 26 64 billion of them!

Questions & Answers

where we get a research paper on Nano chemistry....?
Maira Reply
nanopartical of organic/inorganic / physical chemistry , pdf / thesis / review
what are the products of Nano chemistry?
Maira Reply
There are lots of products of nano chemistry... Like nano coatings.....carbon fiber.. And lots of others..
Even nanotechnology is pretty much all about chemistry... Its the chemistry on quantum or atomic level
no nanotechnology is also a part of physics and maths it requires angle formulas and some pressure regarding concepts
Preparation and Applications of Nanomaterial for Drug Delivery
Hafiz Reply
Application of nanotechnology in medicine
what is variations in raman spectra for nanomaterials
Jyoti Reply
ya I also want to know the raman spectra
I only see partial conversation and what's the question here!
Crow Reply
what about nanotechnology for water purification
RAW Reply
please someone correct me if I'm wrong but I think one can use nanoparticles, specially silver nanoparticles for water treatment.
yes that's correct
I think
Nasa has use it in the 60's, copper as water purification in the moon travel.
nanocopper obvius
what is the stm
Brian Reply
is there industrial application of fullrenes. What is the method to prepare fullrene on large scale.?
industrial application...? mmm I think on the medical side as drug carrier, but you should go deeper on your research, I may be wrong
How we are making nano material?
what is a peer
What is meant by 'nano scale'?
What is STMs full form?
scanning tunneling microscope
how nano science is used for hydrophobicity
Do u think that Graphene and Fullrene fiber can be used to make Air Plane body structure the lightest and strongest. Rafiq
what is differents between GO and RGO?
what is simplest way to understand the applications of nano robots used to detect the cancer affected cell of human body.? How this robot is carried to required site of body cell.? what will be the carrier material and how can be detected that correct delivery of drug is done Rafiq
analytical skills graphene is prepared to kill any type viruses .
Any one who tell me about Preparation and application of Nanomaterial for drug Delivery
what is Nano technology ?
Bob Reply
write examples of Nano molecule?
The nanotechnology is as new science, to scale nanometric
nanotechnology is the study, desing, synthesis, manipulation and application of materials and functional systems through control of matter at nanoscale
Is there any normative that regulates the use of silver nanoparticles?
Damian Reply
what king of growth are you checking .?
What fields keep nano created devices from performing or assimulating ? Magnetic fields ? Are do they assimilate ?
Stoney Reply
why we need to study biomolecules, molecular biology in nanotechnology?
Adin Reply
yes I'm doing my masters in nanotechnology, we are being studying all these domains as well..
what school?
biomolecules are e building blocks of every organics and inorganic materials.
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get the best Algebra and trigonometry course in your pocket!

Source:  OpenStax, Pdf generation test course. OpenStax CNX. Dec 16, 2009 Download for free at http://legacy.cnx.org/content/col10278/1.5
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Pdf generation test course' conversation and receive update notifications?