$\{0, 1\}^n$ notation

2.3k Views Asked by At

Can anybody explain me what it means the following:

$\mathtt{for} \quad \mathbf{p} \quad \mathtt{in} \quad \{\{0, 1\}^k \setminus \mathbf{0}\} \quad \mathtt{do}$

See here https://cseweb.ucsd.edu/~pvoulgar/files/voronoi_full.pdf in Algorithm 3 (pag. 11). I'm trying to implement this on MatLab but I cannot understand that for-loop condition.

Thanks!

2

There are 2 best solutions below

2
On BEST ANSWER

$\{ 0,1 \}^k$ is the set of $k$-tuples comprised of $0$s and $1$s. For example with $k=2$ you have $\{ (0,0),(0,1),(1,0),(1,1) \}$. Your for loop would assign p to each of the last three elements (since it excludes the zero vector).

0
On

If $X$ and $Y$ are sets, then $X^Y$ denotes the set of functions from $Y$ to $X$. You can think of the elements of $X^Y$ as $Y-$sequences of elements of $X$. So, $\{0,1\}^n$ denotes the set of sequences of $1$'s and $0$'s of length $n$. $\mathbf 0$ denotes the sequence consisting entirely of $0$'s.