The mathematics of Spinpossible

Notes on the Spinpossible puzzle game. We give a mathematical description of the game, prove some elementary bounds on the length of optimal solutions, and consider variations of the game which place restrictions on the set of permitted moves. We con…

Authors: Alex Sutherl, Andrew Sutherl

THE MA THEMA TICS OF SPINPOSSIBLE ALEX SUTHERLAND AND ANDREW SUTHERLA N D 1. Introduction Spinpo ssible TM is play ed on 3 × 3 b oard of tiles num ber ed from 1 to 9, each of which m y be r ight-side-up or up-s ide-down. One poss ible starting p osition is the bo ard: 5 4 9 2 1 6 7 8 3 The ob jective o f the ga me is to return the b oa rd to the standard configuration: 1 2 3 4 5 6 7 8 9 This is accomplished by a seq ue nc e o f spins , each of which ro ta tes a rectangular region of the b o ard by 180 ◦ . The goa l is to minimize the num b er of spins used. The starting b oar d ab ov e ma y b e so lved using t wo s pins : 5 4 9 2 1 6 7 8 3 = ⇒ 1 2 9 4 5 6 7 8 3 = ⇒ 1 2 3 4 5 6 7 8 9 In this example, the first s pin rotates the the 2 × 2 rectangle in the top left, and the second spin rotates the 3 × 1 rectangle alo ng the rig h t edg e. Y ou ca n play the game online at ht tp://s pinpo ssible.com In these notes w e give a mathematical description of this game, and some of its generaliza tions, and co nsider v arious questions that natura lly arise. Perhaps the most obvious is this: is it a lwa ys p ossible to return a g iven boa rd to the standard configuratio n with a sequence o f spins? W e shall se e sho rtly that the a ns wer is yes. A more difficult question is the following: wha t is the maximum n um b er of spins required to s olve an y b oar d? An ex haustive search has found that 9 spins ar e alwa ys sufficient (and sometimes necessar y ), but no short pro of of this fact is known. 2. A ma thema tical description of th e game W e b egin by defining the group Spin m × n , for a fixed pair of p os itive int eger s m and n with pro duct N = mn . Let S N denote the symmetric gr oup on N letters with the action on the r ight (so the p er mu tation αβ applies α and then β ), and let V N = ( Z / 2 Z ) N denote the a dditive group of N -bit vectors. F o r an y vector v = ( v 1 , . . . , v N ) ∈ V N and p ermutation α ∈ S N , we use v α = ( v α − 1 (1) , . . . , v α − 1 ( N ) ) to denote the v ector obtained by applying α to v . 1 2 ALEX SUTHERLAND AND ANDREW SUTHERLAND Definition 1 . The gr oup Spin m × n is the set { ( α, u ) : α ∈ S mn , u ∈ V mn } under t he op er at ion ( α, u )( β , v ) = ( αβ , u β + v ) . Equivalently, Spin m × n is the wr e ath pr o duct Z / 2 Z ≀ S N . Readers familiar with Coxeter g roups will recog niz e Spin m × n as the hypero c- tahedral g roup of degree N (the symmetry gro up of bo th the N -cub e and the N -o ctahedron), equiv alen tly , the W eyl gr oup of t yp e B N (and C N ). This group can also b e represented using signed p ermutation matrices, but the representation as a wrea th pro duct is better suited to our purp oses here. The definition of the group Spin m × n depe nds only on N = mn , ho wev er the integers m and n determine the set of generator s we will be defining shortly , and these play a key role in the game (playing Spinpossible on a 1 × 9 b oa rd w ould be muc h less interesting!). A b o ar d is an m × n ar ray of uniquely identified elemen ts called t iles , which we num ber from 1 to mn . Eac h tile may b e or iented positively (r ight-side-up), or negatively (upside-down). The p o sitions of the b oard are fixed loca tions, whic h for conv enience we regard as unit squares in the plane, also n umbered from 1 to mn , starting at the top left a nd pro ceeding left to right, to p to b ottom. The standar d b o a r d has tile i in p osition i , with po sitive orien tation. There is a 1- to-1 corr esp ondence b etw een m × n b oar ds and elements o f Spin m × n , but we will g e nerally think of elemen ts of Spin m × n as acting on the set of all m × n bo ards as follows: the element ( α, v ) first p er mut es the tiles b y mo ving the tile in po sition i to p osition α ( i ), and then re verses the orientiation of the tile in the i th po sition if and only if v i = 1. Of course this is just the actio n of Spin m × n on itself. The pro jection map π : Spin m × n → S N that sends ( α, u ) to α is a g roup homo- morphism, and we ha ve the short exact seque nce 1 − → V N − → Spin m × n − → S N − → 1 . It is worth empha sizing that the pr o jection from Spin m × n to V N is not a group homomorphism (for N > 1). W e no w distinguish the elements of Spin m × n that corresp ond to spins , the moves per mitted in the game. A r e c tangle R sp ecifies a rectangular subset of the p os itions on an m × n b oar d, and ha s dimensions i × j , with 1 ≤ i ≤ m and 1 ≤ j ≤ n . A spin rotates some rectangle b y 180 ◦ . It is r easona bly clear what this means, but to make it mo re precise we define a notion of distance that will b e useful later. The distanc e ρ ( p 1 , p 2 ) betw een po sitions p 1 and p 2 is mea sured by applying the ℓ 1 -norm to the centers of the corresp o nding unit sq ua res. Tw o p ositions a re adjac ent when they hav e a s ingle edge in co mmo n, equiv a lently , when the distance betw een them is 1. F or a p os ition p and a rectangle R , we use ρ ( p, R ) to denote the distance from the cen ter of p to the center of R (again using the ℓ 1 -norm). Definition 2 . The spin ab out R is t he element of Spin m × n that tra nsp oses the tiles in p ositions p 1 , p 2 ∈ R if and only if ρ ( p 1 , p 2 ) = 2 ρ ( p 1 , R ) = 2 ρ ( p 2 , R ) , and then re verses the orientation of e a ch tile in R . W e say that an element o f Spin m × n is a spin if it is a spin abo ut some r ectan- gle R . The pro po sition b elow records some useful facts ab out spins. The proo fs are straight-forward, but for the sake o f completenes s w e fill in the details. They can (and probably sho uld) b e skipped on a first rea ding. Prop ositi o n 1. L et s 1 and s 2 b e spins ab out r e ctangles R 1 and R 2 r esp e ctively. (1) s 1 is its own inverse (as is s 2 ). THE MA THEMA TICS OF SPINPOS SIBLE 3 (2) s 1 s 2 is not a spin. (3) s 1 s 2 = s 2 s 1 if and only if R 1 and R 2 ar e disjoi nt or have a c ommon c enter. (4) s 1 s 2 s 1 is a spin s 3 if and only if either s 1 and s 2 c ommut e or R 1 c on- tains R 2 . The r e ctangle of s 3 has the same shap e as R 2 . Pr o of. (1) is clear. F or (2), suppose s 3 = s 1 s 2 is a spin about so me rectang le R 3 . Then s 1 6 = s 2 , and therefo re R 1 6 = R 2 , since the iden tity elemen t is no t a spin. Now suppo se there exist positions p 1 ∈ R 1 − R 2 and p 2 ∈ R 2 − R 1 . Then s 3 mov es the tile in p ositio n p i to the s ame lo cation that s i do es, which implies that R i and R 3 hav e a common center, for i = 1 , 2 . But then there is a p osition in R 3 containing this co mmon center (either in its cen ter or along an edge) and s 3 = s 1 s 2 do es not change the orientation of the tile in this p osition, which is a contradiction. Now assume witho ut loss of gener ality that R 1 prop erly con tains R 2 . Let p 1 and p 2 be corners of R 1 not contained in R 2 (let p 1 = p 2 if R 1 has width or heig ht 1, and p 1 6 = p 2 otherwise). Then s 3 acts on the tiles in positions p 1 and p 2 the sa me wa y that s 1 do es, and this implies that R 3 and R 1 hav e a co mmon center and that R 1 ⊂ R 3 . But R 3 m ust lie in the union of R 1 and R 2 , so R 3 = R 1 and s 3 = s 1 , but then s 2 is the identit y , which is aga in a con tradictio n. So s 1 s 2 is not a spin. W e now a ddr ess (3). F or any p os ition p not in the int eres ection of R 1 and R 2 , bo th s 1 s 2 and s 2 s 1 hav e the same effect on the tile t in p osition p . Now supp ose p is in the intersection o f R 1 and R 2 . Then the orientation o f t is preser ved by bo th s 1 s 2 and s 2 s 1 , so w e need only consider the position to whic h t is mov e d. The pro duct of tw o rotations b y π is a translatio n (poss ibly trivial). Reversing the or der of the ro tations yields the inv erse translation, th us t is moved to the sa me positio n if and only if the translation is trivial, whic h o ccurs prec isely when R 1 and R 2 hav e a common center. This proves (3). F or (4), it is clear that if s 1 and s 2 commute then s 3 = s 2 is a spin. Now suppose R 1 contains R 2 . Let R 3 be the in verse image of R 2 under the per mu tation π ( s 1 ), and let s 3 = s 1 s 2 s 1 . F or tiles in R 3 , the action of s 3 is the pro duct of three ro tations by π , which is again a rotatio n by π , and the center of this rotatio n is the cen ter of R 3 . Thus s 3 is a spin ab o ut R 3 , which has the same shap e as R 2 . T o prov e the other direction o f (4), suppose for the sake of contradiction that s 3 is a spin ab out so me recta ng le R 3 , that R 1 and R 2 are not disjoin t, do not have a common center, a nd that R 1 do es not con tain R 2 . These assumptions guarantee the existence of a position p ∈ R 2 − R 1 whose image under π ( s 2 ) is in R 1 . The ac tio n of s 3 on the tile t in position p is the same as s 2 s 1 , whic h is t wo ro tations by π , hence a tra nslation. But R 1 and R 2 do not hav e a co mmon c e nter, so this tra nslation is non-trivial and s 3 mov es tile t without changing its orientation, co nt ra dicting our assumption that s 3 is a spin.  Each spin is uniquely determined by its rectangle R , th us we may sp ecify a s pin in the for m [ p 1 , p 2 ], where p 1 and p 2 ident ify the p ositions o f the upper left and low e r right corne r s of R (resp ectively). F or e x ample, o n a 3 × 3 b oar d the spin ab out the 2 × 2 r ectangle in the upper r ight c orner is [2 , 6] =  (2 6)(3 5) , 0 1101 1 000  . The moves p er mitted in a game of Spinpo ssible on an m × n boa rd ar e precise ly the set S = S ( m, n ) of all spins [ p 1 , p 2 ], where 1 ≤ p 1 ≤ p 2 ≤ mn (we consider v aria tions of the game that pla ce restrictions o n S in § 3). 4 ALEX SUTHERLAND AND ANDREW SUTHERLAND In mathematical terms, the ga me works as follows: given an element b ∈ Spin m × n (the starting b oa r d), write b − 1 as a pr o duct s 1 s 2 s 3 · · · , s k of elemen ts in S , with k as sma ll as p ossible (a solution ). Applying the spins s 1 , s 2 , . . . , s k to b then yields the identit y (the standar d boa rd). In ge neral there will be man y solutions to b , but some b oards hav e a unique solution; this topic is discussed further in § 4. Let R i × j denote the s ubset of Spin m × n that are s pins ab out an i × j rectangle. The set R i × j is necessarily empty if i > m or j > n , and we may hav e R i × j = ∅ even when R j × i 6 = ∅ (although this can o ccur only when m 6 = n ). In these notes we shall alwa ys consider the sets R i × j and R j × i together, thus we de fine S i × j = R i × j ∪R j × i . The set of spins S in Spin m × n is then the union of the sets S i × j , each of which w e refer to as a spin typ e . Prop ositi o n 2. Assume 1 ≤ i ≤ m , 1 ≤ j ≤ n , and m ≤ n . The fol lowing hold: (1) |R i × j | = ( m + 1 − i )( n + 1 − j ) . (2) |S i × j | = ( |R i × j | + |R j × i | for i 6 = j, |R i × j | for i = j. (3) |S | =  m +1 2  n +1 2  . (4) Ther e ar e 1 2 m (2 n − m + 1) distinct spin typ es S i × j in Spin m × n . Pr o of. F or (1), w e note that there are ( m + 1 − i )( n + 1 − j ) p oss ible lo cations for the upp er left cor ner of a n i × j rectangle on an m × n b oar d. The for mula in (2) is immediate. F or (3) we hav e m X i =1 n X j =1 ( m + 1 − i )( n + 1 − j ) = m X i =1 n X j =1 ij =  m + 1 2  n + 1 2  , and for (4) we hav e m X i =1 n X j = i 1 = m X i =1 ( n + 1 − i ) = m ( n + 1 ) −  m + 1 2  = m (2 n − m + 1) 2 .  It is well k nown that the symmetric group S N is g enerated b y the set of all transp ositions (per m utations that swap tw o elements and leav e the r est fixed). Slightly less well known is the fact that S N is generated b y an y set of transpositio ns that form a co nnected graph, as des c rib ed in the following lemma. Lemma 1. L et E ⊆ S N b e a set of tr ansp ositions ( v i , v j ) acting on a set of vertic es V = { v 1 , . . . , v N } . L et G b e the undir e cte d gr aph on V wi th e dge set E . Then E gener ates S N if and only if G is c onne cte d. Pr o of. It suffices to show that E gener ates every tr ansp osition in S N . If the se- quence of edge s ( e 1 , . . . , e k ) is a path from v i to v j in G , then the per m utation e 1 e 2 . . . e k − 2 e k − 1 e k e k − 1 e k − 2 . . . e 2 e 1 is the tra nsp osition ( v i , v j ). Let H b e the subgro up of S N generated b y E . The H -o rbits of V corresp o nd to connected comp onents of G , and H can achiev e any per mutation of the vertices in a g iven comp onent, since it can transp ose any pair of vertices connected b y a path. Thus H = S N if and only if G is connected.  Corollary 1. S 1 × 1 ∪ S 1 × 2 gener ates Spin m × n . THE MA THEMA TICS OF SPINPOS SIBLE 5 Pr o of. The se t S 1 × 2 consists of transp ositions that form a connected g r aph whose vertices a re the positions o n an m × n b oar d with edges betw e en adjacent p os itions. If follows from Lemma 1 that, given any ele ment ( α, u ) in Spin m × n , there is a vector v ∈ B mn for whic h we can construct ( α, v ) as a product of elemen ts in S 1 × 2 . By applying appro priate elemen ts of S 1 × 1 to ( α, v ) w e ca n o btain ( α, u ).  The corollar y implies that every star ting boar d in the Spinp ossible ga me has a solution. W e now g ive a n upper b o und on the le ng th of any solution. Theorem 1. Every element of Spin m × n c an b e expr esse d as a pr o duct of at most 3 mn − ( m + n ) spins. Pr o of. Let ( α, u ) b e an element of Spin m × n . F or any v ∈ V N we ma y wr ite ( α, u ) as ( α, v )( ι, u + v ), where ι denotes the tr ivial p ermutation. It is clear that we can express ( ι, u + v ) as the product of at most mn e le men ts in S 1 × 1 . Thus it suffices to show that we can c o nstruct an element of the form ( α, v ), for some v ∈ V N , a s a pro duct of at most 2 mn − ( m + n ) spins. Since we may use an y v we like, we now ignore the orientation of tiles and fo cus on the p ermutation α . Ra ther than constructing α , w e shall constr uc t α − 1 (whic h is equiv alent, since α is a rbitrary). W e now pro ceed b y induction on N to show that we can construct α − 1 using at most 2 mn − ( m + n ) spins. F or N = 1 we necessa rily hav e α − 1 = ι , which is the pro duct of 0 = 2 m n − ( m + n ) spins. F or N > 1, a ssume without lo ss of generality that m ≤ n (in terchange the role of rows and colunmns in wha t follo ws if not). W e first use the spin ab out the r ectangle [1 , α (1)] to restor e tile 1 to its correct p osition in the upp er left corner . Now let i and j b e the vertical and ho rizontal distances, resp ectively , betw een p ositions n + 1 and α ( n + 1), so that ρ ( n + 1 , α ( n + 1 )) = i + j . T o mov e tile n + 1 to p osition n + 1 (the sec o nd row of the leftmost column) we first apply an elemen t of S ( i +1) × 1 to mov e tile n + 1 to the correct row, and then apply an e le men t of S 1 × ( j +1) to move tile n + 1 to the corr ect co lumn (w e ca n omit spins in S 1 × 1 , which a rise when i o r j is zero ). Neither of these spins affects p osition 1. In a similar fashion, we can successively move each tile k n + 1 for 2 ≤ k < m from po sition α ( k n + 1) to pos ition k n + 1 using a t mo st tw o s pins per tile, without disturbing any of the tiles in p os itions j n + 1 for j < k . The total num b er of spins used to correctly positio n all the tiles in the leftmost column is 2 m − 1. By the inductive hypothesis, we can correctly p ositio n the remaining tiles in the ( m − 1) × n bo ard obtained b y ignoring the leftmost column using at most 2 ( m − 1) n − ( m − 1 + n ) spins. The total num b er of spins used is 2 m − 1 + 2( m − 1 ) n − ( m − 1 + n ) = 2 m n + m − 3 n − 1 , and since m ≤ n this is less than 2 mn − ( m + n ).  The upper b ound in Theorem 1 can b e improved for mn > 1. A more detailed analysis of the c a se Spin 3 × 3 shows that one can mov e every tile to its co rrect po sition using at most 9 spins 1 , and then or ient ev ery tile correctly using at most 7 spins, yielding a n upp er b o und o f 16, versus the b ound of 21 given b y The o rem 1. W e als o note that the leading constant 3 is not the b est p ossible: for m, n ≥ 3 the techn ique used to orient tiles in the 3 × 3 case can b e generalized to achiev e 25 / 9 . Let k ( m, n ) denote the maximum length of a solution to a boa rd in Spin m × n . Theorem 1 gives an upper bo und on k ( m, n ). W e now prov e a low er b ound. 1 It is known tha t 7 spins alw ays suffice, and are sometimes nece ssary . 6 ALEX SUTHERLAND AND ANDREW SUTHERLAND Theorem 2. A ssume N = mn > 1 . Then k ( m, n ) ≥ ln(2 N N !) ln  m +1 2  n +1 2  + 1  . This implies the b ound k ( m, n ) ≥ 1 2 mn − (1 − ln 2) 2 · mn ln mn + 1 4 . Pr o of. Let c = |S | + 1. The n umber of distinct expressions of the fo rm s 1 · · · s j with s 1 , . . . , s j ∈ S and j ≤ k is at most c k . Not all of these expressio ns yield dis tinct elements of Spin m × n , but in any case it is clear that they corresp ond to at most c k distinct elements of Spin m × n . The car dinality of Spin m × n is 2 N N !, thu s in order to express ev ery ele ment of Spin m × n as a product of at most k spins w e m ust hav e (1) c k ≥ 2 N N ! F rom Prop ositio n 2 we hav e c =  m +1 2  n +1 2  + 1. T ak ing logar ithms in (1) a nd dividing by ln c yields the first b o und for k ( m, n ). F or the se c ond bo und, w e no te that N 2 > c for all N = mn > 1 , th us we can replace the LHS of (1) by N 2 k . By b ounding the erro r term in Stirling’s approximation o ne can show that ln N ! ≥ N ln N − N + 1 2 ln N , for all N ≥ 1. Applying N 2 k > c k and taking loga rithms in (1) yields 2 k ln N ≥ N ln N − (1 − ln 2) N + 1 2 ln N . Dividing by 2 ln N gives k ≥ 1 2 N − 1 − ln 2 2 · N ln N + 1 4 , which pr oves the second bo und.  F or m = n = 3, Theorem 2 give the low er bound k (3 , 3) ≥ 6, which is not far below the kno wn v alue k (3 , 3) = 9. Asymptotically , we ha ve the following c o rollar y . Corollary 2. The asymptotic gr owth of k ( m, n ) is line ar in N = mn . Mor e pr e- cisely, for every ǫ > 0 ther e is an N 0 such that  1 2 + ǫ  N < k ( m, n ) ≤ 3 N for al l N > N 0 . Recall that for a g roup G generated by a s e t S , the Cayley graph Cay( G, S ) is the g raph with vertex set G and e dg e ( g , h ) lab elled by s whenever sg = h , w her e s ∈ S and g , h ∈ G . A solution to a bo ard b ∈ Spin m × n corres p o nds to a shor test path fro m b to the identit y in the graph Cay(Spin m × n , S ). The quantit y k ( m, n ) is the diameter of this graph. THE MA THEMA TICS OF SPINPOS SIBLE 7 3. Restricted Spin Sets Spinpo ssible includes v ar iations of the standard game that place restr ictions on the t yp es of spins that are allow ed. F or exa mple, the “no singles/doubles ” puzzle levels prohibit the use o f spins in S 1 × 1 and S 1 × 2 . This raises the question of whether it is still possible to solve every boar d under s uch a restriction. Mo re generally , we may ask : which subsets of the full set of spins S = S ( m, n ) gener ate Spin m × n ? W e b egin by defining three subsets of S that cannot generate Spin m × n when mn > 1, using three different notions of parity . (1) The even ar e a spins S a are the spins whose re ctangles hav e ev en a r ea. S a is the unio n of the S i × j for which ij ≡ 0 mo d 2. (2) The even p ermut ation spins S p are the spins that contain an even n umber of tr a nsp ositions. S p is the union of the S i × j for which ij ≡ 0 or 1 mo d 4. (3) The even distanc e spins S d are the spins that transp ose p ositions at ev en distances. S d is the union o f the S i × j for which i + j ≡ 0 mod 2. W e now consider the co rresp onding subg roups of Spin m × n . In these definitions α is a p er mut ation in S N , v is a vector in V N , and wt( v ) deno tes the Hamming weigh t of v (the n umber of 1s it con tains). The g roup A N is the alternating group in S N , and w e define the p er mu tation g r oup D N ∼ = S ⌈ N/ 2 ⌉ × S ⌊ N/ 2 ⌋ as follows: D N = { α : ρ ( i, α ( i )) ≡ 0 mod 2 for 1 ≤ i ≤ N } . Here i and α ( i ) identify p ositions on an m × n board and ρ ( i, α ( i )) is the ℓ 1 -distance. The subgr o ups Spin ∗ m × n , where ∗ is a , p , or d , a re defined as follows: (1) Spin a m × n = { ( α, v ) : wt( v ) ≡ 0 mo d 2 } (index 2). (2) Spin p m × n = { ( α, v ) : α ∈ A N } (index 2). (3) Spin d m × n = { ( α, v ) : α ∈ D N } (index  N ⌊ N/ 2 ⌋  ). It is not necess a rily the ca se that S ∗ generates Spin ∗ m × n , but we alwa ys have S ∗ = S ∩ Spin ∗ m × n . In pa rticular, it is clea r that hS ∗ i ⊆ Spin ∗ m × n . The following prop ositions give some conditions under which equality holds. Prop ositi o n 3. Ass u me m, n ≥ 2 and mn > 4 . Then S 1 × 2 ∪ S 2 × 2 (and ther e- for e S a ) gener ates Spin a m × n . Pr o of. Let G = hS 1 × 2 ∪ S 2 × 2 i , and let ˆ π denote the restrictio n of π to G . The fact that G contains S 1 × 2 implies tha t π ( G ) = S N , by Lemma 1. It thus suffices to show that the kernel of ˆ π has index 2 in ker π ∼ = V N . The following product of spins in G transpo ses the tiles in positio ns 1 and 2: (2) [2 , 3][1 , n + 1][1 , n + 2][2 , 3][1 , n + 2][1 , n + 1][2 , 3] =  (1 2) , 0  W e can transfor m the iden tity ab ov e by applying any square-pres erving isometry of Z 2 (the group gener ated by unit translations and reflections abo ut the lines y = 0 and y = x ). Suc h a transfor mation may change the lo cation and/or orientation of the rec ta ngles identif ying the s pins that appea r in the pro duct, but it do es not change their spin type (the set S i × j to which they b elong). This allows us to transp ose any pair of adjace n t tiles o n the m × n b oar d using a pro duct of spins in G . It follows fro m L e mma 1 tha t G contains the subg roup H = { ( α, 0 ) : α ∈ S N } . F or each even int eger w from 0 to N , we can construct so me g w = ( β , v ) with wt( v ) = w , as a pro duct of elements in S 1 × 2 . The coset g w H ⊂ G then contains elements of the for m ( β , v ) for every vector v with wt( v ) = w . Multiplying each 8 ALEX SUTHERLAND AND ANDREW SUTHERLAND ( β , v ) on the left b y ( β − 1 , 0 ), we see that G contains elements ( ι, v ) for every even weigh t v ector v . Therefore ker ˆ π ha s index 2 in ker π .  W e note that S a do es not generate Spin a m × n when m = n = 2, nor when exactly one of m or n is 1. Prop ositi o n 4. Assume mn 6 = 4 . Then S 1 × 1 ∪ S 2 × 2 ∪ S 1 × 3 (and ther efor e S d ) gener ates Spin d m × n . Pr o of. Let G = hS 1 × 1 ∪ S 2 × 2 ∪ S 1 × 3 i . Then G con tains ker π = hS 1 × 1 i ∼ = V N . It remains to show that π ( G ) = D N . Assume for the moment that m ≥ 2 and n ≥ 3. The following pro duct of spins in G transp ose the tiles in p ositions 1 and n+2: (3) [2 , n + 3][1 , 3 ][2 , n + 3][ n + 3 , n + 3] =  (1 n + 2) , 0  As in the pro o f of Pr op osition 3, we may transform this identit y by applying any square-pr eserving iso metry of Z 2 . Thu s we can transp ose any pair of tiles that share exactly one common vertex (i.e., that are “dia g onally adjacent”), and w e can also handle the case m ≥ 3 and n ≥ 2. It then follows fro m Lemma 1 that these transp ositions gener a te D N . W e no w c o nsider the case where m or n is 1 . If mn ≤ 2 the prop osition clearly holds (we o nly need spins in S 1 × 1 ), so assume without lo ss of generality that m = 1 and n ≥ 3. W e no w repla c e (3) with [1 , 1][1 , 3][2 , 2][1 , 1] =  (1 3) , 0  , and apply the sa me argument.  It is easy to check that when mn = 4 the set S d do es not genera te Spin d m × n . W e leav e ope n the question of when S p generates Spin p m × n , but for Spin 3 × 3 we note that S p ⊂ S a (see b e low), th us S p do es not ge nerate Spin m × n in this ca se. F or refer e nce, we list the s pin types S i × j contained in S a , S p , and S d for all i, j ≤ 3 ≤ m, n : (1) S 1 × 2 , S 2 × 2 , S 2 × 3 ⊂ S a . (2) S 2 × 2 , S 3 × 3 ⊂ S p . (3) S 1 × 1 , S 1 × 3 , S 2 × 2 , S 3 × 3 ⊂ S d . T o simplify our analysis of the subsets of S that g enerate Spin m × n , we introduce an equiv alence relation on spin types. Definition 3 . Two s pin t yp es S i × j and S i ′ × j ′ ar e e quivalent, denote d S i × j ∼ S i ′ × j ′ , whenever hS i × j i = hS i ′ × j ′ i . Prop ositi o n 5. L et m, n ≥ 3 . F or 1 ≤ i , i ′ , j, j ′ ≤ 3 ther e is exactly one n on-trivial e quivalenc e of spin typ es S i × j ∼ S i ′ × j ′ , namely, S 1 × 2 ∼ S 2 × 3 Pr o of. If a particular spin type is contained in S ∗ (where ∗ is a , p , or d ), then so is every equiv alent spin type. Examining the list of s pin t yp es for S ∗ , we ca n use this cr iterion to r ule out all but t wo p oss ible equiv a lences a mo ng the 6 spin t yp es S i × j with 1 ≤ i , j ≤ 3. The first is the pair S 1 × 1 and S 3 × 3 , but these cannot b e equiv alent bec ause hS 1 × 1 i lies in ker π 1 ∼ = V N but S 3 × 3 do es not. The second is the pair S 1 × 2 and S 2 × 3 , which w e now sho w are equiv a lent . F or simplicity we sha ll wr ite spins in ter ms of r ectangles with c o ordinates on a 3 × 3 boa rd, but these can b e genera lized to an m × n boar d by repla cing p ositions THE MA THEMA TICS OF SPINPOS SIBLE 9 4, 5, 6, 7 , 8 a nd 9 with po s itions n + 1, n + 2 , n + 3, 2 n + 1, 2 n + 2 , and 2 n + 3, resp ectively . W e c an write the spin [1 , 6] as a pro duct of spins in S 1 × 2 as follows: [1 , 6] = [2 , 5][2 , 3][4 , 5 ][5 , 6][1 , 2 ][4 , 5][2 , 3][3 , 6][1 , 4] . As in the pro ofs of Prop ositions 3 a nd 4, we can transfo rm this identit y via a square-pr eserving iso metry of Z 2 to express any s pin in S 2 × 3 as a pro duct of spins in S 1 × 2 . Thu s hS 2 × 3 i ⊂ hS 1 × 2 i . F or the o ther inclusion, we may write the spins [1 , 2] and [4 , 5] as pro ducts of spins in S 2 × 3 as follows: [1 , 2] = [1 , 6][4 , 9][1 , 8 ][4 , 9][1 , 8 ][1 , 6][1 , 8][4 , 9][1 , 8][1 , 6][1 , 8][4 , 9][1 , 8][1 , 6][1 , 8] , [4 , 5] = [1 , 6][2 , 9][1 , 6 ][2 , 9][4 , 9 ][2 , 9][1 , 6][2 , 9][4 , 9][2 , 9][1 , 6][2 , 9][4 , 9][2 , 9][4 , 9] By transforming one of these t wo identit ies with a suitable isometry we ca n express any spin in S 1 × 2 as a pro duct of spins in S 2 × 3 . Thus hS 1 × 2 i ⊂ hS 2 × 3 i .  W e are now r e ady to pro ve our main theorem, which completely deter mines the combinations o f spin types tha t genera te Spin 3 × 3 . Theorem 3. Assume t hat m, n ≥ 3 . L et T b e a union of spin typ es S i × j , wher e 1 ≤ i, j ≤ 3 . F or T t o gener ate Spin m × n , it is su fficient for T to c ontain one of the fol lowing six sets: S 1 × 2 ∪ S 1 × 1 , S 1 × 2 ∪ S 1 × 3 S 1 × 2 ∪ S 2 × 2 ∪ S 3 × 3 , S 2 × 3 ∪ S 1 × 1 , S 2 × 3 ∪ S 1 × 3 S 2 × 3 ∪ S 2 × 2 ∪ S 3 × 3 . When m = n = 3 , this c ondition is also ne c essary. Pr o of. W e fir st prove sufficiency . By P r op osition 5, S 1 × 2 ∼ S 2 × 3 , so it is enough to prov e that eac h of the first three sets listed in the theorem g e ne r ates Spin m × n . As ab ov e, we spe c ify spins using co ordinates on a 3 × 3 bo ard, but these can co ordinates can b e trans ferred to an m × n boa rd as noted in the pro of of Prop o s ition 5. By Corolla ry 1 , the set S 1 × 1 ∪ S 1 × 2 generates Spin m × n . F o r S 1 × 2 ∪ S 1 × 3 , it is enough to sho w that S 1 × 1 ⊂ hS 1 × 2 ∪ S 1 × 3 i . W e note that eac h element of S 1 × 1 has the for m s i = ( ι , e i ), wher e e i is the weigh t 1 v ector in V N with the i th bit set. If ( α, u ) is a ny element o f Spin m × n with α (1) = i , then w e hav e ( α, u ) − 1 ( ι, e 1 )( α, u ) = ( α − 1 , u α − 1 )( ι, e 1 )( α, u ) = ( α − 1 , u α − 1 + e 1 )( α, u ) = ( ι, e α 1 ) = ( ι, e i ) . Since π ( hS 1 × 2 i ) = S N , b y Lemma 1, w e can generate a suitable ( α, u ) for each i from 1 to N . Thus it is enough to s how ho w to express the spin [1 , 1] as a pro duct of spins in S 1 × 2 ∪ S 1 × 3 : [1 , 1] = [1 , 2][1 , 4][1 , 3 ][1 , 4][1 , 2 ][4 , 6][3 , 6][4 , 6] . The s ame ar guments apply to the third set S 1 × 2 ∪ S 2 × 2 ∪ S 3 × 3 , thus it suffices to note that: [1 , 1] = [2 , 3][1 , 5][1 , 2 ][3 , 6][4 , 7 ][1 , 5][2 , 3][5 , 8][1 , 9][5 , 9][1 , 5][5 , 8][8 , 9] . W e now prov e the necessit y of the c ondition in the theorem, under the assump- tion m = n = 3. The se t T is the union of so me subset of the six spin types U =  S 1 × 1 , S 1 × 2 , S 1 × 3 , S 2 × 2 , S 2 × 3 , S 3 × 3  . 10 ALEX SUTHERLAND AND ANDREW SUTHERLAND Of the 64 subsets of U , one finds that 22 o f them hav e unions that are contained in S a or S d , thus T cannot b e the union of a ny of thes e 22 subsets. Conversely , one finds that 3 9 of the r emaining 4 2 subsets of U hav e unions containing one o f the 6 sets listed in the prop osition. The 3 r emaining subsets of U all hav e unions contained in S 1 × 2 ∪ S 2 × 3 ∪ S 3 × 3 , which w e now argue does no t generate Spin m × n . Since S 1 × 2 ∼ S 2 × 3 , it is eno ug h to show that S 1 × 2 ∪ S 3 × 3 do es not generate Spin m × n . By Lemma 6 b elow, a ny pro duct of elements in S 1 × 2 ∪ S 3 × 3 is equiv a lent to a pro duct in which the unique element of S 3 × 3 app ears only o nce, in the rig ht most po sition. It follows that the cardinality of hS 1 × 2 ∪ S 3 × 3 i is at most (in fact, exactly) t wice that of hS 1 × 2 i . But b y Lemma 2 b elow, the subgroup hS 1 × 2 i has trivial int eres e ction with ker π and th us ha s index 2 9 = 512 in Spin 3 × 3 . So hS 1 × 2 ∪ S 3 × 3 i is a prop er subg roup of Spin 3 × 3 .  Lemma 2. The r estriction of the pr oje ction map π : Spin m × n → S N to the gr oup G = hS 1 × 2 i is an isomorphism fr om G to S N . Pr o of. Let ˆ π : G → S N be the restrictio n o f π to G . The fact that ˆ π is surjective follows from Lemma 1, so we only need to show that ˆ π is injective. Let h b e any element of the kernel of ˆ π . T hen h = s 1 · · · s k is a pro duct of spins in S 1 × 2 , and h fixes the po sition of every tile on the m × n boar d. W e will show that h also fixes the orientation of ev ery tile, and therefore h is the iden tity . Consider tile t in p osition t on the standa rd bo ard b . If we apply h to b , ea ch spin s i po tent ially moves the tile t , but if it does , it alwa ys moves t to a n adjacent po sition on the boa rd, since s i ∈ S 1 × 2 . Thus t is mov ed a lo ng some path o n the m × n boa rd (p ossibly trivial) that must ev entually return t to its original p os itio n. The length o f this path is necessarily a n even in teger, therefore t is a lso returned to its or ig inal orientation.  Let T b e a subset of the spins in S . Generalizing o ur definition o f k ( m, n ), we define k ( m, n, T ) a s the dia meter of the Cayley graph Cay(Spin m × n , T ), and consider upper and low er bo unds for k ( m, n, T ). T o do so, we in tro duce a notion of weight for a spin, defined the total distance c overd by all the tiles it mov es. Definition 4. The weight of a r e ctangle R is wt( R ) = 2 P p ∈ R ρ ( p, R ) , and the weight of a spin s ab out R is wt( s ) = wt( R ) . W e ma y de no te the weigh t of a n i × j rectangle R by w ( i, j ), since it dep ends only on the dimensio ns of R , no t its lo c a tion. Lemma 3. L et ε : Z → { 0 , 1 } b e the p arity map. Then w ( m, n ) = 1 2  mn 2 + nm 2 − ε ( m ) n − ε ( n ) m  . Pr o of. When m and n are b oth even w e hav e w ( m, n ) = 4 · 2   m / 2 X i =1 n / 2 X j =1 ( i + j − 1)   = 1 2  mn 2 + nm 2  . THE MA THEMA TICS OF SPINPOS SIBLE 11 When m and n a re b oth o dd w e hav e w ( m, n ) = 4 · 2   m − 1 2 X i =1 n − 1 2 X j =1 ( i + j )   + 2 · 2   m − 1 2 X i =1 i + n − 1 2 X j =1 j   = 1 2  mn 2 + nm 2 − m − n )  . The ca ses wher e m and n hav e o ppo site parit y ar e similar and left to the rea de r .  Lemma 4. L et T b e any set of spins in Spin m × n . Then k ( m, n, T ) ≥ w ( m, n ) max { wt( s ) : s ∈ T } for al l m, n ≥ 1 . Pr o of. Let b ∈ S m × n , with wt( b ) = w ( m, n ). If s 1 · · · s k is a pro duct of spins in T equiv alent to b , then w ( m, n ) ≤ P wt( s i ) ≤ k w max . The lemma follows.  Lemma 5. Every element of Spin m × n c an b e expr esse d as the pr o duct of at most w ( m, n ) + mn spins in S 1 × 1 ∪ S 1 × 2 . Pr o of. Let b ∈ Spin m × n . W e will construct b − 1 = ( α, u ) by constr ucting an ele ment ( α, v ) as a pro duct of at mos t w ( m, n ) s pins in S 1 × 2 , to which we may then apply at most mn spins in S 1 × 1 to obtain ( α, v ). Let d = m + n − 2. Then d is the maximum ( ℓ 1 ) distance betw een any po sition and the center of the m × n r e ctangle R containing all the p ositions o n the boa rd. F or each position i at distance d fro m the cen ter (the 4 corners when mn > 1), we can mov e tile i to p o sition i using at mos t 2 d s pins in S 1 × 2 . Next we place the correct tiles in po sitions at distance d − 1 fro m the cent er, and ea ch o f these tiles can currently lie at most d − 1 p ositions awa y from the center (since the distance d p ositions ar e already filled with the correct tiles), thus we use at most 2( d − 1 ) spins in S 1 × 2 to place the correct tiles in the p os itions at distance d − 1 from the center. Note that we can do this by mo ving each tile along a path tha t do e s not disturb an y tiles that ha ve alrea dy b een pla ced. Contin uing in this fas hion, we use at most 2 ρ ( p, R ) spins to place the corre c t tile in positio n p , and the to ta l n umber of spins is at most wt( R ) = w ( m, n ).  Corollary 3. F or al l m, n ≥ 1 let T = T ( m, n ) b e a set of spins with weight b ounde d by some c onstant W . Than as N = mn → ∞ we have the asymptotic b ound k ( m, n, T ) = Θ( mn 2 + nm 2 ) . Mor e pr e cisely, for every ǫ > 0 ther e is an N 0 such t hat  1 2 W + ǫ  ( mn 2 + nm 2 ) < k ( m, n, T ) < (1 + ǫ )( mn 2 + nm 2 ) , for al l N > N 0 . F or m = n this giv es a Θ( N 1 . 5 ) bound, whic h ma y be contrasted with the Θ( N ) bo und of Cor ollary 2, wher e the weigh t of the spins was unrestricted. W e note that in the c ase o f Spin 3 × 3 and T = S 1 × 1 ∪ S 1 × 2 , Lemmas 4 and 5 give the b ounds 12 < k (3 , 3 , T ) < 33, compar ed to the actual v alue k (3 , 3 , T ) = 25. 12 ALEX SUTHERLAND AND ANDREW SUTHERLAND 4. Unique So lutions Certain elements of Spin m × n are disting uished by the fa ct that they ha ve a unique solution (a unique shortest expres sion as a pr o duct of spins). This is clearly the ca se, for example, when b ∈ S . There a re many le s s trivia l ex amples, some 2,203,4 01 of them in Spin 3 × 3 . Thes e include wha t appea r to b e the most difficult puzzles in the game, so me of whic h are featured in separ ate puzzle levels designated as “unique s ”. While these can b e quite challenging, knowing that the solution is unique can b e an aid to solving such a puzzle. W e b egin with a lemma used in the pro o f of Theo r em 3 , which also allows us to rule out many possible candidates for a unique solution. Lemma 6. L et b = s 1 · · · s i · · · s k b e a pr o duct of spins in Spin m × n , with i < k and s i ∈ S 1 × 1 ∪ S m × n . If s i ∈ S 1 × 1 , then b c an b e written as b = s 1 · · · s i − 1 s i +1 · · · s k t i with t i ∈ S 1 × 1 . If s i ∈ S m × n , then b c an b e written as b = s i · · · s i − 1 t i +1 · · · t k s i , with e ach t j a spin of t he same typ e as s j , for i ≤ j ≤ k . Pr o of. W e first supp ose that s i ∈ S 1 × 1 . Then the recta ngle R i of s i contains just a single p osition. Let R i +1 be the recta ngle of s i +1 . If R i is contained in R i +1 , then b y Pro p o sition 1 , we hav e s i +1 s i s i +1 = t with t ∈ S 1 × 1 . Multiplying on the left b y s i +1 , we have s i s i +1 = s i +1 t i , allowing us to “ shift” the spin s i to the right, potentially c hanging the loc a tion of its rectangle but not its t yp e. If R i is not contained in R i +1 then R i and R i +1 are disjoin t and we simply let t = s i , since then t and s i +1 commute. Applying the same pro cedure to s i +2 , . . . , s k , w e even tually obtain a pro duct b = s 1 · · · s i − 1 s i +1 · · · s k t i of the desired form (using a p otentially different t at each s tep). W e now suppo se that s i ∈ S m × n . Then the rectangle R i of s i cov ers the entire m × n b oard. Let R i +1 be the rectangle of s i +1 , whic h is necess arily c ontained in R i . W e then have s i s i +1 s i = t i +1 , where t i +1 is a spin of the s ame t yp e as s i +1 , and therefor e s i s i +1 = t i +1 s i . W e may pro ce ed in the same fashion to compute t i +2 , . . . , t k , even tually obtaining the desired pro duct b = s i · · · s i − 1 t i +1 · · · t k s i .  Prop ositi o n 6. Supp ose that s 1 · · · s k is the unique solut ion to a b o ar d b in Spin m × n . Then the fol lowing hold: (1) None of the s i ar e c ont aine d in S 1 × 1 or S m × n . (2) Conse cutive p airs s i and s i +1 have r e ctangles R i and R i +1 that overlap and do not shar e a c ommon c enter, with n either c ontaine d in the other. Pr o of. (1) follows from Lemma 6 and its pro of: if s i were an element of S 1 × 1 or S m × n we could o btain a different expression for b a s a pro duct of spins of the same length by “ s hifting” s i either to the left or rig ht. (2) follows from parts (3) and (4 ) of Prop os itio n 1.  W e co nc lude with a list o f so me op en pro ble ms : 1. Give a short pro of that k (3 , 3) = 9. 2. Determine k (4 , 4). 3. Determine whether lim n →∞ k ( n, n ) /n 2 exists, and if so, its v alue. 4. Analyze the distribution of solution leng ths in Spin m × n . 5. Determine which spin types S i × j are equiv alent. 6. Determine which combinations of spin types genera te Spin 4 × 4 . 7. Give bounds o n the num b er of b o a rds with unique so lutions in Spin m × n .

Original Paper

Loading high-quality paper...

Comments & Academic Discussion

Loading comments...

Leave a Comment