0% found this document useful (0 votes)
13 views

Slide DicreteMath

The document provides an introduction to Boolean algebra including: - Defining Boolean expressions and Boolean functions - Explaining the operations of complementation, Boolean sum, and Boolean product - Stating there are 16 different Boolean functions of degree two - Representing Boolean functions graphically using an n-cube

Uploaded by

duygiodalonroi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Slide DicreteMath

The document provides an introduction to Boolean algebra including: - Defining Boolean expressions and Boolean functions - Explaining the operations of complementation, Boolean sum, and Boolean product - Stating there are 16 different Boolean functions of degree two - Representing Boolean functions graphically using an n-cube

Uploaded by

duygiodalonroi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

Objectives

In this lecture, you learn


introduction to Boolean algebra.
to comprehend Boolean expressions and Boolean functions.
to understand identities of Boolean algebra.
the duality principle.
the abstract definition of a Boolean algebra.

BTEC – Pearson Discrete Maths Lecture 11 2 / 32


Table of Contents

1 Boolean Functions
Introduction
Boolean Expressions and Boolean Functions
Identities of Boolean Algebra
Duality
The Abstract Definition of a Boolean Algebra

BTEC – Pearson Discrete Maths Lecture 11 3 / 32


Introduction
Boolean algebra provides the operations and the rules for working with the set {0, 1}.
Electronic and optical switches can be studied using this set and the rules of Boolean algebra.
The three operations in Boolean algebra that we will use most are complementation, the
Boolean sum, and the Boolean product.
The complement of an element, denoted with a bar, is defined by

1=0 and 0 = 1.

The Boolean sum, denoted by + or by OR, has the following values

1 + 1 = 1, 1 + 0 = 1, 0 + 1 = 1, 0 + 0 = 0.

The Boolean product, denoted by · or by AN D, has the following values

1 · 1 = 1, 1 · 0 = 0, 0 · 1 = 0, 0 · 0 = 0.
BTEC – Pearson Discrete Maths Lecture 11 4 / 32
Note
When there is no danger of confusion, the symbol · can be deleted, just as in writing
algebraic products.
Unless parentheses are used, the rules of precedence for Boolean operators are
1 all complements are computed,
2 all Boolean products,
3 all Boolean sums.

BTEC – Pearson Discrete Maths Lecture 11 5 / 32


Example
Find the value of
1 · 0 + (0 + 1).

Solution. Using the definitions of complementation, the Boolean sum, and the Boolean
product, it follows that

1 · 0 + (0 + 1) = 0 + 1
=0+0
= 0.

BTEC – Pearson Discrete Maths Lecture 11 6 / 32


Quiz
Find the value of
1 · 1 + (1 + 1) + 1.

BTEC – Pearson Discrete Maths Lecture 11 7 / 32


Note
The complement, Boolean sum, and Boolean product correspond to the logical operators,
¬, ∨, and ∧, respectively, where 0 corresponds to F (false) and 1 corresponds to T (true).
Equalities in Boolean algebra can be directly translated into equivalences of compound
propositions.
Conversely, equivalences of compound propositions can be translated into equalities in
Boolean algebra.

BTEC – Pearson Discrete Maths Lecture 11 8 / 32


Example
Translate 1 · 0 + (0 + 1) = 0 into a logical equivalence.
Solution. We obtain a logical equivalence when we translate
each 1 into a T ,
each 0 into an F ,
each Boolean sum into a ∨,
each Boolean product into a ∧,
each complementation into a ¬.
It follows that
(T ∧ F ) ∨ ¬(T ∨ F ) ≡ F.

BTEC – Pearson Discrete Maths Lecture 11 9 / 32


Example
Translate the logical equivalence (T ∧ T ) ∨ ¬F ≡ T into an identity in Boolean algebra.
Solution. We obtain an identity in Boolean algebra when we translate
each T into a 1,
each F into a 0,
each ∨ into a Boolean sum, +,
each ∧ into a Boolean product, ·,
each ¬ into a complementation.
It follows that
(1 · 1) + 0 = 1.

BTEC – Pearson Discrete Maths Lecture 11 10 / 32


Quiz
1 Translate 0 · 1 + (1 + 0) = 0 into a logical equivalence.
2 Translate the logical equivalence (T ∧ F ) ∨ ¬T ≡ F into an identity in Boolean algebra.

BTEC – Pearson Discrete Maths Lecture 11 11 / 32


Boolean Expressions and Boolean Functions

Let B = {0, 1}. Then,

B n = {(x1 , x2 , . . . , xn )|xi ∈ B for 1 ≤ i ≤ n}

is the set of all possible n-tuples of 0s and 1s.


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

BTEC – Pearson Discrete Maths Lecture 11 12 / 32


Example
The function F (x, y) = xy from the set of ordered pairs of Boolean variables to the set {0, 1}
is a Boolean function of degree 2 with

F (1, 1) = 0, F (1, 0) = 1, F (0, 1) = 0, F (0, 0) = 0.

We display these values of F in the following table.

x y F (x, y)
1 1 0
1 0 1
0 1 0
0 0 0

BTEC – Pearson Discrete Maths Lecture 11 13 / 32


Quiz
Determine the values of the function F (x, y) = x̄ȳ from the set of ordered pairs of Boolean
variables to the set {0, 1}.

BTEC – Pearson Discrete Maths Lecture 11 14 / 32


Boolean functions can be represented using expressions made up from variables and Boolean
operations.
The Boolean expressions in the variables x1 , x2 , . . . , xn are defined recursively as

0, 1, x1 , x2 , . . . , xn

are Boolean expressions.


If E1 and E2 are Boolean expressions, then

E1 , (E1 E2 ), and (E1 + E2 )

are Boolean expressions.


Note
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.
Every Boolean function can be represented by a Boolean expression.
BTEC – Pearson Discrete Maths Lecture 11 15 / 32
Example
Find the values of the Boolean function represented by F (x, y, z) = xy + z.
Solution. The values of this function are displayed in the following table.

x y z xy z F (x, y, z) = xy + z
1 1 1 1 0 1
1 1 0 1 1 1
1 0 1 0 0 0
1 0 0 0 1 1
0 1 1 0 0 0
0 1 0 0 1 1
0 0 1 0 0 0
0 0 0 0 1 1

BTEC – Pearson Discrete Maths Lecture 11 16 / 32


Quiz
Find the values of the Boolean function represented by F (x, y, z) = xy + z.

BTEC – Pearson Discrete Maths Lecture 11 17 / 32


Note
We can represent a Boolean function graphically by distinguishing the vertices of the n-cube
that correspond to the n-tuples of bits where the function has value 1.

Example
The function F (x, y, z) = xy + z from B 3 to B in the above example can be represented by
distinguishing the vertices that correspond to the five 3-tuples
(1, 1, 1), (1, 1, 0), (1, 0, 0), (0, 1, 0), and (0, 0, 0),
where F (x, y, z) = 1, as shown in the figure belows. These vertices are displayed using solid
black circles. 110 111

101
100

010 011

000 001
BTEC – Pearson Discrete Maths Lecture 11 18 / 32
Boolean functions F and G of n variables are equal if and only if

F (b1 , b2 , . . . , bn ) = G(b1 , b2 , . . . , bn )

whenever b1 , b2 , . . . , bn belong to B. Two different Boolean expressions that represent the


same function are called equivalent.
Example: The Boolean expressions xy, xy + 0, and xy · 1 are equivalent.
The complement of the Boolean function F is the function F , where

F (x1 , . . . , xn ) = F (x1 , . . . , xn ).
Let F and G be Boolean functions of degree n. Then,
the Boolean sum F + G is defined by

(F + G)(x1 , . . . , xn ) = F (x1 , . . . , xn ) + G(x1 , . . . , xn ),

the Boolean product F G is defined as

(F G)(x1 , . . . , xn ) = F (x1 , . . . , xn )G(x1 , . . . , xn ).


BTEC – Pearson Discrete Maths Lecture 11 19 / 32
How many different Boolean functions of degree 2 are there?
A Boolean function of degree two is a function from a set with four elements, namely, pairs of
elements from B = {0, 1}, to B, a set with two elements. Hence, there are 16 different
Boolean functions of degree 2.

In the following table, we display the values of the 16 different Boolean functions of degree
two, labeled F1 , F2 , . . . , F16 .

The 16 Boolean Functions of Degree Two


x y F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 F13 F14 F15 F16
1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
1 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0
0 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0
0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0

BTEC – Pearson Discrete Maths Lecture 11 20 / 32


How many different Boolean functions of degree n are there?
From the product rule for counting, it follows that there are 2n different n-tuples of 0s and 1s.
Because a Boolean function is an assignment of 0 or 1 to each of these 2n different n-tuples,
n
the product rule shows that there are 22 different Boolean functions of degree n.

The following table displays the number of different Boolean functions of degrees one through
six. The number of such functions grows extremely rapidly.
The Number of Boolean Functions of Degree n
Degree N umber
1 4
2 16
3 256
4 65, 536
5 4, 294, 967, 296
6 18, 446, 744, 073, 709, 551, 616
BTEC – Pearson Discrete Maths Lecture 11 21 / 32
Quiz
How many different Boolean functions are there of degree 7?

BTEC – Pearson Discrete Maths Lecture 11 22 / 32


Identities of Boolean Algebra

TABLE Boolean Identities


Identity Name
x=x Law of the double complement
x+x=x Idempotent laws
x·x=x
x+0=x Identity laws
x·1=x
x+1=1 Domination laws
x·0=0
x+y =y+x Commutative laws
xy = yx

BTEC – Pearson Discrete Maths Lecture 11 23 / 32


TABLE Boolean Identities
Identity Name
x + (y + z) = (x + y) + z Associative laws
x(yz) = (xy)z
x + yz = (x + y)(x + z) Distributive laws
x(y + z) = xy + xz
xy = x + y De Morgan’s laws
(x + y) = xy
x + xy = x Absorption laws
x(x + y) = x
x+x=1 Unit property
xx = 0 Zero property

BTEC – Pearson Discrete Maths Lecture 11 24 / 32


Example
Show that the distributive law x(y + z) = xy + xz is valid.
Solution. The verification of this identity is shown in the table below. The identity holds
because the last two columns of the table agree.
Verifying One of the Distributive Laws
x y z y+z xy xz x(y + z) xy + xz
1 1 1 1 1 1 1 1
1 1 0 1 1 0 1 1
1 0 1 1 0 1 1 1
1 0 0 0 0 0 0 0
0 1 1 1 0 0 0 0
0 1 0 1 0 0 0 0
0 0 1 1 0 0 0 0
0 0 0 0 0 0 0 0
BTEC – Pearson Discrete Maths Lecture 11 25 / 32
Example
Prove the absorption law x(x + y) = x using the other identities of Boolean algebra.
Solution. We display steps used to derive this identity and the law used in each step:
x(x + y) = (x + 0)(x + y) Identity law for the Boolean sum
= x+0·y Distributive law of the Boolean sum over the Boolean product
= x+y·0 Commutative law for the Boolean product
= x+0 Domination law for the Boolean product
= x Identity law for the Boolean sum

Note
x(x + y) = x is called an absorption law because absorbing x + y into x leaves x unchanged.

BTEC – Pearson Discrete Maths Lecture 11 26 / 32


Quiz
Prove that (x + y)(x + z) = x + yz using the other identities of Boolean algebra.

BTEC – Pearson Discrete Maths Lecture 11 27 / 32


Duality

The identities in TABLE Boolean Identities come in pairs (except for the law of the double
complement and the unit and zero properties). To explain the relationship between the two
identities in each pair we use the concept of a dual. The dual of a Boolean expression is
obtained by interchanging Boolean sums and Boolean products and interchanging 0s and 1s.
Example
Find the duals of x(y + 0) and x · 1 + (y + z).
Solution. Interchanging · signs and + signs and interchanging 0s and 1s in these expressions
produces their duals. The duals are x + (y · 1) and (x + 0)(yz), respectively

BTEC – Pearson Discrete Maths Lecture 11 28 / 32


Duality Principle
The dual of a Boolean function F represented by a Boolean expression is the function
represented by the dual of this expression.
This dual function, denoted by F d , does not depend on the particular Boolean expression
used to represent F .
An identity between functions represented by Boolean expressions remains valid when the
duals of both sides of the identity are taken.
This result, called the duality principle, is useful for obtaining new identities.

Example
Construct an identity from the absorption law x(x + y) = x by taking duals.
Solution. Taking the duals of both sides of this identity produces the identity x + xy = x,
which is also called an absorption law and is shown in TABLE Boolean Identities.

BTEC – Pearson Discrete Maths Lecture 11 29 / 32


The Abstract Definition of a Boolean Algebra
Definition
A Boolean algebra is a set B with two binary operations ∨ and ∧, elements 0 and 1, and a
unary operation − such that these properties hold for all x, y, and z in B:
Identity laws
x ∨ 0 = x, x ∧ 1 = x.
Complement laws
x ∨ x = 1, x ∧ x = 0.
Commutative laws
x ∨ y = y ∨ x, x ∧ y = y ∧ x.
Associative laws
(x ∨ y) ∨ z = x ∨ (y ∨ z), (x ∧ y) ∧ z = x ∧ (y ∧ z).
Distributive laws
x ∨ (y ∧ z) = (x ∨ y) ∧ (x ∨ z), x ∧ (y ∨ z) = (x ∧ y) ∨ (x ∧ z).
BTEC – Pearson Discrete Maths Lecture 11 30 / 32
Summary

In this lecture, we have discussed


introduction to Boolean algebra.
the comprehension of Boolean expressions and Boolean functions.
understanding identities of Boolean algebra.
the duality principle.
the abstract definition of a Boolean algebra.

BTEC – Pearson Discrete Maths Lecture 11 31 / 32


Thank you!

BTEC – Pearson Discrete Maths Lecture 11 32 / 32

You might also like