Search code examples
logicboolean-logic

Given 1 boolean input and N boolean outputs, how many different functions can be formed


A function accepts 1 input and has 2 outputs. The 1 input is T or F and N outputs are all either T or F. How many different functions can I create.

I got 2^(N + 1) but seems wrong. It might be 2^2^n. Not sure how to prove it


Solution

  • For a single output, there are four functions:

    F0(x) = 0
    F1(x) = 1
    F2(x) = x
    F3(x) = !x
    

    Accordingly, there are 4^N different functions with N outputs. Imagine a N-digit number with base 4.