What is the notation of a set of $n$ binary numbers where all of them are 0 except for one?

1.2k Views Asked by At

From this post I found out we can define a set of $n$ binary numbers mathematically like: $\mathbb Z_2^n$.

But what if I want to further restrict this set such that all the bits must be zero except for one? For example, elements of the set look like:

$$[1,0,0,\dotsc,0] \quad\text{or}\quad [0,1,0,0,\dotsc,0] \quad\text{or}\quad [0,0,\dotsc,0,1], \quad\text{etc.}$$

What would be mathematical notation for this restriction?

3

There are 3 best solutions below

0
On

I don't know of any formal notation for this, but the set you are describing is precisely the powers of $2$ up to $2^{n-1}$; i.e. $\{2^a\mid a\in\mathbb Z,0\le a<n\}$. If you refer to such sets regularly, you may denote them by $A_n$ or whatever notation is convenient for you.

0
On

You could see your sequences as words on the alphabet $\{0,1\}$. In this case, your set would be the language $0^*10^*$.

If you want to restrict to words of length $n$, just take the intersection with $\{0,1\}^n$. Another possible notation would be $$\{ u \in \{0,1\}^n \mid |u|_1 = 1 \}$$ where $|u|_1$ stands for the number of occurrences of $1$ in $u$.

0
On

In the question, the set $\mathbb{Z}_2^n$ is not endowed with any additional structure; it is simply a set of $n$-tuples. In this context, I am not sure that there is any standard notation for this set, though you could write it fairly cleanly using the Kronecker delta: the set of $n$-tuples that is zero everywhere except for one place is the set $$ \left\{ (\delta_{ij})_{j=1}^{n} \right\}_{i=1}^{n}. $$ Here, for each fixed value of $i$, the notation $(\delta_{ij})_{j=1}^{n}$ denotes an $n$-tuple in which the $j$-th entry is the value of $\delta_{ij}$, which is $$ \delta_{ij} = \begin{cases} 1 & \text{if $i=j$, and} \\ 0 & \text{if $i\ne j$.} \end{cases} $$ The set is then formed by taking the collection of all such $n$-tuples as $i$ ranges from $1$ to $n$. While this ought to be understood by most mathematicians (and/or computer scientists), I would still recommend that one explicitly define the notation the first time it is used—remember that the point of mathematical notation is to clearly communicate ideas.

On the other hand, if we are willing to assume that the set of tuples has some additional structure, then there are some other notations which might be understood (though, again, it can't hurt to describe them).

  • The space of all binary $n$-tuples forms a vector space over $\mathbb{F}_2$, the field with two elements. In that vector space, the set of vectors which are zero everywhere except for a single element is the canonical basis (or, perhaps, standard basis) for $\mathbb{F}_2^n$. The usual notation is to define $$ e_1 = (1, 0, 0, \dotsc, 0), \qquad e_2 = (0, 1, 0, \dotsc, 0), \qquad e_3 = (0, 0, 1, \dotsc, 0), $$ and so on. Thus the set of interest is $\{e_i\}_{i=1}^{n}$.

  • The space of all binary $n$-tuples forms a metric space with respect to the $\ell^1$ norm $\|\cdot\|_1$, which is defined by $$ \|(x_1, x_2, \dots, x_n)\|_1 = \sum_{i=1}^{n} |x_i|. $$ In this space, the set of tuples which are zero everywhere but one place is the unit sphere, which can be denoted by $$ S_{\ell^1}^n = \{ x \in \mathbb{Z}_2 : \|x\|_1 = 1 \}. $$ In the notation $S_{\ell^1}^n$, the superscripted $n$ specifies that the sphere is a subset of an $n$-dimensional space (i.e. it is a subset of a space of $n$-tuples), and the subscripted $\ell^1$ indicates that the sphere is with respect to the $\ell^1$-norm. Either notation can likely be dropped without causing any confusion (indeed, the subscripted $\ell^1$ is something I don't see very often), but, again, make sure to define your notation before you start using it).

  • It is perhaps worth noting that if the vector space and metric structures are combined, $\mathbb{F}_2^n$ becomes a topological vector space. In this space, the "distance" between two vectors is precisely the number of places in which they differ. This space is important in, for example, information theory. In this space, the set being considered is the standard $n$-simplex, $\Delta^n$. I'm not sure that this is a useful way of thinking of the set, but it isn't exactly wrong.