Discrete Mathematics (boolean)

311 Views Asked by At

Either exhibit 333 different boolean functions on the three variables p; q; r, or prove that there aren’t 333 different such functions

$p$ $q$ $r$

$0 0 0$

$001$

$010$

$011$

$100$

$101$

$110$

$111$

$f(0,0,0)$ :

$2^8= 256$

$333 not equalto 256$

Can I ask for a feed back on my answer please? thanks

3

There are 3 best solutions below

8
On

There are $2^{3}$ possible inputs in $B^{3}$, where $B = \{0, 1\}$. Each input can map to an element in $\{0, 1\}$. So there are $2^{8}$ possible boolean functions, as there are $2^{2^{3}}$ possible functions.

1
On

Of course there are 256 of them; your original reasoning is correct. Notice that there are $2 = 2^{2^0}$ functions of 0 variables ($ \equiv 0$ and $\equiv 1$). There are $4 = 2^{2^1}$ functions of 1 variable ($ \equiv 0$, $x$, $ \lnot x$ and $\equiv 1$), $16 = 2^{2^2}$ functions of 2 variables (shall I list them?)...

This gives an inductive base to assume that there are $S_n = 2^{2^n}$ functions of $n$ variables. Since a function of $n+1$ variable is a pair of functions of $n$ variables (one with $x_{n+1} = 0$ and another with $x_{n+1} = 1$ we may conclude that $S_{n+1} = S_n ^2$, which completes the induction.

2
On

what he's saying is that there are only 256 Boolean functions for the variables p,q,r such that for every variable there is only 2 constants, 0 and 1, which is 2^3, and lets just say for function g:(p,q,r) can only ever return only 0 and 1, therefore g:(p,q,r) is 2:2^3 which is 2^8 = 256!