Is $g(x_0, \dots, x_{n-1})$ a function of $n$ or $n-1$ variables?

84 Views Asked by At

A boolean function of $n$ variables is a map \begin{align} &f : \{0,1\}^n \rightarrow \{0,1\} \tag 1\\ &(x_1, \dots, x_n) \mapsto f(x_1, \dots, x_n) \tag 2 \end{align} where $n= 1, 2, \dots$.

If $n=1$ I have $f: \{0,1\}\rightarrow \{0,1\}$.

So far so good. Feel free to correct me if the above is wrong in some way.

My main problem:

I want the variables to start from $0$ instead of $1$, i.e. $(x_0, \dots, x_{n-1})$, for the map \begin{align} &g : \{0,1\}^? \rightarrow \{0,1\}\tag 3\\ &(x_0, \dots, x_{n-1}) \mapsto g(x_0, \dots, x_{n-1}) \tag 4 \end{align} I guess $n=0, 1, \dots $ (or something else?).

My question: What is "?" in $(3)$, is it still $n$?

But $n=0$ gives $g: \{0,1\}^0 \rightarrow \{0,1\}$, which doesn't make sense (I want the same result as in $(1)$ and $(2)$).

3

There are 3 best solutions below

0
On

The names of the variables are not part of the function's type. You could write a function of three variables as $f(x_1, x_2, x_3)$, $f(x_0, x_1, x_2)$, or $f(x,y,z)$; it's still a function $f:A^3\to B$.

The "where $n=1,2,3,\dots$" isn't referring to the variable names. It's saying "this definition applies to any natural number $n$". So they've defined what it means to be a function of 1 variable, what it means to be a function of 2 variables, and so on.

0
On

$ \{ 0,1 \}^n $ is an n-fold Cartesian product for the set of all possible tuples of 0,1 digits of length $n$. For example $ \{0,1\}^8 $ is the set of all possible computer bytes.

Note that the total number of tuples, a.k.a the cardinal of the set, is $ \operatorname{card} \{ 0,1 \}^n = \left( \operatorname{card} \{ 0,1 \} \right)^n = 2^n $.

Variables in mathematics are "silent" in the sense that we can always substitute a different notation. Since the notations $ (x_1, \cdots, x_n) $ and $ (x_0, \cdots, x_{n-1}) $ both correspond to a tuple of $ n $ numbers, the specific answer to your question is that $f: \{ 0,1 \}^n \to \{ 0, 1\} $ is the correct notation for your function regardless of how you choose to denote the tuple of $n$ variables.

0
On

If you want to "join" the $n$-tuple $$(x_{0},\dots,x_{n-1})$$ to the map $$g:\{0,1\}^{n}\to \{0,1\}$$ by their index. Just note that the last value of the index in the $n$-tuple is $n-1$ while the map has an index $n$. Three concrete examples for maps and index are;

for $n = 1$: $$g :\{0,1\}^{\color{red}{1}} \to\{0,1\} \ \text{and} \ (x_{\color{red}{1}-1})$$ for $n = 2$: $$g:\{0,1\}^{\color{red}{2}}\to \{0,1\} \ \text{and} \ (x_{0},x_{\color{red}{2}-1})$$ for $n = 3$: $$g:\{0,1\}^{\color{red}{3}}\to \{0,1\} \ \text{and} \ (x_{0},x_{1},x_{\color{red}{3}-1})$$ And more generally $$g:\{0,1\}^{\color{red}{n}} \to \{0,1\} \ \text{and} \ (x_{0},x_{1},\dots,x_{\color{red}{n}-1})$$