“For a function with n inputs there are 2n rows in the truth table.”
I assume ‘2’ represents binary base 2. Is that what you’re referring to by “two values, 0 or 1”?
For binary two-variable functions, 2^2 = 4 combinations (00, 01, 10, 11)
For binary three-variable functions, 2^3 = 8 (000, 001, 010, 011, 100, 101, 110, 111)
The formula (base^n) works for other number bases.
For ternary two-variable functions, 3^2 = 9 (e.g. 00, 01, 02, 10, 11, 12, 20, 21, 22)
For decimal two-variable functions, 10^2 = 100 (00, 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11 … 97, 98, 99)
Getting the combinations in truth tables is normally done first. The book first explains truth tables as one of the ways to specify a Boolean function, providing an example of a three-variable format with eight combinations in Figure 1.1.
It then refers to the question of how many unique Boolean functions can be expressed on a given truth table format.
What’s the relationship between the combinations and the number of functions? Can the result of the first calculation (2^n) be input to the second? By looking at Figure 1.2, we see there are 16 functions on a binary, two-variable format that has 4 combinations.
In this example, the relationship appears to be: combinations^2 = number of functions (4^2 = 16). This agrees with the book formula (2^2^n) = 2^2^2 = 16. The 4-bit matrix in Figure 1.2 confirms 16 unique binary values representing 16 Boolean functions.
A binary three-variable format has 8 combinations^2 = 64, which also agrees with the book formula. 2^2^3 = 64.
However, when I make an 8-bit matrix, there are 256 unique results, starting with:
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1
0 0 0 0 0 0 1 0
0 0 0 0 0 0 1 1
0 0 0 0 0 1 0 0
and ending with:
1 1 1 1 1 0 1 1
1 1 1 1 1 1 0 0
1 1 1 1 1 1 0 1
1 1 1 1 1 1 1 0
1 1 1 1 1 1 1 1
(11111111 = 255)
How many Boolean functions can be used with a three variable format, 64 or 256?
This site indicates 256:
http://www.sdmath.com/math/boolean.html