1
$\begingroup$

I'd like to know the number of boolean functions on $N$ variables. There's a catch however: when a function can be obtained from another by permutating the variables, they should count only once. For example, $a\wedge b$ and $a\wedge c$ are the same (because we just swapped $b$ and $c$, assuming $N\ge 3$), but they are distinct from $\neg a\wedge b$ or $\neg(a\wedge b)$.

For $N=0,1,2$ there are $2,4,12$ such functions. I speculated the formula $$\prod_{k=0}^N\left[{N\choose k}+1\right]$$ which predicts $64$ and $700$ for $N=3,4$, but my computer simulation doesn't confirm that (counts $92$ and $8500$ respectively). However I'm sceptical about my simulation, because that sequence does not exist in OEIS.

So how many functions are there? Is my formula correct?

EDIT:

For $N=2$, with variables $a$ and $b$ we have the following functions: $true$, $false$, $a$, $\neg a$, $a\wedge b$, $\neg(a\wedge b)$, $a\vee b$, $\neg(a\vee b)$, $\neg a\wedge b$, $\neg a\vee b$, $a\otimes b$, $a\leftrightarrow b$. The following are duplicates: $b$, $\neg b$, $\neg b\wedge a$, $\neg b\vee a$. Counting those too would give the expected $2^{2^N}=16$.

  • 0
    What do you mean by "boolean function"?2017-02-21
  • 0
    @quasi $\{0,1\}^N\rightarrow\{0,1\}$2017-02-21
  • 0
    Can you show how you got 12 for N=2?2017-02-21

1 Answers 1

1

For $n = 0,1,2,3,4$, I get counts of $2,4,12,80,3984$, respectively.

An oeis lookup of the terms $2,4,12,80,3984$ confirms my result:

http://oeis.org/A003180