Consider any Boolean algebra of order 2, \([B; \lor, \land, - ]\text{.}\) How many functions \(f:B^2\to B\) are there? First, all Boolean algebras of order 2 are isomorphic to \(\left[B_2; \lor , \land, - \right]\) so we want to determine the number of functions \(f:B_2^2\to B_2\text{.}\) If we consider a Boolean function of two variables, \(x_1\) and \(x_2\text{,}\) we note that each variable has two possible values 0 and 1, so there are \(2^2\) ways of assigning these two values to the \(k=2\) variables. Hence, the table below has \(2^2=4\) rows. So far we have a table such as this one:
\begin{equation*}
\begin{array}{cc|c}
x_1 & x_2 & f\left(x_1,x_2\right) \\
\hline
0 & 0 & ?\\
0 & 1 & ?\\
1 & 0 & ?\\
1 & 1 & ?\\
\end{array}
\end{equation*}
How many possible different functions can there be? To list a few:\(f_1\left(x_1, x_2\right)=x_1\text{,}\) \(f_2\left(x_1,
x_2\right)=x_2\text{,}\) \(f_3\left(x_1, x_2\right)=x_1\lor x_2\text{,}\) \(f_4\left(x_1, x_2\right)=\left(x_1\land \overline{x_2}\right)\lor x_2\text{,}\) \(f_5\left(x_1,
x_2\right)= x_1\land x_2\lor \overline{x_2}\text{,}\) etc. Each of these will fill in the question marks in the table above. The tables for \(f_1\textrm{ }\) and \(f_3\) are
\begin{equation*}
\begin{array}{lr}
\begin{array}{cc|c}
x_1 & x_2 & f_1\left(x_1,x_2\right) \\
\hline
0 & 0 & 0\\
0 & 1 & 0\\
1 & 0 & 1\\
1 & 1 & 1\\
\end{array} &
\begin{array}{cc|c}
x_1 & x_2 & f_3\left(x_1,x_2\right) \\
\hline
0 & 0 & 0\\
0 & 1 & 1\\
1 & 0 & 1\\
1 & 1 & 1\\
\end{array}\\
\end{array}
\end{equation*}
Two functions are different if and only if their tables are different for at least one row. Of course by using the basic laws of Boolean algebra we can see that
\(f_3=f_4\text{.}\) Why? So if we simply list by brute force all βcombinationsβ of
\(x_1 \textrm{ and } x_2\) we will obtain unnecessary duplication. However, we note that for any combination of the variables
\(x_1\text{,}\) and
\(x_2\) there are only two possible values for
\(f\left(x_1, x_2\right)\text{,}\) namely 0 or 1. Thus, we could write
\(2^4=16\) different functions on 2 variables.