The number of switching functions of n variables is 22n.

To show this we first observe that, for any k, the number of different lists of length k of elements drawn from the set {0, 1} is 2k.

Each switching function is representable as a truth table. Each row of the truth table is a list of n elements from the set {0, 1}. There are thus 2n such rows.

A function is specified by giving a result value, either 0 or 1, for each row. Thus a function is specified by a list of 2n elements from the set {0, 1}. Taking k in our observation to be 2n, ihe number of different lists of this form is 2(2n).