Truth Table of $F(x, y)$
List all input combinations in standard binary order and denote the output values as $a_1, a_2, a_3, a_4$:
$$
\begin{array}{|c|c||c|}
\hline
x & y & F(x, y) \\
\hline
0 & 0 & a_1 \\
0 & 1 & a_2 \\
1 & 0 & a_3 \\
1 & 1 & a_4 \\
\hline
\end{array}
$$
Complement the Inputs and Evaluate $F$
Now construct a new column: for each row, complement both inputs and write the value of $F$ at that new input point.
$$
\begin{array}{|c|c||c|c|}
\hline
x & y & F(x, y) & F(\overline{x}, \overline{y}) \\
\hline
0 & 0 & a_1 & F(1, 1) = a_4 \\
0 & 1 & a_2 & F(1, 0) = a_3 \\
1 & 0 & a_3 & F(0, 1) = a_2 \\
1 & 1 & a_4 & F(0, 0) = a_1 \\
\hline
\end{array}
$$
Observe that the values in the fourth column are the values of $F$ in reverse order: $(a_4, a_3, a_2, a_1)$.
Step 3: Definition of the Dual Function
The dual of a Boolean function, $F^D(x, y)$, is defined by the following rule on any Boolean expression for $F$:
- Replace every OR ($+$) by AND ($\cdot$),
- Replace every AND ($\cdot$) by OR ($+$),
- Do not change any literals (i.e., $x$ remains $x$, not $\overline{x}$).
This is a purely syntactic transformation. However, to find the truth values of $F^D$, we do not need the expression we can use the following key observation.Consider what happens when we complement all literals in $F$ (i.e., replace $x$ with $\overline{x}$, $y$ with $\overline{y}$) and then complement the entire function output. This operation, $\overline{F(\overline{x}, \overline{y})}$, reverses the roles of AND and OR due to De Morgan’s laws:
- A product term $x \cdot y$ becomes $\overline{x} \cdot \overline{y}$; its complement is $\overline{\overline{x} \cdot \overline{y}} = x + y$.
- A sum term $x + y$ becomes $\overline{x} + \overline{y}$; its complement is $\overline{\overline{x} + \overline{y}} = x \cdot y$.
Thus, complementing all inputs and then complementing the output has the same effect as swapping AND and OR in the original expression, while leaving the original variables unchanged—which is exactly the definition of the dual.
Therefore, the truth table of $F^D$ is identical to that of $\overline{F(\overline{x}, \overline{y})}$.
Complete Truth Table with Dual Column
Now compute $\overline{F(\overline{x}, \overline{y})}$ by complementing the fourth column from Step 2:
$$
\begin{array}{|c|c||c|c|c|}
\hline
x & y & F(x, y) & F(\overline{x}, \overline{y}) & \overline{F(\overline{x}, \overline{y})} = F^D(x, y) \\
\hline
0 & 0 & a_1 & a_4 & \overline{a_4} \\
0 & 1 & a_2 & a_3 & \overline{a_3} \\
1 & 0 & a_3 & a_2 & \overline{a_2} \\
1 & 1 & a_4 & a_1 & \overline{a_1} \\
\hline
\end{array}
$$
Hence, we see explicitly that:
- $F^D(0,0) = \overline{a_4} = \overline{F(1,1)}$,
- $F^D(0,1) = \overline{a_3} = \overline{F(1,0)}$,
- $F^D(1,0) = \overline{a_2} = \overline{F(0,1)}$,
- $F^D(1,1) = \overline{a_1} = \overline{F(0,0)}$.
This confirms the identity:
$$
F^D(x, y) = \overline{F(\overline{x}, \overline{y})}.
$$
Self-Duality Condition
A function is self-dual if $F(x, y) = F^D(x, y)$ for all inputs. From the table, this requires:
$$
\begin{aligned}
a_1 &= \overline{a_4}, \\
a_2 &= \overline{a_3}.
\end{aligned}
$$
Thus, only $a_1$ and $a_2$ can be chosen freely; $a_3$ and $a_4$ are then determined. This gives $2^2 = 4$ self-dual functions for $n = 2$.For $n$ variables, the $2^n$ input combinations form $2^{n-1}$ pairs $(\mathbf{x}, \overline{\mathbf{x}})$. Self-duality imposes one constraint per pair, leaving $2^{n-1}$ independent binary choices. Hence, the total number of self-dual Boolean functions of $n$ variables is:
$$
\color{lime} \boxed{2^{2^{\,n-1}}}
$$