Lecture Notes
Semester 1
Discrete Mathematics
Lecture 8: Boolean Algebra

Lecture 8: Boolean Algebra

Based on Discrete Mathematics and Its Applications (opens in a new tab) by Kenneth H. Rosen, 7th Edition.


Boolean Operations

Remember, boolean is just a set of {0,1}\{0, 1\}. The three operations in boolean algebra are:

OperationSymbolNameSymbol in AlgebraExample
AND\landConjunction\cdot11=11 \cdot 1 = 1
OR\lorDisjunction++1+0=11 + 0 = 1
NOT¬\lnotNegationa\overline{a}1=0\overline{1} = 0

Example

Find the value of the following expression:

10+(0+1)1 \cdot 0 + \overline{(0 + 1)}

Solution: Using the definitions of the operations, we get:

10+(0+1)=0+1=0+0=0\begin{align*} 1 \cdot 0 + \overline{(0 + 1)} &= 0 + \overline{1} \\ &= 0 + 0 \\ &= 0 \end{align*}

Boolean Expressions

A boolean expression is a combination of boolean variables and boolean operations. For example, xy+zx \cdot y + \overline{z} is a boolean expression.

Boolean Functions

Let B={0,1}B = \{0, 1\} be the set of boolean values. Then, a boolean function f:BnBf: B^n \rightarrow B is a function that takes in nn boolean variables and returns a boolean value. BB is also denoted as Bn={(x1,x2,,xn)xiBB^n = \{ (x_1, x_2, \dots, x_n) \mid x_i \in B for 1in}1 \leq i \leq n \}. A function f:BnBf: B^n \rightarrow B is called a boolean function of degree nn.

Example

Find the values of the following boolean functions:

F(x,y,z)=xy+z F(x, y, z) = xy + \overline{z}

Solution: We can find the values of the function by plugging in all possible values of x,y,zx, y, z into a table represented below:

xxyyzzxyxyz\overline{z}xy+zxy + \overline{z}
000000001111
000011000000
001100001111
001111000000
110000001111
110011000000
111100111111
111111110011

n-cube representation

We can represent a boolean function of degree nn as an nn-cube. For example, the boolean function f(x,y,z)=xy+zf(x, y, z) = xy + \overline{z} can be represented as a cube with n3n^3 vertices

(0,0,0),(0,0,1),(0,1,0),(0,1,1),(1,0,0),(1,0,1),(1,1,0),(1,1,1)(0, 0, 0), (0, 0, 1), (0, 1, 0), (0, 1, 1), (1, 0, 0), (1, 0, 1), (1, 1, 0), (1, 1, 1)

The vertices that correspond to f(x,y,z)=1f(x, y, z) = 1 are

(0,0,0),(0,1,0),(1,0,0),(1,1,0),(1,1,1)(0, 0, 0), (0, 1, 0), (1, 0, 0), (1, 1, 0), (1, 1, 1)

Number of Boolean Functions

Suppose that we have nn different boolean variables. Each of these variables can take on two values, 00 or 11. Therefore, there are 2n2^n possible combinations of values for the nn variables. For each of these combinations, we can assign a value of 00 or 11. Therefore, there are 22n2^{2^n} possible boolean functions of degree nn.

Table below shows the number of boolean functions for different values of nn:

nnNumber of boolean functions
1144
221616
33256256
446553665536
5542949672964294967296

Identities of Boolean Algebra

i

The identity of boolean algebra operation is just other forms of truth values operation and set operations.

Duality

The dual of a boolean function ff is the function ff^* obtained by interchanging the operations \cdot and ++ and the constants 00 and 11 in ff. For example, the dual of f(x,y,z)=xy+zf(x, y, z) = xy + \overline{z} is f(x,y,z)=x+yzf^*(x, y, z) = x + \overline{y}z.

Exercises

  1. Find the sum-of-products expansion of the boolean function F(x1,x2,x3,x4,x5)F(x_1, x_2, x_3, x_4, x_5) that has the value 11 if and only if three or more of the variables x1,x2,x3,x4,x5x_1, x_2, x_3, x_4, x_5 have the value 11.

Representing Boolean Functions

Sum-of-products Expansions

Example

Find boolean expressions that represent the function F(x,y,z)F(x, y, z) and G(x,y,z)G(x, y, z) defined by the following tables:

xxyyzzF(x,y,z)F(x, y, z)G(x,y,z)G(x, y, z)
0000001100
0000110011
0011001100
0011110011
1100001100
1100110011
1111001100
1111110011

Solution: We can find the boolean expressions by looking at the rows where the function is 11 and then taking the product of the variables in the row. For example, for F(x,y,z)F(x, y, z), we have:

F(x,y,z)=xyz+xyz+xyz+xyzF(x, y, z) = \overline{x} \cdot \overline{y} \cdot \overline{z} + \overline{x} \cdot y \cdot \overline{z} + x \cdot \overline{y} \cdot \overline{z} + x \cdot y \cdot \overline{z}

Similarly, for G(x,y,z)G(x, y, z), we have:

G(x,y,z)=xyz+xyz+xyz+xyzG(x, y, z) = \overline{x} \cdot \overline{y} \cdot z + \overline{x} \cdot y \cdot z + x \cdot \overline{y} \cdot z + x \cdot y \cdot z

Actually, the F(x,y,z)F(x, y, z) is a function that determine whether the number of 11 in the input is even or odd. If the number of 11 is even, then the function is 11. Otherwise, the function is 00. The G(x,y,z)G(x, y, z) is a function that determine whether the number of 11 in the input is odd. If the number of 11 is odd, then the function is 11. Otherwise, the function is 00.

Minterm

A minterm is a product of literals in which each variable appears exactly once in either its complemented or uncomplemented form. For example, xyz\overline{x} \cdot y \cdot \overline{z} is a minterm. The minterm is also called standard product term.

Example

Find the minterm of the boolean function that takes 5 variables that return true if and only if the first, second, and fifth term are true.

Solution: The minterm is x1x2x3x4x5\overline{x_1} \cdot \overline{x_2} \cdot x_3 \cdot x_4 \cdot \overline{x_5}.

Logic Gates

Boolean algebra is used to model the circuitry of electronic devices.