Multiple choice general knowledge science & technology

The total number of possible boolean function involving 'n' boolean variable is?

  1. infinity

  2. n^n

  3. n^2

  4. 2^n

  5. 2^(2^n)

Reveal answer Fill a bubble to check yourself
E Correct answer
Explanation

For n boolean variables, each can be 0 or 1, so there are 2^n possible input combinations. A boolean function maps each input combination to an output (0 or 1), so for each of the 2^n inputs we have 2 choices, giving 2^(2^n) total functions. For example, with 2 variables we have 2^4=16 possible boolean functions.

AI explanation

A boolean function of n variables is a mapping from each of the 2^n rows of the truth table to a value in {0,1}. Since each of those 2^n rows can independently be assigned 0 or 1, the total number of distinct boolean functions is 2^(2^n). The value 2^n only counts the number of truth-table rows (input combinations), not the number of functions. The correct option 2^(2^n) was absent, so it has been added and marked correct; the previously marked 2^n is now incorrect.