Number of Boolean functions (original) (raw)

Last Updated : 6 Sep, 2025

A Boolean function is a mathematical function that takes one or more Boolean variables (each representing a binary value: true or false, 1 or 0) as input and produces a Boolean output (either true or false). It maps a set of Boolean variables to a single Boolean value.

**For example:

**AND Function f(x1, x2) = x1 ∧ x2

x₁ x₂ f(x₁,x₂)
0 0 0
0 1 0
1 0 0
1 1 1

Here, the function takes two Boolean variables (x1 and x2​) and outputs a result based on their combination.

Steps to Count Boolean Functions

The number of Boolean functions depends on the number of input variables.

**Step 1: Number of Inputs

A Boolean function with n variables has: 2n possible input combinations (since each variable can be either 0 or 1).

**Step 2: Output for Each Input Combination

For each of the 2n input combinations, the output can be either 0 or 1.

**Step 3: Total Number of Boolean Functions

Since there are 2n possible input combinations and each can independently map to 0 or 1, the total number of Boolean functions is:

Total Number of Boolean Functions =2^{2^{n}}

This formula gives the total number of distinct Boolean functions that can be defined for n input variables.

**Examples

**n = 1 variable:

**n = 2 variables:

**n = 3 variables:

Significance of Boolean Functions

The number of Boolean functions grows exponentially with the number of variables. This exponential growth is significant because it shows the vast number of ways Boolean functions can behave. These functions are crucial in: