You have two boxes, one is filled with 10 items and the other is empty. You are allowed to transfer items one at a time from one box to the other (transfers may to either way).
There are 2^10=1024 ways to split the items between the two boxes. Can you make all the ways without repetition using only the transfer rule described above?
The Gray code of representing numbers (http://en.wikipedia.org/wiki/Gray_code) was called by its inventor, Frank Gray, the reflected binary code. It is binary in the sense of having either a 1 or a 0 at every position and there's a 1-to-1 correspondence of such sequences with the natural numbers.
It has the property that in advancing from one integer to the next, exactly one of its digits is flipped from 0 to 1 or 1 to 0 (including a leading zero flipped to a 1 at times).
Here we use it to represent numbers from 0 to 1023. Starting with 0000000000 it goes through all possible combinations of zeros and ones summing to ten symbols, and only one changes at any given step, corresponding to the puzzle's switching an item from one box (the zero box) to the other (the 1 box) or vice versa. There are no repetitions of states due to the 1-to-1 correspondence with the different integers.
Putting the zero box on the right and the 1 box on the left and lettering our items a through j:
abcdefghij
j abcdefghi
ij abcdefgh
i abcdefghj
hi abcdefgj
hij abcdefg
hj abcdefgi
h abcdefgij
gh abcdefij
ghj abcdefi
ghij abcdef
ghi abcdefj
gi abcdefhj
gij abcdefh
gj abcdefhi
g abcdefhij
fg abcdehij
fgj abcdehi
fgij abcdeh
fgi abcdehj
fghi abcdej
fghij abcde
fghj abcdei
fgh abcdeij
fh abcdegij
fhj abcdegi
fhij abcdeg
fhi abcdegj
fi abcdeghj
fij abcdegh
fj abcdeghi
f abcdeghij
ef abcdghij
efj abcdghi
efij abcdgh
efi abcdghj
efhi abcdgj
efhij abcdg
efhj abcdgi
efh abcdgij
efgh abcdij
efghj abcdi
efghij abcd
efghi abcdj
efgi abcdhj
efgij abcdh
efgj abcdhi
efg abcdhij
eg abcdfhij
egj abcdfhi
egij abcdfh
egi abcdfhj
eghi abcdfj
eghij abcdf
eghj abcdfi
egh abcdfij
eh abcdfgij
ehj abcdfgi
ehij abcdfg
ehi abcdfgj
ei abcdfghj
eij abcdfgh
ej abcdfghi
e abcdfghij
de abcfghij
dej abcfghi
deij abcfgh
dei abcfghj
dehi abcfgj
dehij abcfg
dehj abcfgi
deh abcfgij
degh abcfij
deghj abcfi
deghij abcf
deghi abcfj
degi abcfhj
degij abcfh
degj abcfhi
deg abcfhij
defg abchij
defgj abchi
defgij abch
defgi abchj
defghi abcj
defghij abc
defghj abci
defgh abcij
defh abcgij
defhj abcgi
defhij abcg
defhi abcgj
defi abcghj
defij abcgh
defj abcghi
def abcghij
df abceghij
dfj abceghi
dfij abcegh
dfi abceghj
dfhi abcegj
dfhij abceg
dfhj abcegi
dfh abcegij
dfgh abceij
dfghj abcei
dfghij abce
dfghi abcej
dfgi abcehj
dfgij abceh
dfgj abcehi
dfg abcehij
dg abcefhij
dgj abcefhi
dgij abcefh
dgi abcefhj
dghi abcefj
dghij abcef
dghj abcefi
dgh abcefij
dh abcefgij
dhj abcefgi
dhij abcefg
dhi abcefgj
di abcefghj
dij abcefgh
dj abcefghi
d abcefghij
cd abefghij
cdj abefghi
cdij abefgh
cdi abefghj
cdhi abefgj
cdhij abefg
cdhj abefgi
cdh abefgij
cdgh abefij
cdghj abefi
cdghij abef
cdghi abefj
cdgi abefhj
cdgij abefh
cdgj abefhi
cdg abefhij
cdfg abehij
cdfgj abehi
cdfgij abeh
cdfgi abehj
cdfghi abej
cdfghij abe
cdfghj abei
cdfgh abeij
cdfh abegij
cdfhj abegi
cdfhij abeg
cdfhi abegj
cdfi abeghj
cdfij abegh
cdfj abeghi
cdf abeghij
cdef abghij
cdefj abghi
cdefij abgh
cdefi abghj
cdefhi abgj
cdefhij abg
cdefhj abgi
cdefh abgij
cdefgh abij
cdefghj abi
cdefghij ab
cdefghi abj
cdefgi abhj
cdefgij abh
cdefgj abhi
cdefg abhij
cdeg abfhij
cdegj abfhi
cdegij abfh
cdegi abfhj
cdeghi abfj
cdeghij abf
cdeghj abfi
cdegh abfij
cdeh abfgij
cdehj abfgi
cdehij abfg
cdehi abfgj
cdei abfghj
cdeij abfgh
cdej abfghi
cde abfghij
ce abdfghij
cej abdfghi
ceij abdfgh
cei abdfghj
cehi abdfgj
cehij abdfg
cehj abdfgi
ceh abdfgij
cegh abdfij
ceghj abdfi
ceghij abdf
ceghi abdfj
cegi abdfhj
cegij abdfh
cegj abdfhi
ceg abdfhij
cefg abdhij
cefgj abdhi
cefgij abdh
cefgi abdhj
cefghi abdj
cefghij abd
cefghj abdi
cefgh abdij
cefh abdgij
cefhj abdgi
cefhij abdg
cefhi abdgj
cefi abdghj
cefij abdgh
cefj abdghi
cef abdghij
cf abdeghij
cfj abdeghi
cfij abdegh
cfi abdeghj
cfhi abdegj
cfhij abdeg
cfhj abdegi
cfh abdegij
cfgh abdeij
cfghj abdei
cfghij abde
cfghi abdej
cfgi abdehj
cfgij abdeh
cfgj abdehi
cfg abdehij
cg abdefhij
cgj abdefhi
cgij abdefh
cgi abdefhj
cghi abdefj
cghij abdef
cghj abdefi
cgh abdefij
ch abdefgij
chj abdefgi
chij abdefg
chi abdefgj
ci abdefghj
cij abdefgh
cj abdefghi
c abdefghij
bc adefghij
bcj adefghi
bcij adefgh
bci adefghj
bchi adefgj
bchij adefg
bchj adefgi
bch adefgij
bcgh adefij
bcghj adefi
bcghij adef
bcghi adefj
bcgi adefhj
bcgij adefh
bcgj adefhi
bcg adefhij
bcfg adehij
bcfgj adehi
bcfgij adeh
bcfgi adehj
bcfghi adej
bcfghij ade
bcfghj adei
bcfgh adeij
bcfh adegij
bcfhj adegi
bcfhij adeg
bcfhi adegj
bcfi adeghj
bcfij adegh
bcfj adeghi
bcf adeghij
bcef adghij
bcefj adghi
bcefij adgh
bcefi adghj
bcefhi adgj
bcefhij adg
bcefhj adgi
bcefh adgij
bcefgh adij
bcefghj adi
bcefghij ad
bcefghi adj
bcefgi adhj
bcefgij adh
bcefgj adhi
bcefg adhij
bceg adfhij
bcegj adfhi
bcegij adfh
bcegi adfhj
bceghi adfj
bceghij adf
bceghj adfi
bcegh adfij
bceh adfgij
bcehj adfgi
bcehij adfg
bcehi adfgj
bcei adfghj
bceij adfgh
bcej adfghi
bce adfghij
bcde afghij
bcdej afghi
bcdeij afgh
bcdei afghj
bcdehi afgj
bcdehij afg
bcdehj afgi
bcdeh afgij
bcdegh afij
bcdeghj afi
bcdeghij af
bcdeghi afj
bcdegi afhj
bcdegij afh
bcdegj afhi
bcdeg afhij
bcdefg ahij
bcdefgj ahi
bcdefgij ah
bcdefgi ahj
bcdefghi aj
bcdefghij a
bcdefghj ai
bcdefgh aij
bcdefh agij
bcdefhj agi
bcdefhij ag
bcdefhi agj
bcdefi aghj
bcdefij agh
bcdefj aghi
bcdef aghij
bcdf aeghij
bcdfj aeghi
bcdfij aegh
bcdfi aeghj
bcdfhi aegj
bcdfhij aeg
bcdfhj aegi
bcdfh aegij
bcdfgh aeij
bcdfghj aei
bcdfghij ae
bcdfghi aej
bcdfgi aehj
bcdfgij aeh
bcdfgj aehi
bcdfg aehij
bcdg aefhij
bcdgj aefhi
bcdgij aefh
bcdgi aefhj
bcdghi aefj
bcdghij aef
bcdghj aefi
bcdgh aefij
bcdh aefgij
bcdhj aefgi
bcdhij aefg
bcdhi aefgj
bcdi aefghj
bcdij aefgh
bcdj aefghi
bcd aefghij
bd acefghij
bdj acefghi
bdij acefgh
bdi acefghj
bdhi acefgj
bdhij acefg
bdhj acefgi
bdh acefgij
bdgh acefij
bdghj acefi
bdghij acef
bdghi acefj
bdgi acefhj
bdgij acefh
bdgj acefhi
bdg acefhij
bdfg acehij
bdfgj acehi
bdfgij aceh
bdfgi acehj
bdfghi acej
bdfghij ace
bdfghj acei
bdfgh aceij
bdfh acegij
bdfhj acegi
bdfhij aceg
bdfhi acegj
bdfi aceghj
bdfij acegh
bdfj aceghi
bdf aceghij
bdef acghij
bdefj acghi
bdefij acgh
bdefi acghj
bdefhi acgj
bdefhij acg
bdefhj acgi
bdefh acgij
bdefgh acij
bdefghj aci
bdefghij ac
bdefghi acj
bdefgi achj
bdefgij ach
bdefgj achi
bdefg achij
bdeg acfhij
bdegj acfhi
bdegij acfh
bdegi acfhj
bdeghi acfj
bdeghij acf
bdeghj acfi
bdegh acfij
bdeh acfgij
bdehj acfgi
bdehij acfg
bdehi acfgj
bdei acfghj
bdeij acfgh
bdej acfghi
bde acfghij
be acdfghij
bej acdfghi
beij acdfgh
bei acdfghj
behi acdfgj
behij acdfg
behj acdfgi
beh acdfgij
begh acdfij
beghj acdfi
beghij acdf
beghi acdfj
begi acdfhj
begij acdfh
begj acdfhi
beg acdfhij
befg acdhij
befgj acdhi
befgij acdh
befgi acdhj
befghi acdj
befghij acd
befghj acdi
befgh acdij
befh acdgij
befhj acdgi
befhij acdg
befhi acdgj
befi acdghj
befij acdgh
befj acdghi
bef acdghij
bf acdeghij
bfj acdeghi
bfij acdegh
bfi acdeghj
bfhi acdegj
bfhij acdeg
bfhj acdegi
bfh acdegij
bfgh acdeij
bfghj acdei
bfghij acde
bfghi acdej
bfgi acdehj
bfgij acdeh
bfgj acdehi
bfg acdehij
bg acdefhij
bgj acdefhi
bgij acdefh
bgi acdefhj
bghi acdefj
bghij acdef
bghj acdefi
bgh acdefij
bh acdefgij
bhj acdefgi
bhij acdefg
bhi acdefgj
bi acdefghj
bij acdefgh
bj acdefghi
b acdefghij
ab cdefghij
abj cdefghi
abij cdefgh
abi cdefghj
abhi cdefgj
abhij cdefg
abhj cdefgi
abh cdefgij
abgh cdefij
abghj cdefi
abghij cdef
abghi cdefj
abgi cdefhj
abgij cdefh
abgj cdefhi
abg cdefhij
abfg cdehij
abfgj cdehi
abfgij cdeh
abfgi cdehj
abfghi cdej
abfghij cde
abfghj cdei
abfgh cdeij
abfh cdegij
abfhj cdegi
abfhij cdeg
abfhi cdegj
abfi cdeghj
abfij cdegh
abfj cdeghi
abf cdeghij
abef cdghij
abefj cdghi
abefij cdgh
abefi cdghj
abefhi cdgj
abefhij cdg
abefhj cdgi
abefh cdgij
abefgh cdij
abefghj cdi
abefghij cd
abefghi cdj
abefgi cdhj
abefgij cdh
abefgj cdhi
abefg cdhij
abeg cdfhij
abegj cdfhi
abegij cdfh
abegi cdfhj
abeghi cdfj
abeghij cdf
abeghj cdfi
abegh cdfij
abeh cdfgij
abehj cdfgi
abehij cdfg
abehi cdfgj
abei cdfghj
abeij cdfgh
abej cdfghi
abe cdfghij
abde cfghij
abdej cfghi
abdeij cfgh
abdei cfghj
abdehi cfgj
abdehij cfg
abdehj cfgi
abdeh cfgij
abdegh cfij
abdeghj cfi
abdeghij cf
abdeghi cfj
abdegi cfhj
abdegij cfh
abdegj cfhi
abdeg cfhij
abdefg chij
abdefgj chi
abdefgij ch
abdefgi chj
abdefghi cj
abdefghij c
abdefghj ci
abdefgh cij
abdefh cgij
abdefhj cgi
abdefhij cg
abdefhi cgj
abdefi cghj
abdefij cgh
abdefj cghi
abdef cghij
abdf ceghij
abdfj ceghi
abdfij cegh
abdfi ceghj
abdfhi cegj
abdfhij ceg
abdfhj cegi
abdfh cegij
abdfgh ceij
abdfghj cei
abdfghij ce
abdfghi cej
abdfgi cehj
abdfgij ceh
abdfgj cehi
abdfg cehij
abdg cefhij
abdgj cefhi
abdgij cefh
abdgi cefhj
abdghi cefj
abdghij cef
abdghj cefi
abdgh cefij
abdh cefgij
abdhj cefgi
abdhij cefg
abdhi cefgj
abdi cefghj
abdij cefgh
abdj cefghi
abd cefghij
abcd efghij
abcdj efghi
abcdij efgh
abcdi efghj
abcdhi efgj
abcdhij efg
abcdhj efgi
abcdh efgij
abcdgh efij
abcdghj efi
abcdghij ef
abcdghi efj
abcdgi efhj
abcdgij efh
abcdgj efhi
abcdg efhij
abcdfg ehij
abcdfgj ehi
abcdfgij eh
abcdfgi ehj
abcdfghi ej
abcdfghij e
abcdfghj ei
abcdfgh eij
abcdfh egij
abcdfhj egi
abcdfhij eg
abcdfhi egj
abcdfi eghj
abcdfij egh
abcdfj eghi
abcdf eghij
abcdef ghij
abcdefj ghi
abcdefij gh
abcdefi ghj
abcdefhi gj
abcdefhij g
abcdefhj gi
abcdefh gij
abcdefgh ij
abcdefghj i
abcdefghij
abcdefghi j
abcdefgi hj
abcdefgij h
abcdefgj hi
abcdefg hij
abcdeg fhij
abcdegj fhi
abcdegij fh
abcdegi fhj
abcdeghi fj
abcdeghij f
abcdeghj fi
abcdegh fij
abcdeh fgij
abcdehj fgi
abcdehij fg
abcdehi fgj
abcdei fghj
abcdeij fgh
abcdej fghi
abcde fghij
abce dfghij
abcej dfghi
abceij dfgh
abcei dfghj
abcehi dfgj
abcehij dfg
abcehj dfgi
abceh dfgij
abcegh dfij
abceghj dfi
abceghij df
abceghi dfj
abcegi dfhj
abcegij dfh
abcegj dfhi
abceg dfhij
abcefg dhij
abcefgj dhi
abcefgij dh
abcefgi dhj
abcefghi dj
abcefghij d
abcefghj di
abcefgh dij
abcefh dgij
abcefhj dgi
abcefhij dg
abcefhi dgj
abcefi dghj
abcefij dgh
abcefj dghi
abcef dghij
abcf deghij
abcfj deghi
abcfij degh
abcfi deghj
abcfhi degj
abcfhij deg
abcfhj degi
abcfh degij
abcfgh deij
abcfghj dei
abcfghij de
abcfghi dej
abcfgi dehj
abcfgij deh
abcfgj dehi
abcfg dehij
abcg defhij
abcgj defhi
abcgij defh
abcgi defhj
abcghi defj
abcghij def
abcghj defi
abcgh defij
abch defgij
abchj defgi
abchij defg
abchi defgj
abci defghj
abcij defgh
abcj defghi
abc defghij
ac bdefghij
acj bdefghi
acij bdefgh
aci bdefghj
achi bdefgj
achij bdefg
achj bdefgi
ach bdefgij
acgh bdefij
acghj bdefi
acghij bdef
acghi bdefj
acgi bdefhj
acgij bdefh
acgj bdefhi
acg bdefhij
acfg bdehij
acfgj bdehi
acfgij bdeh
acfgi bdehj
acfghi bdej
acfghij bde
acfghj bdei
acfgh bdeij
acfh bdegij
acfhj bdegi
acfhij bdeg
acfhi bdegj
acfi bdeghj
acfij bdegh
acfj bdeghi
acf bdeghij
acef bdghij
acefj bdghi
acefij bdgh
acefi bdghj
acefhi bdgj
acefhij bdg
acefhj bdgi
acefh bdgij
acefgh bdij
acefghj bdi
acefghij bd
acefghi bdj
acefgi bdhj
acefgij bdh
acefgj bdhi
acefg bdhij
aceg bdfhij
acegj bdfhi
acegij bdfh
acegi bdfhj
aceghi bdfj
aceghij bdf
aceghj bdfi
acegh bdfij
aceh bdfgij
acehj bdfgi
acehij bdfg
acehi bdfgj
acei bdfghj
aceij bdfgh
acej bdfghi
ace bdfghij
acde bfghij
acdej bfghi
acdeij bfgh
acdei bfghj
acdehi bfgj
acdehij bfg
acdehj bfgi
acdeh bfgij
acdegh bfij
acdeghj bfi
acdeghij bf
acdeghi bfj
acdegi bfhj
acdegij bfh
acdegj bfhi
acdeg bfhij
acdefg bhij
acdefgj bhi
acdefgij bh
acdefgi bhj
acdefghi bj
acdefghij b
acdefghj bi
acdefgh bij
acdefh bgij
acdefhj bgi
acdefhij bg
acdefhi bgj
acdefi bghj
acdefij bgh
acdefj bghi
acdef bghij
acdf beghij
acdfj beghi
acdfij begh
acdfi beghj
acdfhi begj
acdfhij beg
acdfhj begi
acdfh begij
acdfgh beij
acdfghj bei
acdfghij be
acdfghi bej
acdfgi behj
acdfgij beh
acdfgj behi
acdfg behij
acdg befhij
acdgj befhi
acdgij befh
acdgi befhj
acdghi befj
acdghij bef
acdghj befi
acdgh befij
acdh befgij
acdhj befgi
acdhij befg
acdhi befgj
acdi befghj
acdij befgh
acdj befghi
acd befghij
ad bcefghij
adj bcefghi
adij bcefgh
adi bcefghj
adhi bcefgj
adhij bcefg
adhj bcefgi
adh bcefgij
adgh bcefij
adghj bcefi
adghij bcef
adghi bcefj
adgi bcefhj
adgij bcefh
adgj bcefhi
adg bcefhij
adfg bcehij
adfgj bcehi
adfgij bceh
adfgi bcehj
adfghi bcej
adfghij bce
adfghj bcei
adfgh bceij
adfh bcegij
adfhj bcegi
adfhij bceg
adfhi bcegj
adfi bceghj
adfij bcegh
adfj bceghi
adf bceghij
adef bcghij
adefj bcghi
adefij bcgh
adefi bcghj
adefhi bcgj
adefhij bcg
adefhj bcgi
adefh bcgij
adefgh bcij
adefghj bci
adefghij bc
adefghi bcj
adefgi bchj
adefgij bch
adefgj bchi
adefg bchij
adeg bcfhij
adegj bcfhi
adegij bcfh
adegi bcfhj
adeghi bcfj
adeghij bcf
adeghj bcfi
adegh bcfij
adeh bcfgij
adehj bcfgi
adehij bcfg
adehi bcfgj
adei bcfghj
adeij bcfgh
adej bcfghi
ade bcfghij
ae bcdfghij
aej bcdfghi
aeij bcdfgh
aei bcdfghj
aehi bcdfgj
aehij bcdfg
aehj bcdfgi
aeh bcdfgij
aegh bcdfij
aeghj bcdfi
aeghij bcdf
aeghi bcdfj
aegi bcdfhj
aegij bcdfh
aegj bcdfhi
aeg bcdfhij
aefg bcdhij
aefgj bcdhi
aefgij bcdh
aefgi bcdhj
aefghi bcdj
aefghij bcd
aefghj bcdi
aefgh bcdij
aefh bcdgij
aefhj bcdgi
aefhij bcdg
aefhi bcdgj
aefi bcdghj
aefij bcdgh
aefj bcdghi
aef bcdghij
af bcdeghij
afj bcdeghi
afij bcdegh
afi bcdeghj
afhi bcdegj
afhij bcdeg
afhj bcdegi
afh bcdegij
afgh bcdeij
afghj bcdei
afghij bcde
afghi bcdej
afgi bcdehj
afgij bcdeh
afgj bcdehi
afg bcdehij
ag bcdefhij
agj bcdefhi
agij bcdefh
agi bcdefhj
aghi bcdefj
aghij bcdef
aghj bcdefi
agh bcdefij
ah bcdefgij
ahj bcdefgi
ahij bcdefg
ahi bcdefgj
ai bcdefghj
aij bcdefgh
aj bcdefghi
a bcdefghij
|
Posted by Charlie
on 2013-08-13 01:52:49 |