An ordering different from the Gray order (digits change by 1 at each step)

319 Views Asked by At

Given $A=\lbrace x_n,\ldots x_1\rbrace$. How would I construct an ordering on the subsets of $A$ such that the immediate successor of a subset is obtained by either adding or deleting one element, and the order is not a reflected Gray code, no matter how you re-index the elements of $A$?

Would this work for $n=3$? $\emptyset; \lbrace x_1\rbrace,\lbrace x_1,x_2\rbrace,A, \lbrace x_2,x_3 \rbrace \lbrace x_2\rbrace, \lbrace x_1, x_3\rbrace, \lbrace x_3\rbrace $? Does this idea of adding elements until I reach $A$, removing elements until I get back to singleton, increasing as much as I can after that, then decreasing work for larger $n$?

EDIT The reflected Gray code is defied inductively by

(1) the reflected Gray code of order $1$ is $0;1$.

(2) Suppose $n>1$ and the reflected Gray code of order $n-1$ has been constructed. To construct the reflected Gray code of order $n$, we first list the $(n-1)$-tuples of 0s and 1s in the order given by the reflected Gray code or order $n-1$, and attach a $0$ at the beginning (i.e. on the left) of each $(n-1)$-tuple. We then list the $(n-1)-$tuples in the order which is the reverse given by the reflected Gray code of order $n-1$, and attach a $1$ at the beginning.

1

There are 1 best solutions below

4
On BEST ANSWER

Let $A_n = \{x_1, x_2, \ldots, x_n\}$.

As Jyrki pointed out in the comments, your book's definition of a Gray code is actually a special case: the binary reflected Gray code. This construction always puts $00\cdots0$ at the start of the code and $10\cdots0$ at the end. If you cycle all elements of the code forward one position, you'll get something that isn't a binary reflected Gray code, but still has distance $1$ between subsequent codewords.

For example, the binary reflected Gray code of length 3 is $000,001,011,010,110,111,101,100$. Cycle those ahead one position to get $\underline{100},000,001,011,010,110,111,101$. Now use the usual bijection between length $n$ binary strings and subsets of a size $n$ set to get the order

$$ \{x_1\}; \emptyset; \{x_3\}; \{x_2,x_3\}; \{x_2\}; \{x_1,x_2\}; A_3; \{x_1,x_3\}. $$