Discrete MathematicsBoolean Algebra and Logic Circuits1 of 3
Boolean Algebra and Logic Circuits · 1

Boolean Functions and Sum of Products Form

We often know exactly when we want a digital circuit or a logical rule to turn on, and we need a systematic way to turn that table of 0\zero{0}s and 1\one{1}s into an algebraic formula.

1

Counting Boolean Functions

A Boolean function takes inputs that can only be 0\zero{0} or 1\one{1} and produces an output that is also 0\zero{0} or 1\one{1}. Because there are only two choices for each input, we can list every possible input combination in a finite truth table and define the function completely by choosing a 0\zero{0} or a 1\one{1} for each row's output.

Boolean Functions and How Many Exist
1\htmlClass{lc-green}{1}
0\htmlClass{lc-orange}{0}
1\htmlClass{lc-green}{1}
0\htmlClass{lc-orange}{0}
ff
x\htmlClass{lc-blue}{x}
y\htmlClass{lc-pink}{y}
f(x,y)f(\htmlClass{lc-blue}{x}, \htmlClass{lc-pink}{y})
0\htmlClass{lc-orange}{0}
0\htmlClass{lc-orange}{0}
0\htmlClass{lc-orange}{0}
1\htmlClass{lc-green}{1}
1\htmlClass{lc-green}{1}
0\htmlClass{lc-orange}{0}
1\htmlClass{lc-green}{1}
1\htmlClass{lc-green}{1}
22=42^2 = \htmlClass{lc-green}{4}
rows\text{rows}
?\htmlClass{lc-mute}{?}
2 choices: 0 or 12\ \text{choices: } \htmlClass{lc-orange}{0} \text{ or } \htmlClass{lc-green}{1}
?\htmlClass{lc-mute}{?}
2 choices: 0 or 12\ \text{choices: } \htmlClass{lc-orange}{0} \text{ or } \htmlClass{lc-green}{1}
?\htmlClass{lc-mute}{?}
2 choices: 0 or 12\ \text{choices: } \htmlClass{lc-orange}{0} \text{ or } \htmlClass{lc-green}{1}
?\htmlClass{lc-mute}{?}
2 choices: 0 or 12\ \text{choices: } \htmlClass{lc-orange}{0} \text{ or } \htmlClass{lc-green}{1}
2⋅2⋅2⋅2=24=16 output columns2 \cdot 2 \cdot 2 \cdot 2 = 2^4 = \htmlClass{lc-green}{16}\ \text{output columns}
Text solution
Count the rows in the truth tableEach of the nn input switches has 22 possible states (0\zero{0} or 1\one{1}), so by the product rule we multiply 22 by itself nn times.
Number of rows\displaystyle \text{Number of rows} =2⋅2⋯2⏟n switches\displaystyle = \underbrace{2 \cdot 2 \cdots 2}_{n\text{ switches}} =2n\displaystyle = \howmany{2^n}
Count the possible output columnsEach of those 2n2^n rows independently gets an output of 0\zero{0} or 1\one{1}, so we multiply 22 choices across all 2n2^n rows.
Number of Boolean functions\displaystyle \text{Number of Boolean functions} =2⋅2⋯2⏟2n rows\displaystyle = \underbrace{2 \cdot 2 \cdots 2}_{2^n\text{ rows}} =2(2n)\displaystyle = \howmany{2^{(2^n)}}

In 2(2n)2^{(2^n)}, work from the top exponent down: for n=3n = 3 switches, first find the 23=82^3 = \howmany{8} rows, and then raise 22 to that number of rows to get 28=2562^8 = \howmany{256} functions.

2

Boolean Operations as Arithmetic

A truth table gives us the complete function, but we also want to write Boolean functions as algebraic expressions. We do this by writing the logic operations NOT, AND, and OR as arithmetic on 0\zero{0} and 1\one{1}.

Boolean Operations as Arithmetic
True→1\htmlClass{lc-green}{\text{True}} \to \htmlClass{lc-green}{1}
False→0\htmlClass{lc-orange}{\text{False}} \to \htmlClass{lc-orange}{0}
NOT\text{NOT}
¬x\neg \htmlClass{lc-blue}{x}
AND\text{AND}
x∧y\htmlClass{lc-blue}{x} \wedge \htmlClass{lc-pink}{y}
OR\text{OR}
x∨y\htmlClass{lc-blue}{x} \vee \htmlClass{lc-pink}{y}

Each operation has a distinct job when we plug in 0\zero{0}s and 1\one{1}s:

xˉ⏟flipper: swaps 0↔1x⋅y=xy⏟all-or-nothing detector: 1 only if all factors are 1x+y⏟collector: 1 if at least one term is 1\displaystyle \begin{gathered} \underbrace{\xvar{\bar{x}}}_{\text{flipper: swaps } \zero{0} \leftrightarrow \one{1}} \\ \underbrace{\xvar{x} \cdot \yvar{y} = \xvar{x}\yvar{y}}_{\text{all-or-nothing detector: } \one{1}\text{ only if all factors are } \one{1}} \\ \underbrace{\xvar{x} + \yvar{y}}_{\text{collector: } \one{1}\text{ if at least one term is } \one{1}} \end{gathered}

Boolean addition matches ordinary addition except when both inputs are 1\one{1}, where turning an already-lit bulb on again keeps it on:

1+1\displaystyle \one{1} + \one{1} =1\displaystyle = \one{1}
3

Building a Formula from a Truth Table

Now we want to go backwards: given any truth table, we want to write down a formula f(x,y,z)f(\xvar{x}, \yvar{y}, \zvar{z}) that produces that exact output column without guessing.

From a Truth Table to Sum of Products
x\htmlClass{lc-blue}{x}
y\htmlClass{lc-pink}{y}
z\htmlClass{lc-violet}{z}
ff
1000\mathclap{\htmlClass{lc-mute}{1}}\hspace{1.86em}\mathclap{\htmlClass{lc-orange}{0}}\hspace{1.86em}\mathclap{\htmlClass{lc-orange}{0}}\hspace{1.86em}\mathclap{\htmlClass{lc-orange}{0}}
2001\mathclap{\htmlClass{lc-mute}{2}}\hspace{1.86em}\mathclap{\htmlClass{lc-orange}{0}}\hspace{1.86em}\mathclap{\htmlClass{lc-orange}{0}}\hspace{1.86em}\mathclap{\htmlClass{lc-green}{1}}
3010\mathclap{\htmlClass{lc-mute}{3}}\hspace{1.86em}\mathclap{\htmlClass{lc-orange}{0}}\hspace{1.86em}\mathclap{\htmlClass{lc-green}{1}}\hspace{1.86em}\mathclap{\htmlClass{lc-orange}{0}}
4011\mathclap{\htmlClass{lc-mute}{4}}\hspace{1.86em}\mathclap{\htmlClass{lc-orange}{0}}\hspace{1.86em}\mathclap{\htmlClass{lc-green}{1}}\hspace{1.86em}\mathclap{\htmlClass{lc-green}{1}}
5100\mathclap{\htmlClass{lc-mute}{5}}\hspace{1.86em}\mathclap{\htmlClass{lc-green}{1}}\hspace{1.86em}\mathclap{\htmlClass{lc-orange}{0}}\hspace{1.86em}\mathclap{\htmlClass{lc-orange}{0}}
6101\mathclap{\htmlClass{lc-mute}{6}}\hspace{1.86em}\mathclap{\htmlClass{lc-green}{1}}\hspace{1.86em}\mathclap{\htmlClass{lc-orange}{0}}\hspace{1.86em}\mathclap{\htmlClass{lc-green}{1}}
7110\mathclap{\htmlClass{lc-mute}{7}}\hspace{1.86em}\mathclap{\htmlClass{lc-green}{1}}\hspace{1.86em}\mathclap{\htmlClass{lc-green}{1}}\hspace{1.86em}\mathclap{\htmlClass{lc-orange}{0}}
8111\mathclap{\htmlClass{lc-mute}{8}}\hspace{1.86em}\mathclap{\htmlClass{lc-green}{1}}\hspace{1.86em}\mathclap{\htmlClass{lc-green}{1}}\hspace{1.86em}\mathclap{\htmlClass{lc-green}{1}}
0\htmlClass{lc-orange}{0}
0\htmlClass{lc-orange}{0}
0\htmlClass{lc-orange}{0}
1\htmlClass{lc-green}{1}
0\htmlClass{lc-orange}{0}
1\htmlClass{lc-green}{1}
1\htmlClass{lc-green}{1}
1\htmlClass{lc-green}{1}
f(x,y,z)=?f(\htmlClass{lc-blue}{x}, \htmlClass{lc-pink}{y}, \htmlClass{lc-violet}{z}) = \htmlClass{lc-pink}{{?}}
Text solution
Pick out the winning rowsIn the three-judge majority table, find the rows where the output is 1\one{1}: (0,1,1)(\zero{0}, \one{1}, \one{1}), (1,0,1)(\one{1}, \zero{0}, \one{1}), (1,1,0)(\one{1}, \one{1}, \zero{0}), and (1,1,1)(\one{1}, \one{1}, \one{1}).
f(0,1,1)=1,f(1,0,1)=1,f(1,1,0)=1,f(1,1,1)=1\displaystyle \begin{aligned} f(\zero{0},\one{1},\one{1}) &= \one{1}, &\quad f(\one{1},\zero{0},\one{1}) &= \one{1}, \\ f(\one{1},\one{1},\zero{0}) &= \one{1}, &\quad f(\one{1},\one{1},\one{1}) &= \one{1} \end{aligned}
Build a single-row detector for each winning rowMultiply all three variables together and put a bar over every variable that is 0\zero{0} in that row, so plugging that row in makes every factor 1\one{1}.
(0,1,1)→xˉyz⏟minterm,(1,0,1)→xyˉz,(1,1,0)→xyzˉ,(1,1,1)→xyz\displaystyle \begin{aligned} (\zero{0}, \one{1}, \one{1}) &\rightarrow \underbrace{\xvar{\bar{x}}\yvar{y}\zvar{z}}_{\text{minterm}}, \\ (\one{1}, \zero{0}, \one{1}) &\rightarrow \xvar{x}\yvar{\bar{y}}\zvar{z}, \\ (\one{1}, \one{1}, \zero{0}) &\rightarrow \xvar{x}\yvar{y}\zvar{\bar{z}}, \\ (\one{1}, \one{1}, \one{1}) &\rightarrow \xvar{x}\yvar{y}\zvar{z} \end{aligned}
Add the detectors togetherCombine the minterms with ++ so the formula outputs 1\one{1} whenever the input matches any of the four winning rows and 0\zero{0} on the remaining rows.
f(x,y,z)\displaystyle f(\xvar{x}, \yvar{y}, \zvar{z}) =xˉyz+xyˉz+xyzˉ+xyz⏟Sum of Products form\displaystyle = \underbrace{\xvar{\bar{x}}\yvar{y}\zvar{z} + \xvar{x}\yvar{\bar{y}}\zvar{z} + \xvar{x}\yvar{y}\zvar{\bar{z}} + \xvar{x}\yvar{y}\zvar{z}}_{\text{Sum of Products form}}

An output column of all 0\zero{0}s has no winning rows and no detectors to add, so it simplifies to f(x,y,z)=0f(\xvar{x}, \yvar{y}, \zvar{z}) = \zero{0}.

Every 1\one{1} in the output column adds that row's detector to the sum, turning any truth table into its formula.
4

Expanding a Formula into Sum of Products

Sometimes we start with a short Boolean expression instead of a truth table and need its canonical Sum of Products form, where every product term is a complete minterm containing every variable.

Expanding a Formula into Sum of Products
f(x,y,z)\displaystyle f(\htmlClass{lc-blue}{x}, \htmlClass{lc-pink}{y}, \htmlClass{lc-violet}{z}) =(x+y)zˉ\displaystyle = (\htmlClass{lc-blue}{x} + \htmlClass{lc-pink}{y})\htmlClass{lc-violet}{\bar{z}}
canonical Sum of Products:\displaystyle \text{canonical Sum of Products:}
f(x,y,z)\displaystyle f(\htmlClass{lc-blue}{x}, \htmlClass{lc-pink}{y}, \htmlClass{lc-violet}{z}) =?\displaystyle = \htmlClass{lc-pink}{{?}}
Text solution
Distribute to get a sum of productsMultiply out the parentheses in f(x,y,z)=(x+y)zˉf(\xvar{x}, \yvar{y}, \zvar{z}) = (\xvar{x} + \yvar{y})\zvar{\bar{z}} just as in ordinary algebra.
f(x,y,z)=(x+y)zˉ=xzˉ+yzˉ\displaystyle \begin{aligned} f(\xvar{x}, \yvar{y}, \zvar{z}) &= (\xvar{x} + \yvar{y})\zvar{\bar{z}} \\ &= \xvar{x}\zvar{\bar{z}} + \yvar{y}\zvar{\bar{z}} \end{aligned}
Multiply each short term by (v+vˉ)(v + \bar{v}) for its missing variableBecause one of vv and vˉ\bar{v} is always 1\one{1} and the other is 0\zero{0}, v+vˉv + \bar{v} always equals 1\one{1}, so multiplying by it splits each two-variable term into the two full minterms it covers without changing the function.
f(x,y,z)=x(y+yˉ)zˉ+(x+xˉ)yzˉ=xyzˉ+xyˉzˉ+xyzˉ+xˉyzˉ\displaystyle \begin{aligned} f(\xvar{x}, \yvar{y}, \zvar{z}) &= \xvar{x}(\yvar{y} + \yvar{\bar{y}})\zvar{\bar{z}} \\ &\quad + (\xvar{x} + \xvar{\bar{x}})\yvar{y}\zvar{\bar{z}} \\ &= \xvar{x}\yvar{y}\zvar{\bar{z}} + \xvar{x}\yvar{\bar{y}}\zvar{\bar{z}} \\ &\quad + \dup{xy\bar{z}} + \xvar{\bar{x}}\yvar{y}\zvar{\bar{z}} \end{aligned}
Drop duplicate mintermsBecause 1+1=1\one{1} + \one{1} = \one{1} in Boolean addition, keeping two identical detectors for the same row is the same as keeping one, leaving the three winning rows (1,1,0)(\one{1}, \one{1}, \zero{0}), (1,0,0)(\one{1}, \zero{0}, \zero{0}), and (0,1,0)(\zero{0}, \one{1}, \zero{0}).
f(x,y,z)\displaystyle f(\xvar{x}, \yvar{y}, \zvar{z}) =xyzˉ+xyˉzˉ+xˉyzˉ\displaystyle = \xvar{x}\yvar{y}\zvar{\bar{z}} + \xvar{x}\yvar{\bar{y}}\zvar{\bar{z}} + \xvar{\bar{x}}\yvar{y}\zvar{\bar{z}}
Keeping a variable in a product term locks that input to one value, while leaving a variable out lets it take both values and doubles the number of rows that match.

Key concepts

A Boolean function of nn variables is defined by its truth table: nn switches give 2n\howmany{2^n} input rows, and choosing 0\zero{0} or 1\one{1} for each row's output gives 2(2n)\howmany{2^{(2^n)}} possible functions (so 33 variables give 23=82^3 = \howmany{8} rows and 28=2562^8 = \howmany{256} functions).

To turn a truth table into a Sum of Products formula, look only at the rows where the output is 1\one{1}. For each winning row, build a single-row detector (minterm) by multiplying all the variables together and barring the ones that are 0\zero{0} in that row (so (1,0,1)(\one{1}, \zero{0}, \one{1}) gets xyˉz\xvar{x}\yvar{\bar{y}}\zvar{z}), and add those detectors with ++. If every row in the table has output 0\zero{0}, there are no detectors to add and the function is simply f=0f = \zero{0}.

To expand a short formula like (x+y)zˉ(\xvar{x} + \yvar{y})\zvar{\bar{z}} into canonical Sum of Products form, distribute first to get a sum of products (xzˉ+yzˉ\xvar{x}\zvar{\bar{z}} + \yvar{y}\zvar{\bar{z}}), multiply any term missing a variable vv by (v+vˉ)(v + \bar{v}) to split it into full minterms, and drop any duplicate terms using 1+1=1\one{1} + \one{1} = \one{1}. If a product term in the sum already contains every variable (like xˉyzˉ\xvar{\bar{x}}\yvar{y}\zvar{\bar{z}}), leave it alone because it is already a single-row detector.

5

Practice

1

Write the minterm (single-row detector) in the four variables w,x,y,zw, \xvar{x}, \yvar{y}, \zvar{z} that outputs 1\one{1} only for the row (w,x,y,z)=(0,1,0,1)(w, \xvar{x}, \yvar{y}, \zvar{z}) = (\zero{0}, \one{1}, \zero{0}, \one{1}). Then give the single row (w,x,y,z)(w, \xvar{x}, \yvar{y}, \zvar{z}) for which the minterm wxyˉzˉw\xvar{x}\yvar{\bar{y}}\zvar{\bar{z}} outputs 1\one{1}.

Every factor in the product must evaluate to 1\one{1} at the target row; which variables need a bar to become 1\one{1}?

For (0,1,0,1)(\zero{0}, \one{1}, \zero{0}, \one{1}), we need every factor to evaluate to 1\one{1}, so we put bars over the variables that are 0\zero{0} (ww and y\yvar{y}) and leave the variables that are 1\one{1} (x\xvar{x} and z\zvar{z}) unbarred. (A common slip is barring the 1\one{1}s instead of the 0\zero{0}s to get wxˉyzˉw\xvar{\bar{x}}\yvar{y}\zvar{\bar{z}}, which would evaluate to 0⋅0⋅0⋅0=0\zero{0} \cdot \zero{0} \cdot \zero{0} \cdot \zero{0} = \zero{0} on this row.) This gives the minterm wˉxyˉz\bar{w}\xvar{x}\yvar{\bar{y}}\zvar{z}. For wxyˉzˉw\xvar{x}\yvar{\bar{y}}\zvar{\bar{z}} to output 1\one{1}, the unbarred variables must be 1\one{1} and the barred variables must be 0\zero{0}, giving the row (1,1,0,0)(\one{1}, \one{1}, \zero{0}, \zero{0}).
2

A Boolean function f(x,y,z)f(\xvar{x}, \yvar{y}, \zvar{z}) has output 1\one{1} on the rows (0,0,1)(\zero{0}, \zero{0}, \one{1}), (0,1,0)(\zero{0}, \one{1}, \zero{0}), and (1,1,1)(\one{1}, \one{1}, \one{1}), and output 0\zero{0} on the other five rows. Write f(x,y,z)f(\xvar{x}, \yvar{y}, \zvar{z}) in Sum of Products form. What would the formula be if all eight rows had output 0\zero{0} instead?

Build one minterm for each of the three rows where f(x,y,z)=1f(\xvar{x}, \yvar{y}, \zvar{z}) = \one{1}, and think about how many detectors remain if no row outputs 1\one{1}.

Building a detector for each winning row by barring the 0\zero{0}s gives xˉyˉz\xvar{\bar{x}}\yvar{\bar{y}}\zvar{z} for (0,0,1)(\zero{0}, \zero{0}, \one{1}), xˉyzˉ\xvar{\bar{x}}\yvar{y}\zvar{\bar{z}} for (0,1,0)(\zero{0}, \one{1}, \zero{0}), and xyz\xvar{x}\yvar{y}\zvar{z} for (1,1,1)(\one{1}, \one{1}, \one{1}). (Be careful not to bar the 1\one{1}s, which would give xyzˉ+xyˉz+xˉyˉzˉ\xvar{x}\yvar{y}\zvar{\bar{z}} + \xvar{x}\yvar{\bar{y}}\zvar{z} + \xvar{\bar{x}}\yvar{\bar{y}}\zvar{\bar{z}} and turn on for the exact opposite inputs.) Adding the three detectors gives
f(x,y,z)\displaystyle f(\xvar{x}, \yvar{y}, \zvar{z}) =xˉyˉz+xˉyzˉ+xyz\displaystyle = \xvar{\bar{x}}\yvar{\bar{y}}\zvar{z} + \xvar{\bar{x}}\yvar{y}\zvar{\bar{z}} + \xvar{x}\yvar{y}\zvar{z}
If all eight rows had output 0\zero{0}, there would be no winning rows and no detectors to add, so f(x,y,z)=0f(\xvar{x}, \yvar{y}, \zvar{z}) = \zero{0}.
3

A hallway light controlled by three switches x,y,z\xvar{x}, \yvar{y}, \zvar{z} turns on (1\one{1}) whenever exactly one switch is on (1\one{1}), and stays off (0\zero{0}) otherwise. List the rows of the truth table where the light turns on and write the Boolean function f(x,y,z)f(\xvar{x}, \yvar{y}, \zvar{z}) in Sum of Products form.

First write down the three input triples (x,y,z)(\xvar{x}, \yvar{y}, \zvar{z}) that contain a single 1\one{1} and two 0\zero{0}s.

Among the 88 rows of the truth table, the rows with exactly one 1\one{1} are (0,0,1)(\zero{0}, \zero{0}, \one{1}), (0,1,0)(\zero{0}, \one{1}, \zero{0}), and (1,0,0)(\one{1}, \zero{0}, \zero{0}). (Don't just write x+y+z\xvar{x} + \yvar{y} + \zvar{z}; leaving off the bars checks whether at least one switch is on instead of forcing the other two switches to be off.) Writing the minterm for each of these three rows and adding them gives
f(x,y,z)\displaystyle f(\xvar{x}, \yvar{y}, \zvar{z}) =xˉyˉz+xˉyzˉ+xyˉzˉ\displaystyle = \xvar{\bar{x}}\yvar{\bar{y}}\zvar{z} + \xvar{\bar{x}}\yvar{y}\zvar{\bar{z}} + \xvar{x}\yvar{\bar{y}}\zvar{\bar{z}}
4

Find the canonical Sum of Products expansion of f(x,y,z)=(xˉ+z)yf(\xvar{x}, \yvar{y}, \zvar{z}) = (\xvar{\bar{x}} + \zvar{z})\yvar{y} algebraically, and list the rows (x,y,z)(\xvar{x}, \yvar{y}, \zvar{z}) where f(x,y,z)=1f(\xvar{x}, \yvar{y}, \zvar{z}) = \one{1}.

Distribute y\yvar{y} first, then check which variable is missing from each two-variable product term.

Distributing y\yvar{y} gives f(x,y,z)=xˉy+yzf(\xvar{x}, \yvar{y}, \zvar{z}) = \xvar{\bar{x}}\yvar{y} + \yvar{y}\zvar{z}. Multiply the first term by (z+zˉ)(\zvar{z} + \zvar{\bar{z}}) and the second term by (x+xˉ)(\xvar{x} + \xvar{\bar{x}}):
xˉy(z+zˉ)+(x+xˉ)yz=xˉyz+xˉyzˉ+xyz+xˉyz\displaystyle \begin{aligned} &\xvar{\bar{x}}\yvar{y}(\zvar{z} + \zvar{\bar{z}}) + (\xvar{x} + \xvar{\bar{x}})\yvar{y}\zvar{z} \\ &= \xvar{\bar{x}}\yvar{y}\zvar{z} + \xvar{\bar{x}}\yvar{y}\zvar{\bar{z}} + \xvar{x}\yvar{y}\zvar{z} + \dup{\bar{x}yz} \end{aligned}
(Don't combine the two copies of xˉyz\xvar{\bar{x}}\yvar{y}\zvar{z} into 2xˉyz2\xvar{\bar{x}}\yvar{y}\zvar{z} or leave both in the final answer: in Boolean addition, 1+1=1\one{1} + \one{1} = \one{1}, so we drop the duplicate.) This leaves
f(x,y,z)\displaystyle f(\xvar{x}, \yvar{y}, \zvar{z}) =xˉyz+xˉyzˉ+xyz\displaystyle = \xvar{\bar{x}}\yvar{y}\zvar{z} + \xvar{\bar{x}}\yvar{y}\zvar{\bar{z}} + \xvar{x}\yvar{y}\zvar{z}
Reading the three minterms gives the winning rows (0,1,1)(\zero{0}, \one{1}, \one{1}), (0,1,0)(\zero{0}, \one{1}, \zero{0}), and (1,1,1)(\one{1}, \one{1}, \one{1}).
5

Find the canonical Sum of Products expansion of the three-variable function f(x,y,z)=x+yˉzf(\xvar{x}, \yvar{y}, \zvar{z}) = \xvar{x} + \yvar{\bar{y}}\zvar{z}.

The term x\xvar{x} is missing two variables, so multiply it by (y+yˉ)(\yvar{y} + \yvar{\bar{y}}) and then by (z+zˉ)(\zvar{z} + \zvar{\bar{z}}) to split it across both missing variables.

Because x\xvar{x} is missing both y\yvar{y} and z\zvar{z}, we multiply it by the product (y+yˉ)(z+zˉ)(\yvar{y} + \yvar{\bar{y}})(\zvar{z} + \zvar{\bar{z}}):
x(y+yˉ)(z+zˉ)=(xy+xyˉ)(z+zˉ)=xyz+xyzˉ+xyˉz+xyˉzˉ\displaystyle \begin{aligned} \xvar{x}(\yvar{y} + \yvar{\bar{y}})(\zvar{z} + \zvar{\bar{z}}) &= (\xvar{x}\yvar{y} + \xvar{x}\yvar{\bar{y}})(\zvar{z} + \zvar{\bar{z}}) \\ &= \xvar{x}\yvar{y}\zvar{z} + \xvar{x}\yvar{y}\zvar{\bar{z}} \\ &\quad + \xvar{x}\yvar{\bar{y}}\zvar{z} + \xvar{x}\yvar{\bar{y}}\zvar{\bar{z}} \end{aligned}
(Make sure to multiply (y+yˉ)(\yvar{y} + \yvar{\bar{y}}) and (z+zˉ)(\zvar{z} + \zvar{\bar{z}}) rather than adding them as x(y+yˉ+z+zˉ)\xvar{x}(\yvar{y} + \yvar{\bar{y}} + \zvar{z} + \zvar{\bar{z}}), which would leave two-variable terms instead of full three-variable minterms.) Next, yˉz\yvar{\bar{y}}\zvar{z} is missing x\xvar{x}, so multiply it by (x+xˉ)(\xvar{x} + \xvar{\bar{x}}) to get (x+xˉ)yˉz=xyˉz+xˉyˉz(\xvar{x} + \xvar{\bar{x}})\yvar{\bar{y}}\zvar{z} = \xvar{x}\yvar{\bar{y}}\zvar{z} + \xvar{\bar{x}}\yvar{\bar{y}}\zvar{z}. Adding the two expansions and dropping the duplicate xyˉz\dup{x\bar{y}z} gives
f(x,y,z)=xyz+xyzˉ+xyˉz+xyˉzˉ+xˉyˉz\displaystyle \begin{aligned} f(\xvar{x}, \yvar{y}, \zvar{z}) &= \xvar{x}\yvar{y}\zvar{z} + \xvar{x}\yvar{y}\zvar{\bar{z}} + \xvar{x}\yvar{\bar{y}}\zvar{z} \\ &\quad + \xvar{x}\yvar{\bar{y}}\zvar{\bar{z}} + \xvar{\bar{x}}\yvar{\bar{y}}\zvar{z} \end{aligned}
6

How many rows are in the truth table of a 44-variable Boolean function f(w,x,y,z)f(w, \xvar{x}, \yvar{y}, \zvar{z}), how many different 44-variable Boolean functions exist in total, and how many of them satisfy both f(0,0,0,0)=0f(\zero{0}, \zero{0}, \zero{0}, \zero{0}) = \zero{0} and f(1,1,1,1)=1f(\one{1}, \one{1}, \one{1}, \one{1}) = \one{1}?

Count how many rows of the truth table still have a free choice of 0\zero{0} or 1\one{1} once those two rows are locked in.

With 44 variables, there are 24=162^4 = \howmany{16} rows in the truth table, and 22 choices per row gives 216=65,5362^{16} = \howmany{65{,}536} total Boolean functions. Fixing f(0,0,0,0)=0f(\zero{0}, \zero{0}, \zero{0}, \zero{0}) = \zero{0} and f(1,1,1,1)=1f(\one{1}, \one{1}, \one{1}, \one{1}) = \one{1} locks the output of 22 rows and leaves 22 choices (0\zero{0} or 1\one{1}) for each of the remaining 16−2=1416 - 2 = 14 rows. (Be careful not to subtract 22 from the total to get 65,53465{,}534, or subtract from the number of variables to get 24−2=42^{4-2} = 4.) Multiplying 22 choices across the 1414 free rows gives 214=16,3842^{14} = \howmany{16{,}384}.
7

Do f(x,y,z)=(x+yˉ)zf(\xvar{x}, \yvar{y}, \zvar{z}) = (\xvar{x} + \yvar{\bar{y}})\zvar{z} and g(x,y,z)=xz+xˉyˉzg(\xvar{x}, \yvar{y}, \zvar{z}) = \xvar{x}\zvar{z} + \xvar{\bar{x}}\yvar{\bar{y}}\zvar{z} represent the same Boolean function? Justify your answer by expanding both into canonical Sum of Products form.

Expand both expressions into full three-variable minterms and compare the resulting sums; notice that xˉyˉz\xvar{\bar{x}}\yvar{\bar{y}}\zvar{z} in gg already has all three variables.

For f(x,y,z)f(\xvar{x}, \yvar{y}, \zvar{z}), distributing z\zvar{z} gives xz+yˉz\xvar{x}\zvar{z} + \yvar{\bar{y}}\zvar{z}. (Don't stop here and conclude the functions are different just because yˉz\yvar{\bar{y}}\zvar{z} looks different from xˉyˉz\xvar{\bar{x}}\yvar{\bar{y}}\zvar{z}: two short expressions can look different and still cover the same rows.) Multiplying xz\xvar{x}\zvar{z} by (y+yˉ)(\yvar{y} + \yvar{\bar{y}}) and yˉz\yvar{\bar{y}}\zvar{z} by (x+xˉ)(\xvar{x} + \xvar{\bar{x}}) gives
f(x,y,z)=x(y+yˉ)z+(x+xˉ)yˉz=xyz+xyˉz+xyˉz+xˉyˉz=xyz+xyˉz+xˉyˉz\displaystyle \begin{aligned} f(\xvar{x}, \yvar{y}, \zvar{z}) &= \xvar{x}(\yvar{y} + \yvar{\bar{y}})\zvar{z} + (\xvar{x} + \xvar{\bar{x}})\yvar{\bar{y}}\zvar{z} \\ &= \xvar{x}\yvar{y}\zvar{z} + \xvar{x}\yvar{\bar{y}}\zvar{z} + \dup{x\bar{y}z} + \xvar{\bar{x}}\yvar{\bar{y}}\zvar{z} \\ &= \xvar{x}\yvar{y}\zvar{z} + \xvar{x}\yvar{\bar{y}}\zvar{z} + \xvar{\bar{x}}\yvar{\bar{y}}\zvar{z} \end{aligned}
For g(x,y,z)=xz+xˉyˉzg(\xvar{x}, \yvar{y}, \zvar{z}) = \xvar{x}\zvar{z} + \xvar{\bar{x}}\yvar{\bar{y}}\zvar{z}, the second term is already a full minterm, and multiplying xz\xvar{x}\zvar{z} by (y+yˉ)(\yvar{y} + \yvar{\bar{y}}) gives
g(x,y,z)=x(y+yˉ)z+xˉyˉz=xyz+xyˉz+xˉyˉz\displaystyle \begin{aligned} g(\xvar{x}, \yvar{y}, \zvar{z}) &= \xvar{x}(\yvar{y} + \yvar{\bar{y}})\zvar{z} + \xvar{\bar{x}}\yvar{\bar{y}}\zvar{z} \\ &= \xvar{x}\yvar{y}\zvar{z} + \xvar{x}\yvar{\bar{y}}\zvar{z} + \xvar{\bar{x}}\yvar{\bar{y}}\zvar{z} \end{aligned}
Because both functions have the exact same canonical Sum of Products expansion xyz+xyˉz+xˉyˉz\xvar{x}\yvar{y}\zvar{z} + \xvar{x}\yvar{\bar{y}}\zvar{z} + \xvar{\bar{x}}\yvar{\bar{y}}\zvar{z}, the answer is yes.