Algebraic Modeling of Rubik’s Cube with Group Theory

Research Article
Open access

Algebraic Modeling of Rubik’s Cube with Group Theory

Chenyu Jia 1*
  • 1 Xi'an Jiaotong Liverpool University    
  • *corresponding author Chenyu.Jia23@student.xjtlu.edu.cn
Published on 16 September 2025 | https://doi.org/10.54254/2753-8818/2025.DL26872
TNS Vol.132
ISSN (Print): 2753-8818
ISSN (Online): 2753-8826
ISBN (Print): 978-1-80590-305-5
ISBN (Online): 978-1-80590-306-2

Abstract

Transitioning from the practical manipulation of the Rubik’s Cube to its theoretical abstraction presents significant challenges, compounded by a scarcity of foundational resources facilitating this shift. To address this gap and establish a theoretical basis for abstract Rubik’s Cube analysis, this paper provides the fundamental methodology and key conclusions for constructing an algebraic model of the standard 3x3x3 Rubik’s Cube using group theory. Cube operations are defined using the definition of a group, and the concept of the Rubiks Cube group is formally introduced. Employing knowledge of permutation groups, it is demonstrated that any state of the cube can be represented by an element within the set denoted by the direct product of four special groups. Subsequently, by employing group actions, this paper successfully integrates the Rubik’s Cube group with the state space thereby completing the core algebraic modeling of the cube. Utilizing this model, the equivalence condition for solvable cube configurations: the sign of permutation in position of corner and edge are the same, and there was no single edge cube or corner cube artificially flipping. Finally, based on this equivalence, the number of solvable states for a standard 3x3x3 Rubik’s Cube is found.

Keywords:

Permutation group, Rubik's cube group, group action, direct product, reducible stat

Jia,C. (2025). Algebraic Modeling of Rubik’s Cube with Group Theory. Theoretical and Natural Science,132,130-138.
Export citation

1. Introduction

Group theory, pioneered by the French mathematician Évariste Galois in the nineteenth century, provides a rigorous abstract algebraic framework for characterizing symmetry. As a cornerstone of modern mathematics, this theory, through its quantitative unified language for symmetric structures, has profoundly reshaped multiple disciplines. The foundational significance of group theory cannot be overstated. As a revolutionary conceptual framework, it fundamentally reshaped the landscape of modern mathematics by providing the essential language to quantify and manipulate symmetry which is a universal principle governing both the natural and engineered worlds. Its axiomatic approach to structural invariance transcends specific applications, cementing its status as a cornerstone across scientific disciplines. Its significance extends beyond pure mathematics, forming an indispensable foundation for modern theoretical physics and crystallographic chemistry. The standard model of modern physics, Noether’s theorem, or the study of crystal structures in modern chemistry are all based on group theory [1-4]. Crucially, symmetrical principles manifest not only in natural phenomena but also permeate engineered systems, underscoring the universality of group theory. The Rubik’s Cube, a quintessential combinatorial puzzle invented in the twentieth century, exemplifies such engineered symmetry. The state transitions it undergoes via scrambling and restoration are governed by discrete spatial symmetry operations, thereby establishing an essential pathway for rigorous mathematical analysis grounded in group-theoretic principles.

Previous research has formalized the state space and operational mechanics of the Rubik’s Cube as the Rubik’s Cube Group which is a well-defined permutation group structure [5]. Landmark work in the 1980s leveraged this model, combined with computational enumeration, to derive an upper bound of 20 moves for the minimal number of turns required to restore any arbitrary configuration; this constant was designated the “God’s number” [6]. Its significance transcends merely solving a popular puzzle. It constitutes a profound validation of the theory’s power and universality. Moreover, it vividly exemplifies how esoteric mathematical abstraction provides indispensable tools for dissecting and mastering complex real-world systems exhibiting constrained transformations. This successful modeling effort powerfully reinforces the profound interconnectedness between pure mathematical theory and the analysis of complex rule-based systems. It demonstrates the theory’s unmatched capacity to reveal underlying order and optimal pathways beneath apparent chaos.

Although fundamental group-theoretic concepts such as permutation groups and commutators played pivotal roles in this achievement [7], a systematic exposition of the group-theoretic modeling methodology remains lacking in the existing literature. Current research mainly focuses on computational results, often neglecting pedagogical exposition of the underlying algebraic structures, resulting in a gap within the theoretical synthesis.

Therefore, this paper aims to bridge this gap by formally constructing the Rubik’s Cube group. It places particular emphasis on elucidating the fundamental process of modeling the cube group theoretically and focuses sharply on the profound connections between core group-theoretic concepts, specifically permutation groups and group actions on Rubik’s Cube.

The remainder of the paper is structured as follows: Section 2 details fundamental group theoretic concepts and theorems. Section 3 summarizes the algebraic formalization of the Rubik’s Cube. Section 4 concludes the whole paper and outlines open theoretical challenges.

2. Preliminaries on group theory

Definition 2.1: A group is an ordered pair  (V,)  where V is a set and  :V×V→V  is a binary operation satisfying:

1.  (vw)t=v(wt)  for all  (v,w,tV) 

2. There exists  (iV)  such that  (iv=vi=i)  for all  (vV) 

3. For every  (vV) , there exists  (v-1V)  such that  (vv=v-1v=i) 

Proposition 2.1: Let V be a group and  (v,w,tV). Then:

The identity i is unique(1)

The inverse  v1  is unique(2)

(v1)1=v(3)

(vw)1=w1v1(4)

vw=vtw=t and wv=tvw=t(5)

Proof:

1. Suppose i,i′ are identities. Then i = i·i′ = i′

2. Suppose w,t are inverses of v. Then: w = w · i = w · (v · t) = (w · v) · t = i · t = t

3. Since  (vv-1=v-1v=i) , v satisfies the inverse condition for  v-1 .

4. Compute: (vw)(w-1v-1)=v(ww-1)v-1=vev-1=vv-1=i 

Similarly,  (w-1v-1)(vw)=i) 

5. Left-multiply  (vw=vt)  by  (v-1) :  v-1(vw)=v-1(vt)(v-1v)w=(v-1v)tiw=itw=t 

Right cancellation follows symmetrically.

Definition 2.2. A subset H ⊆ V is a subgroup of V (denoted H ≤ V) if:

iH(6)

v,wH=vwH(7)

vHv1H(8)

Proposition 2.2. A nonempty subset  (HV)  is a subgroup iff  (ν,ωH),(νω-1H). 

Proof:

 () If  H  is a subgroup and  ν,ωH , then  ω-1H  and  νω-1H  by Definition 2.2.

 () Since  H , fix  νH . Then  ϵ=νν-1H . For any  ωH,ω-1=ϵω-1H . For closure: given  ν,ωH,ω-1H  implies  ν(ω-1)-1=νωH 

Definition 2.3. A group V acts on a set  Ω  if there exists a map  (φ:V×ΩΩ)(denoted(gξ))  such that:

ϵξ=ξforallξΩ(9)

g1g2ξ=g1g2ξforallg1,g2V,ξΩ(10)

Definition 2.4. The symmetric group  Sη  is the group of all bijections  σ:{1,,η}{1,,η})  under function composition.

Definition 2.5. A  κ-cycle (ξ1ξ2ξκ)  denotes the permutation satisfying:

ξιξι+1 (1ι<κ),ξκξ1(11)

with all other elements fixed. A 2-cycle is called a transposition.

Proposition 2.3. Every  σSη  decomposes uniquely (up to cycle ordering) into disjoint cycles.

Proof:

Define an equivalence relation on  {1,,η}  by  ιȷ  iff  ȷ=σλ(ι)  for some  λZ .  The equivalence classes partition  {1,,η}  , and  σ  restricted to each class is a cycle. Uniqueness follows from the orbit structure of  σ .

Definition 2.6. The sign of  σSη  is  sgn(σ)=(-1)μ  where  μ  is the minimal number of transpositions in any decomposition of  σ . A permutation is even if  sgn(σ)=1 , odd if  sgn(σ)=-1. 

Proposition 2.4.For  (σ,τSη): 

sgn(στ)= sgn(σ) sgn(τ)(12)

sgn(σ1)= sgn(σ)(13)

sgn(ξ1ξ2ξκ)=(1)κ1(14)

Proof:

1. Let  σ=τ1τϱ  and  τ=τ'1τ'ς  be minimal transposition decompositions. Then  στ=τ1τϱτ'1τ'ς  gives  sgn(στ)=(-1)ϱ+ς=(-1)ϱ(-1)ς= sgn(σ) sgn(τ). 

2.   sgn(σ) sgn(σ-1)= sgn(σσ-1)= sgn(i)=(-1)0=1. 

3. The  κ-cycle  decomposes as  (ξ1ξκ)(ξ1ξκ-1)(ξ1ξ2)(κ-1  transpositions). Minimality follows from  sgn(i)=1(-1)κ for  κ>1. 

Definition 2.7 The direct product of groups  V1,,Vκ  is  V1××Vκ  with operation:

(v1,,vκ)(w1,,wκ)=(v1w1,,vκwκ)(15)

For group A and  ηZ+,  define  Aη=A××Aηtimes. 

Definition 2.8. The cyclic group of order  η  is  Z/ηZ={0,1,,η-1}  with addition modulo  η. 

Proposition 2.5 In  Z/ηZ: 

1. The element  κ  has order  η/gcd(κ,η) 

2. Subgroups are cyclic of order  δ  where  δη 

Proof:

1. The order is the minimal  μ>0  such that  μκ0 (mod η) , i.e.,  η  μκ . This is  μ=η/gcd(κ,η). 

2. Let  HZ/ηZ . If  H={0},  done. Else let  δ=min{κZ+:κ mod ηH{0}}.  Then  H=δ , and  δ  η  since  η0H. 

3. Modeling the Rubik’s Cub

Assumption 3.1. Subsequent discussions refer specifically to the standard 3×3×3 Rubik’s Cube. The spatial orientation of the cube remains fixed during operations.

Definition 3.1. Fundamental moves are defined as clockwise 90◦ rotations of each face:

• U: Upper face rotation

• D: Down face rotation

• R: Right face rotation

• L: Left face rotation

• F: Front face rotation

• B: Back face rotation

Definition 3.2. Let W denote the set generated by arbitrary compositions of moves {U, D, R, L, F, B}. Elements of W are denoted w and termed valid operations.

Theorem 3.1.  (R,)  forms a group under operation composition, termed the Rubik’s Cube Group

Proof:

Associativity:   r1,r2,r3R, 

(r1r2)r3=r1(r2r3)(16)

Identity element :   U4  R such that   rR, 

rU4=U4r=r(17)

Inverse element : Obviously  U-1=U3,  with analogous inverses for R, L, D, F, B.

Since each basic move has an inverse element, their composite must also have an inverse element: we only need to reverse the order and execute the corresponding inverse element in sequence. Which means for all  r-1R  satisfying:

rr-1=r-1r=i(18)

Definition 3.3. According to the construction of the Rubik’s Cube, there are a total of 48 color blocks with adjustable positions. This paper refers to the set of 48 color blocks arranged arbitrarily as state set X. This paper have defined valid operations in Definition 3.3, and we call all states that can be obtained from valid operations valid states, and non valid states invalid states. The operation that can obtain an invalid state is called an invalid operation.

Theorem 3.2  (R,)  is a subgroup of  (S48,). 

Proof:

Each  rR  permutes 48 facelets  RS48 

R is a group (Theorem 3.1)

Thus  RS48 

Definition 3.4. Orientation assignment:

The following contents define the orientation of each cube

Corner cubes

Assuming that each cube at front-down-left position:

0 : down face

1 : left face

2 : front face

Edge cubes

Assuming that each cube at front-left position:

0 : left face

1 : front face

This paper defines the upper and down surfaces of all corner cube positions as the positive direction. The upper, down, front, and back surfaces of the edge cube are defined as positive directions. Then the orientation of the cube is defined as the number that coincides with the positive direction

Definition 3.5. Position indexing:

The following contents define the position of each cube

Corner positions:

– Top layer: 1 (front-up-left), 2 (front-up-right), 3 (back-up-right), 4 (back-up-left)

– Bottom layer: 5 (down-back-left), 6 (down-front-left), 7 (down-front-right), 8 (downback-right)

Edge positions:

– Top layer: 1 (up-back), 2 (up-right), 3 (up-front), 4 (up-left)

– Middle layer: 5 (back-left), 6 (back-right), 7 (front-right), 8 (front-left)

– Bottom layer: 9 (down-back), 10 (down-right), 11 (down-front), 12 (down-left)

Theorem 3.3. Any cube state is uniquely determined by:

Corner positions  ςS8 

Edge positions  ϱS12 

Corner orientations  ϰ(Z/3Z)8 

Edge orientations  ζ(Z/2Z)12 

Thus: State=(ς,ϱ,ϰ,ζ)S8×S12×(Z/3Z)8×(Z/2Z)12=:X(19)

Proof:

If the Rubik’s Cube has two states which all four conditions are the same, then their states

must also be the same.

Theorem 3.4. Twisting Rubik’s Cube in real life can be modeled as the following group action  P:R×XX  where  P(r,x)=rx 

This symbol defined as the state obtained by twisting a Rubik’s Cube with an initial state of r using R

Proof: Based on intuition from reality

(r1r2)x=r1(r2x)(20)

U4x=x  xX(21)

Theorem 3.5. Fundamental moves which are U,D,F,R,L,B,induce these permutations in Table 1:

Table 1. The permutations of fundamental moves

Operation

Positional Permutation

Orientation Change

U

Corners: (2 1 4 3)

Edges: (1 2 3 4)

 ϰ:(ϰ2,ϰ3,ϰ4,ϰ1,ϰ5,ϰ6,ϰ7,ϰ8 

ζ:(ζ4,ζ1,ζ2,ζ3,ζ5,ζ6,ζ7,ζ8,ζ9,ζ10,ζ11,ζ12)

D

Corners: (5 6 7 8)

Edges: (11 10 9 12)

ϰ:(ϰ1,ϰ2,ϰ3,ϰ4,ϰ8,ϰ5,ϰ6,ϰ7)ζ:(ζ1,ζ2,ζ3,ζ4,ζ5,ζ6,ζ7,ζ8,ζ10,ζ11,ζ12,ζ9)

R

Corners: (2 3 8 7)

Edges: (2 6 10 7)

ϰ:(ϰ1,ϰ7+1,ϰ2+2,ϰ4,ϰ5,ϰ6,ϰ8+2,ϰ3+1)

 ζ:(ζ1,ζ7,ζ3,ζ4,ζ5,ζ2,ζ10,ζ8,ζ9,ζ6,ζ11,ζ12) 

L

Corners: (1 6 5 4)

Edges: (4 8 12 5

ϰ:(ϰ4+2,ϰ2,ϰ3,ϰ5+1,ϰ6+2,ϰ1+1,ϰ7,ϰ8)

 ζ:(ζ1,ζ2,ζ3,ζ5,ζ12,ζ6,ζ7,ζ4,ζ9,ζ10,ζ11,ζ8) 

F

Corners: (1 2 7 6)

Edges: (3 7 11 8)

ϰ:(ϰ6+1,ϰ1+2,ϰ3,ϰ4,ϰ5,ϰ7+2,ϰ2+1,ϰ8)ζ:(ζ1,ζ2,ζ8+1,ζ4,ζ5,ζ6,ζ3+1,ζ11+1,ζ9,ζ10,ζ7+1,ζ12)

B

Corners: (3 4 5 8)

Edges: (1 5 9 6)

 ϰ:(ϰ1,ϰ2,ϰ8+1,ϰ3+2,ϰ4+1,ϰ6,ϰ7,ϰ5+2) 

ζ:(ζ6+1,ζ2,ζ3,ζ4,ζ1+1,ζ9+1,ζ7,ζ8,ζ5+1,ζ10,ζ11,ζ12)

Theorem 3.6. A scrambled cube state  (ς,ϱ,ϰ,ζ)X  is valid (solvable) if and only if:

sgn(ς)= sgn(ϱ)(22)

ι=18ϰι0(mod3), ȷ=112ζȷ0(mod2)(23)

Proof:

Part (1) sufficiency:

By Theorem 3.5, each fundamental operation (U, F, D, B, R, L) induces an even permutation (product of 4-cycles) on both corner and edge positions. For any valid operation  rR  composed of  κ  fundamental moves:

sgn(ς)= sgn(ϱ)=(-1)κ(24)

Thus  sgn(ς)= sgn(ϱ)  holds for all reachable states.

The orientation conditions follow directly from the transition rules in Table 1 (Theorem 3.5), which preserve the invariant sums modulo 3 (corners) and 2 (edges) under all fundamental operations.

Part (2) necessity:

A complete rigorous proof is available in reference [8].

Corollary 3.1. The physical interpretation of Theorem 3.6 is: A scrambled Rubik’s Cube can be restored if only if the sign of permutation in position of corner and edge are the same, and there was no single edge cube or corner cube artificially flipping.

Theorem 3.7. The total number of solvable states is ( 388!21212! )/12

Proof:

By Theorem 3.3, the combinatorial upper bound is:  388!21212! 

accounting for:

• 8! corner position arrangements

•  38 possible corner orientations

• 12! edge position arrangements

•  212 possible edge orientations

Applying Theorem 3.6 constraints:

Position parity:  sgn(ς)= sgn(ϱ)  eliminates half the configurations since odd permutation and even permutation are equally numerous

Corner orientation:  ϰι0 (mod 3)  eliminates 2/3 of configurations (lack 1 free orientation variable)

Edge orientation:  ζȷ0 (mod 2)  eliminates half the configurations (lack 1 free orientation variable)

The constraints are independent, so the fraction of solvable states is:

12×13×12=112(25)

Thus the total solvable states are:

112(388!21212!)(26)

4. Conclusion

This paper establishes an algebraic model for the standard 3×3×3 Rubik’s Cube using group theory, laying the groundwork for theoretical investigations. Employing permutation groups to define the states of the cube and the recoverable states. Fundamental operations on the cube are rigorously defined using concepts from group theory. Furthermore, unifying cube operations with their resulting state changes through the application of group actions. This approach not only completes the modeling of the standard cube but also advances to derive the conditions for recoverability and the total number of recoverable states. However, the scope of this study is confined to the 3×3×3 cube. While the methodology can be naturally generalized mathematically to arbitrary n×n×n cubes, modeling non-cubic puzzles such as regular polyhedral cubes or heartshaped cubes necessitates alternative approaches. Future work will focus on conducting deeper algebraic modeling studies of these irregular puzzles.


References

[1]. Ananthanarayan, B., Das, S., Lahiri, A. et al. (2024) Group theory in physics: an introductionwith mathematics. Eur. Phys. J. Spec. Top., 233, 1443–1513.

[2]. Ramadevi, P. and Dubey, V. (2019) Group Theory for Physicists: With Applications. Cambridge University Press, Cambridge.

[3]. Fonseca, Q.M. (2021) Comput. Phys. Commun. 267, 108085.

[4]. Gururajan, M.P. (2019) Symmetry Relationships between Crystal Structures: Applicationsof Crystallographic Group Theory in Crystal Chemistry. Contemporary Physics, 60, 83–84.

[5]. Comock, C. (2015) Teaching group theory using Rubik’s Cubes. International Journal of Mathematical Education in Science and Technology, 46, 957–967.

[6]. Joyner, D. (2014) The man who found God’s number. The College Mathematics Journal, 258-266.

[7]. Sun, T. (2023) Commutators in the Rubik’s Cube Group. The American Mathematical Monthly, 131, 3–19.

[8]. Chen, J. (2007) Group theory and the Rubik’s cube. Harvard University.


Cite this article

Jia,C. (2025). Algebraic Modeling of Rubik’s Cube with Group Theory. Theoretical and Natural Science,132,130-138.

Data availability

The datasets used and/or analyzed during the current study will be available from the authors upon reasonable request.

Disclaimer/Publisher's Note

The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of EWA Publishing and/or the editor(s). EWA Publishing and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

About volume

Volume title: Proceedings of CONF-APMM 2025 Symposium: Simulation and Theory of Differential-Integral Equation in Applied Physics

ISBN:978-1-80590-305-5(Print) / 978-1-80590-306-2(Online)
Editor:Marwan Omar, Shuxia Zhao
Conference date: 27 September 2025
Series: Theoretical and Natural Science
Volume number: Vol.132
ISSN:2753-8818(Print) / 2753-8826(Online)

© 2024 by the author(s). Licensee EWA Publishing, Oxford, UK. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license. Authors who publish this series agree to the following terms:
1. Authors retain copyright and grant the series right of first publication with the work simultaneously licensed under a Creative Commons Attribution License that allows others to share the work with an acknowledgment of the work's authorship and initial publication in this series.
2. Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the series's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgment of its initial publication in this series.
3. Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See Open access policy for details).

References

[1]. Ananthanarayan, B., Das, S., Lahiri, A. et al. (2024) Group theory in physics: an introductionwith mathematics. Eur. Phys. J. Spec. Top., 233, 1443–1513.

[2]. Ramadevi, P. and Dubey, V. (2019) Group Theory for Physicists: With Applications. Cambridge University Press, Cambridge.

[3]. Fonseca, Q.M. (2021) Comput. Phys. Commun. 267, 108085.

[4]. Gururajan, M.P. (2019) Symmetry Relationships between Crystal Structures: Applicationsof Crystallographic Group Theory in Crystal Chemistry. Contemporary Physics, 60, 83–84.

[5]. Comock, C. (2015) Teaching group theory using Rubik’s Cubes. International Journal of Mathematical Education in Science and Technology, 46, 957–967.

[6]. Joyner, D. (2014) The man who found God’s number. The College Mathematics Journal, 258-266.

[7]. Sun, T. (2023) Commutators in the Rubik’s Cube Group. The American Mathematical Monthly, 131, 3–19.

[8]. Chen, J. (2007) Group theory and the Rubik’s cube. Harvard University.