37
Discrete Mathematics and Its Applications

Discrete Mathematics and Its Applications. The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

Embed Size (px)

Citation preview

Page 1: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

Discrete Mathematics and Its Applications

Page 2: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of logic.

Boole wrote a treatise on the subject in 1854, titled An Investigation of the Laws of Thought, on Which Are Founded the Mathematical Theories of Logic and Probabilities, which codified several rules of relationship between mathematical quantities limited to one of two possible values: true or false, 1 or 0.

His mathematical system became known as Boolean algebra.

INTRODUCTION

Page 3: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

All arithmetic operations performed with Boolean quantities have but one of two possible outcomes: either 1 or 0. There is no such thing as "2" or "-1" or "1/2" in the Boolean world.

It is a world in which all other possibilities are invalid by fiat. As one might guess, this is not the kind of math you want to use when balancing a checkbook or calculating current through a resistor.

However, Claude Shannon of MIT fame recognized how Boolean algebra could be applied to on-and-off circuits, where all signals are characterized as either "high" (1) or "low" (0). His 1938 thesis, titled A Symbolic Analysis of Relay and Switching Circuits, put Boole's theoretical work to use in a way Boole never could have imagined, giving us a powerful mathematical tool for designing and analyzing digital circuits. (http://www.databanker.org/Home/BoolAlg/tabid/53/Default.aspx)

Page 4: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

The rules of logic are used to design circuits and form the basis for Boolean algebra. The circuits in all electronic devices like computers have inputs that can be identified as either 1 or 0 to produce outputs labeled as 1s and 0s OR switches that are in ‘on’ or in ‘off’ position.

Boolean algebra provides the operations and the rules for working with the set {0,1}. The operation of a circuit is defined by a Boolean function that specifies the value of an output for each set of inputs. This function is built using Boolean expressions and operations.

Page 5: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

OPERATIONS IN BOOLEAN ALGEBRA COMPLEMENTATION

The complement of an element, denoted with a bar, is defined by:

BOOLEAN SUMThe Boolean sum, denoted by + or by OR, has the following values:

BOOLEAN PRODUCT

The Boolean product, denoted by or by AND, has the following values:

10 01

111 110 101 000

111 010 001 000

Page 6: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

Unless parentheses are used, all complements are computed first followed by Boolean products, then followed by all Boolean sums.

The complement, Boolean sum, and the Boolean product correspond to the logical operators , ,respectively where 0 is False and 1 is True.

Example: Find the value of .)10(01

,,

Rules of Precedence for Boolean Operators

Page 7: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

BOOLEAN FUNCTION

Let Then

is the set of all possible n-tuples of 0’s and 1’s. The variable is called a Boolean variable

if it assumes values only from B, i.e., if its only possible values are 0 and 1. A function from to is called a Boolean function of degree n.

}.1,0{B

niforBxxxxxBin

n 1:,,,,321

nB B

Page 8: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

Example: The function from the set of ordered pairs of Boolean variables to the set {0,1} is a Boolean function of

degree 2 with the values of as shown in the table.

1 1 01 0 10 1 00 0 0

yxyxF ),(

F

x y ),( yxF

Clearly,

0)0,0(;0)1,0(;1)0,1(;0)1,1( FFFF

Page 9: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

The Boolean expressions in the variables are defined recursively as

are Boolean expressions; if and are

Boolean expressions, then, and are Boolean expressions.

Each Boolean expression represents a Boolean function. The values of this function are obtained by substituting 0 and 1 for the variables in the expression.

nxxxx ,,,,

321

,1,0 nxxxx ,,,,

321

1E

2E

211, EEE

21EE

Page 10: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

Example: Find the values of the Boolean function represented by

1 1 1 1 0 11 1 0 1 1 11 0 1 0 0 01 0 0 0 1 10 1 1 0 0 00 1 0 0 1 10 0 1 0 0 00 0 0 0 1 1

zxyzyxF ),,(

x y z xy z zxy

Remark:Two different Boolean expressions that represent the same function are

equivalent. Examples: and are equivalent.,0, xyxy 1xy

Page 11: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

DUALITY and COMPLEMENT

The dual of a Boolean expression denoted by , is obtained by interchanging Boolean sums and Boolean products, and interchanging 0’s and 1’s. The dual of the function will be denoted by .

Example: Find the dual of and .

For , the dual is . For , the dual is .

The complement of the function is the function That is,

de

F dF

)0( yx

zyx 1)0( yx

1 yx zyx 1 zyx 0

F .F

),,,(),,(3,21,3,21 nn

xxxxFxxxxF

Page 12: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

IDENTITIES

1. Digital computers contain circuits that implement Boolean functions.

2. The simpler that we can make a Boolean function, the smaller the circuit that will result.Simpler circuits are cheaper to build, consume less

power, and run faster than complex circuits.

3. With this in mind, we always want to reduce our Boolean functions to their simplest form.

4. There are a number of Boolean identities that help us to do this.

Page 13: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

Most Boolean identities have an AND (product) form as well as an OR (sum) form. We give our identities using both forms.

Page 14: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

Remark: The above identities can be translated to logical equivalences about propositions and to identities about sets.

Page 15: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

We can use Boolean identities to simplify the function

as follows:

Page 16: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

Example: Find the complement of the function

Applying DeMorgan’s Laws,

OR, you can take the complement of the function by taking its dual, then complement each literal (a variable or its

complement).

Page 17: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

REPRESENTATION OF BOOLEAN FUNCTIONS

PROBLEM: Given the values of a Boolean function, how can a Boolean expression that represents this function be found?

Any Boolean function can be represented by a Boolean sum of Boolean products of the variables and their complements.

Example: Find Boolean expressions that represents functions and

which are given in the following table.

),,( zyxF),,( zyxG

1 1 1 0 01 1 0 0 11 0 1 1 01 0 0 0 00 1 1 0 00 1 0 0 10 0 1 0 00 0 0 0 0

x y z F G

Page 18: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

To represent , we need an expression that has the value 1. A combination of values of the variables for which the function has the value 1 leads to a Boolean product of the variables or their complements. From the table, has the value 1 when

and , and the value 0 otherwise. To form the Boolean product that has the value 1, is obtained. What about function ?

F

F

1zx 0yzyx

G

Page 19: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

CANONICAL FORMS of a Boolean Function

DEFINITION

A literal is a Boolean variable or its complement. A minterm is a Boolean product of n literals, with one literal for each variable. A minterm is the standard product.

A minterm has the value 1 for one and only combination of values of its variables.

Example: Find a minterm that equals 1 if and and equal 0 otherwise.

A minterm that has the value 1 is .

Given a Boolean function, a Boolean sum of Boolean products (minterms) or simply, sum of minterms, can be formed that has the value 1 when this Boolean function has the value 1, and has the value 0 when the function has the value 0.

031xx 1

542 xxx

54321xxxxx

Page 20: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

The minterms in this Boolean sum correspond to those combinations of values for which the function has the value 1. The sum of minterms that represents this function is called the sum-of-products expansion or the disjunctive normal form (DNF) of the Boolean function.

Example: Find the sum-of-products expansion for the function .

The sum-of-products expansion of the function can be done in two ways:

1. Use the Boolean identities to expand the product and simplify.

zyxzyxF )(),,(

zyxzyxF )(),,( zyzx zyzx 11

zyxxzyyx )()( zyxzxyzyxzxy

zyxzyxzxy

Page 21: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

2. Construct a table and form the Boolean sum of minterms that have the value 1.

Based on the table, the sum-of-terms expansion for the Boolean

function is .

1 1 1 1 0 01 1 0 1 1 11 0 1 1 0 01 0 0 1 1 10 1 1 1 0 00 1 0 1 1 110 0 1 0 0 00 0 0 0 1 0

x y z yx z zyx )(

zyxzyxzxyzyxF ),,(

Page 22: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

It is also possible to get a Boolean expression that represents a Boolean function by taking a Boolean product of Boolean sums (maxterms). The maxterms in this Boolean product correspond to those combinations of values for which the function has the value 0. The resulting expansion is called the product-of-sums expansion or the conjunctive normal form (CNF) of the function.

  A maxterm is the standard sum. A maxterm has the value 0 for one and only combination of values of its variables.

A minterm is the complement of a maxterm, and vice versa.

To get the CNF for : 1. Take the complement .2. Obtain the DNF for .3. Complement both sides of the DNF obtained in (2) .

 Boolean functions expressed as a sum of minterms (DNF) or

product of maxterms (CNF), are said to be in canonical form.

FF

F

Page 23: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

Minterms & Maxterms for 3 Binary Variables

Minterms Maxterms

x y z Term Term

0 0 0 x’y’z’ x+y+z

0 0 1 x’y’z x+y+z’

0 1 0 x’yz’ x+y’+z

0 1 1 x’yz x+y’+z’

1 0 0 xy’z’ x’+y+z

1 0 1 xy’z x’+y+z’

1 1 0 xyz’ x’+y’+z

1 1 1 xyz x’+y’+z’

Page 24: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

LOGIC GATES

1. Boolean Algebra is used to model circuitry of electronic devices.

2. Each circuit is designed using the rules of Boolean Algebra.

3. The basic elements of circuits are called gates.4. Each type of gate implements a Boolean operation.5. The circuits give output that depends only on the

input. 6. Circuits have no memory capabilities.7. These circuits are called combinational circuits or

gating networks and can be constructed using a combination of gates that may share inputs.

8. Each input (entering a gate) and each output (leaving a gate) of a circuit is a member of the set .

}1,0{

Page 25: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

Basic types of Gates

x F

0 1

1 0

Accepts the value of one Boolean variable as input and produces the

complement of this value as output.

Inverter or NOT Gate

Page 26: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

AND Gate

The inputs to this gate are 2 or more Boolean variables. The output is the

Boolean product of their values.

x y F

0 0 0

0 1 0

1 0 0

1 1 1

Page 27: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

OR Gate

The inputs to this gate are the values of 2 or more Boolean variables. The output is the Boolean sum of their

values.

x y F

0 0 0

0 1 1

1 0 1

1 1 1

Page 28: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

NAND Gate

x y F

0 0 1

0 1 1

1 0 1

1 1 0

Page 29: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

NOR Gate

x y F

0 0 1

0 1 1

1 0 1

1 1 0

Page 30: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

XOR Gate

x y F

0 0 0

0 1 1

1 0 1

1 1 0

Page 31: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

XNOR Gate

x y F

0 0 1

0 1 0

1 0 0

1 1 1

Page 32: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

Discrete Mathematical Structures: Theory and Applications

Page 33: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

Discrete Mathematical Structures: Theory and Applications

Page 34: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

Discrete Mathematical Structures: Theory and Applications

Page 35: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

Discrete Mathematical Structures: Theory and Applications

Page 36: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

Discrete Mathematical Structures: Theory and Applications

Page 37: Discrete Mathematics and Its Applications.  The English mathematician George Boole (1815-1864) sought to give symbolic form to Aristotle's system of

Examples1. Find two ways to draw the same circuit that produces the

output

2. Construct circuits that produce the following outputs:

a. b. c. 3. Construct a circuit using NAND gates only to produce the

following outputs.

a. b. c.

.yxxy

xyx )( )( zyx ))(( zyxzyx

x xy yx