You can't trust code that you did not totally create yourself.
-- Ken Thompson
I have realized that I have to put intuition aside for now so that it is possible to solve the 4D skewb before running out of time. What we need now is a extremely effective way to generate useful algorithm and apply them to the puzzle.
Usually this is not my style to enjoy a puzzle. I tend to take my time and slowly discover the algorithms I want to use. This time, I decide to speed up things a little bit, with the concept of commutator. You can find the definition of it everywhere, so you may have seen this pattern X``Y``X^-1``Y^-1
, but I want to share with you my understanding to this pattern.
X
and Y
are two different sequences of some operations. The four steps is like,
X
. Nothing special here.Y
. A few cases here. All of them are trivial except for the last.Y
happends to be X^-1
, the reverse sequence of X
, then this step will cancel the effect of X
, leaving the puzzle the state before X
was applied as if it was untouched.Y
happends to be X
, it just accumulates the X
sequence twice, which will later be cancel by two consequtive X^-1
s.Y
has nothing to do with X
, then the two sequences will later be their respective reverse sequences canceled.X
and Y
considering the original position before X
. In this case, after Y
is applied, some positions that previous pieces are moved away by X
now are occupied by pieces from performing Y
. We call these pieces set 1. On the opposite, some positions that were occupied by pieces because of X
now are moved away by Y
. We call these pieces set 2.X^-1
. This moves set 1 back to its trajetory.Y^-1
. Not only set 2 is officially part of the trajectory now, but also move away some pieces X^-1
brought.Hmm... I am not satisfied with my explanation either. Let's consider an example, a simple game consists of 5 numbers on two triangles that share a vertex, like this
1
/ \
/ \
2---3---4
\ /
\ /
5
Let X
be the clockwise rotation of the upper triangle and Y
be that of the lower one. The four steps will be
X
:
2
/ \
/ \
3---1---4
\ /
\ /
5
Y
:
2
/ \
/ \
3---5---1
\ /
\ /
4
X^-1
:
5
/ \
/ \
2---3---1
\ /
\ /
4
Y^-1
:
5
/ \
/ \
2---1---4
\ /
\ /
3
The net effect of this commutator is thus a 3-cycle of 1-3-5.
Anyway, I hope that the above reasoning is convicing enough. I will move on to make some algorithms from trying different commutators and see if they are useful.
But even if we have the algorithms, how to play them in this poor system? We didn't use any macro featurs back in 2x2x2x2 solving, but now it seems that 4D skewb is way more easier to be messed up, so I think I need something like that. I will just expand the redo function so that it can recognize more alphabets, and each of the newly-added alphabets are algorithms.
The latest features can be found at my repo, as usual.
Remember our goal? Edges, tetrahedra, octahera. For edges, an ideal algorithm can mess up the whole puzzle, but it affects just some edge pieces. Then it becomes trickier because we already settle all edges. The ideal algorithms for the two last stages should not ruin the edges, but only center stickers.
My meta-method is just to combine some X
and some Y
, and then keep pressing my redo
button to see if it delivers a good pattern. Let's go!
X=0
and Y=1
So the commutator is 0,1,0,0,1,1
. Applying this to a reset puzzle gives us
Doesn't look like it is useful. It just changes too many pieces. Still we can try more redo
to see its effect,
Applying three times, its getting interesting now. The edges seem not far from the original state. The following clips can show that,
This is actually a 5-cycle affecting 5 pieces, they are (the former goes to the later),
Note that we are not directly using the commutator. We are using three times of it, specifically,
0,1,0,0,1,1,0,1,0,0,1,1,0,1,0,0,1,1
Also note that, we minimized the explode distance to simplify the screen. Inside each cell, the center stickers are wild. The reader can check the actual situation themselves. A further idea on this is: can we treat 15x(1,0,1,1,0,0)
as an algorithm for center pieces? Of course! But I am not sure if they will be useful or not.
X=0
and Y=1,1
, or X=1
and Y=2,2
So the commutator is 0,1,1,0,0,1
. In the believe of symmetry, we can try applying three times of this to a reset puzzle, which gives us
Looks similar. The rough difference is like, the previous algorithm feels like a circle from Y-
, Z+
, Y+
, Z-
, and back to Y-, but this looks like X+
, Z+
, X-
, Z-
, and back to X+
. If we change the commutator to 1,2,2,1,1,2
, then theoretically we have something like the reverse cycle of the previous algorithm. Give it a try, and concate the two,
A0,A1
: Z+ remains intact
A1,A0
: Y+ remains intact
After some trials, define
A2 = 2,2,1,2,1,1
, the reverse sequence of A1's base commutatorA3 = A1,A0,A0,A0,A2,A2,A2,A0,A0
A4 = A1,A0,A0,A2,A2,A2,A0,A0,A0
Interesting, both A3 and A4 give us 3-cycle to 6 pieces. Maybe we can find some way to further combine them and form a 2-cycle?
A4,X,X,A3,y,y is interesting too.
Hey, if the commutator sequences duplicated 3 times become a 5-cycle, doesn't it mean that 5 such sequences will be a 3-cycle? Let's see
A6 = 0,1,0,0,1,1,0,1,0,0,1,1,0,1,0,0,1,1,0,1,0,0,1,1,0,1,0,0,1,1
Yes, it is, but a complicated set as follows. If no cell is specified, it means W-,
Based on the positional W- 3-cycle, I think the pure rotation sequence
Y,z,X,X,y
can reverse the position, so I triedA6,Y,z,X,X,y,A6
. It turns out being some combination of pure rotations. All cells remain complete. Cool.
Let's check the twin commutator, 5 times as well,A7 = 0,1,1,0,0,1,0,1,1,0,0,1,0,1,1,0,0,1,0,1,1,0,0,1,0,1,1,0,0,1
Sequence A6,A7
turns out to be a 18-cycle. After reducing it into half, The 9xA6,A7
is a 2-cycle affecting 4 pieces,
1,2,2,1,1,2,1,2,2,1,1,2,1,2,2,1,1,2,1,2,2,1,1,2,1,2,2,1,1,2
2,3,3,2,2,3,2,3,3,2,2,3,2,3,3,2,2,3,2,3,3,2,2,3,2,3,3,2,2,3
3,4,4,3,3,4,3,4,4,3,3,4,3,4,4,3,3,4,3,4,4,3,3,4,3,4,4,3,3,4
2,5,5,2,2,5,2,5,5,2,2,5,2,5,5,2,2,5,2,5,5,2,2,5,2,5,5,2,2,5
A6,A7
to make it a 2-cycle affecting two pairs, and they will be (variant 1)
Y,Z,y
is cool as well (variant 2)Variant 1:
Variant 2:
It must be boring to read these trial-and-error dumps. Yet I don't think we have get converge results. Some 3-cycles or 2-cycles look controllable, but I think we can find better one. Also, other concern of mine is that we don't know how to deal with orientation yet. What if all edges are at their right position but some have the wrong rotation? We need to develope weapons for them.
So keep moving.
Let's sort them out. I will keep only some of them as follows,
0,1,0,0,1,1,0,1,0,0,1,1,0,1,0,0,1,1,0,1,0,0,1,1,0,1,0,0,1,1
2,5,5,2,2,5,2,5,5,2,2,5,2,5,5,2,2,5,2,5,5,2,2,5,2,5,5,2,2,5
A0,A1
A2,A2,A2
(the 2-cycle variant 1)Recall the two pairs:
Since the 3 edge pieces O2-O5/O4-O5/O5-O6 are themselves in a 3-cycle, we can try the following sequence to get a 3-cycle on 3 edges:
A4 = A3,X,5,x,A3,X,5,x,A3,X,5,x,A3
X
is to center X- cell first, then twist 5 to start rolling the 3-cycle O2-O5/O4-O5/O5-O6, and move it back to X-. The second and the forth A3
resumes the first pair because it is a 2-cycle, so in the end there is only X-O2-O5/X-O4-O5/X-O5-O6 changes. Specifically, the cycle is like
X-O2-O5 (white-orange-null-coffee) -> X-O5-O6 (white-null-orange-coffee), orientation-wise Y<->Z
X-O5-O6 (orange-null-green-coffee) -> X-O4-O5 (coffee-orange-green-null), orientation-wise X->Y->W->X
X-O4-O5 (orange-white-green-null) -> X-O2-O5 (green-white-null-orange), orientation-wise X->W->Z->X
This is the most powerfull algorithm we find so far: 3-cycle for 3 edge pieces! With this we can solve the edge positions, but then, how to handle the orientations?
After more hours, revisiting the basic commutator 0,1,1,0,0,1
pays me back. Finally, we have a pure rotation 3-cycle algorithm affecting only 3 pieces at a time! Define the following new sequences,
A5: 0,1,0,0,1,1,0,1,1,0,0,1
(This alone is a 66-cycle)
A6: A5,A5,A5,A5,A5,A5,A5,A5,A5,A5,A5,A5,A5,A5,A5,A5,A5,A5,A5,A5,A5,A5
(22xA5, happens to be a pure orientation sequence)
The effect of A6 is
We can rotate the whole puzzle around Z+ for 180 degree, so that the first two orientations replace each other. We can than apply A6 again to resume the their original position. Meanwhile, due to the rotation of the whole puzzle, the third effected piece will be a new one. The net effect of the above sequence should then be a 3-cycle pure rotation algorithm to two pieces that both have a sticker in Y- cell.
Specifically, the sequence can be:
A7 = A6,y,y,Z,Y,X,y,x,Z,A6,A6,z,X,Y,x,y,z,Y,Y
The effect of A6 is
Recall our progress so far,
X,X,6,6,Z,Z,Z,7,7,0,0,0,2,6,6,2,2,6,7,4,x,x,2,2,6,6,5,5,6,0,1,0,0,6,6,1,6,Z,Y,Y,x,x,z,3,3,3,3,3,3,3,3,3,3,3,3,1,1,1,1,1,1,y,0,0,Y
The reader may wonder, if I have the initial sequence, why not just revert it and get back to the original state? Well, the solve itself would be meaningless because I still don't know how to solve the 4D skewb.
As usual, let's settle all edges' position first, and then their orientation. Previously we left yellow with two out-of-cell pieces, let's get them back. Remember, our main weapon, A4, can do positional rotation like a O5' twist to X- with some orientation change.
Settle X-,
y,x
Send the mis-placed white-orange-pink to X-; Also, move the yellow cell away so that Y-O5-O6 will not be corrupted by A4,
0,Y,Y
Move it to a position so that yellow-blue-coffee will come after an A4. Also notice not to mess up the two yellow stickers coming together with it,
X,2,x
Do the turn and resume,
A4,X,2,2,x,y,y,0,0,X,Y
Move white-pink-orange to X-,
Z,4,4
Adjust yellow-orange-coffee's position for A4,
y,X,3,2,x
Do A4 and resume,
A4,X,2,2,3,3,x,Y,4,z
The yellow cell, position-wise done.
From O1,
Let's move green-pink-white from X-O2-O3 to Z-O6-O7 (red-blue-pink).
Adjust red-blue-pink's position for A4,
4,X,5,5,2,x,
Do A4 and resume,
A4,X,2,2,5,x,4,4
From O1,
Let's move green-red-pink from X-O2-O3 (again?) to Z-O1-O6 (blue-white-red).
Since two pieces have stickers in X-, we can directly do the setup,
X,2,6,6,
We cannot directly move back to X- now, because the thrid piece in the cycle contains a green sticker, so more setup steps,
5,6,x,
Do A4 and resume,
A4,X,6,6,5,5,6,2,2,x
From O3,
Challenge: moving them altogether! The former is at X-O3-O4, and its destination is Z-O0-O7. The second is now at Z-O3-O4 and its destination is Z-O4-O7. At Z-O4-O7, there is the third, green-coffee-orange that wants to return to Z-O3-O4. We don't have a algorithm for swapping two pieces, so I think it would be better to do two A4s. The first is to perform
And the second A4 we can have
Let's do it!
The three pieces have one sticker each at X+ now, so we can center X+ first.
x,
Refine the goal,
It turns out that it is easy to be A4-ready,
7, x, y
A4 and resume,
A4,Y,X,7,7,X
From O3,
Now Z- contains three pieces, so we center it, and make the three a proper tetrahedron at O4,
Z,4,4,7,7,
Make it A4-ready,
x,y,
A4 and resume,
A4,Y,X,7,4,z
We can apply A7 to sort their orientation first, to make the puzzle look nicer. First green stickers, (and I sadly find that green-coffee-white should not be there...)
A7,A7,Z,y,X,Y,z,A7,A7,
Then, the yellows,
y,x,Y,z,A7,X,A7,Z
From O1,
Set them A4-ready,
y,6,6,1,x,Y,
A4 and resume,
A4,y,X,1,1,6,Y,
Fix their orientations,
X,X,y,z,A7,y,A7,A7
From O3,
From O1,
The three are a bit scattered, no obvious good move for me to tell.
X,4,x,4,
Now X- hold the three, center to settle them,
X,5,5,4,4,2,x,
A4 and resume,
A4,X,2,2,4,5,x,4,4,X,4,4,x,
From O1,
Fix the orientation,
y,y,X,A7,A7
X+ contains them all, so center it, and set it A4-ready
x,2,0,3,4,4,x,
A4 and resume,
A4,X,4,3,3,0,0,2,2,X,
Although there are two at W-, it is easier to move the two to join the other one,
y,0,0,
Center Z-, and settle the three,
Z,0,0,1,1,6,6,x,y,y,
A4 and resume,
A4,Y,Y,X,6,1,0,z,0,Y
From O3,
It is cool that these three are a perfect fit for the 3-cycle. Do some more orientation fix here...
Z,y,X,Y,z,A7,X,A7
From O3,
The 4-cycle is,
If we just choose any three of them to apply A4, there will be a swap that's troublesome to fix, so we choose a irrelevant one as a immediate.
Bring the second to Y-O4-O5,
4,4,
Center Y- and setup,
Y,2,2,1,1,6,x,
A4 and resume,
A4,X,6,6,1,2,y,4,
From O2,
It ends up we remove the gree-orange-white out of the green cell. It has to be removed anyway because it needs swapping with the other green piece. Now there is a convenient 3-cycle,
The are all at Y- and themselves are a counerclockwise tetrahedron shape, so it is straitforward,
x,Z,Y,x,A4,X,y,z,X,
From O2, it looks good for green cells
Move the third to Y-, center them, and make it A4-ready,
1,z,X,X,Y,4,3,2,4,4,x,
A4 and resume,
A4,X,4,2,2,3,3,4,4,y,x,x,Z,1,1,
From O3, basically, all the edges are now at their position.
It is not trivial to setup for A7, so some random attempt first,
Y,z,y,x,A7,
From O3,
Fix two pieces together, then what? Hmm... This puzzle, even if just considering edges, still keeps pushing me over the limit. No specific thought for now.
After some trials, I have a rough idea. Maybe it is hard to settle them pair by pair, is because the distribution of mis-oriented pieces are not balenced. Some cell has many and some are finished. Maybe I don't have to afraid ruining finished cells. So, I will tri to put most incomplete cells in the Z-O3-O4 first,
x,x,A7,
From O3,
X,y,x,y,A7,A7
From O3,
x,y,y,A7
From O3,
Z-O3-O4
Now it is more clear that it is not possible to reliably craft a situation where both Z-O3-O4 and X-O2-O3 is the piece to be fliped. So the idea is, we first settle Z-O3-O4, and hope that a flippable piece is near X-O2-O3, so that we can condugate the piece with A4 to move it to X-O2-O3. Then, applying A7, and resume the whole condugated A4 sequence, which should then be effectively two orientational changes to the two pieces. So,
Settle Z-O3-O4 (white-coffee-blue).
x,
The flippable green-white-pink is at X-O0-O1. Theoretically we can do a condugated A4 to make it X-O2-O3, which requires centering X- first,
X,2,0,0,3,4,4,x
A4 and resume A4 setups,
A4,X,4,3,3,0,2,2,x
From O3, note that X-O2-O3 has become pink-green-white,
A7 and resume the condugated A4 effect,
A7,X,2,0,0,3,4,4,x,A4,A4,X,4,3,3,0,2,2,x
From O3, it works pretty well!
z,z,x,y
From O2, the flippable yellow-orange-blue is at X-O5-O6,
Condugate A4,
X,5,5,2,x,A4,X,2,2,5,x
A7 and resume the condugated A4 effect,
A7,X,5,5,2,x,A4,A4,X,2,2,5,x
From O2, whoa!
How about opening it and see what is inside?
X,X,6,6,Z,Z,Z,7,7,0,0,0,2,6,6,2,2,6,7,4,x,x,2,2,6,6,5,5,6,0,1,0,0,6,6,1,6,Z,Y,Y,x,x,z,y,0,0,Y,y,x,0,Y,Y,X,2,x,A4,X,2,2,x,y,y,0,0,X,Y,Z,4,4,y,X,3,2,x,A4,X,2,2,3,3,x,Y,4,z,X,2,6,6,5,6,x,A4,X,6,6,5,5,6,2,2,x,x,7,x,y,A4,Y,X,7,7,X,Z,4,4,7,7,x,y,A4,Y,X,7,4,z,A7,A7,Z,y,X,Y,z,A7,A7,y,x,Y,z,A7,X,A7,Z,y,6,6,1,x,Y,A4,y,X,1,1,6,Y,X,X,y,z,A7,y,A7,A7,X,4,x,4,X,5,5,4,4,2,x,A4,X,2,2,4,5,x,4,4,X,4,4,x,y,y,X,A7,A7,x,2,0,3,4,4,x,A4,X,4,3,3,0,0,2,2,X,y,0,0,Z,0,0,1,1,6,6,x,y,y,A4,Y,Y,X,6,1,0,z,0,Y,Z,y,X,Y,z,A7,X,A7,4,4,Y,2,2,1,1,6,x,A4,X,6,6,1,2,y,4,x,Z,Y,x,A4,X,y,z,X,1,z,X,X,Y,4,3,2,4,4,x,A4,X,4,2,2,3,3,4,4,y,x,x,Z,1,1,Y,z,y,x,A7,x,x,A7,X,y,x,y,A7,A7,x,y,y,A7,x,X,2,0,0,3,4,4,x,A4,X,4,3,3,0,2,2,x,A7,X,2,0,0,3,4,4,x,A4,A4,X,4,3,3,0,2,2,x,z,z,x,y,X,5,5,2,x,A4,X,2,2,5,x,A7,X,5,5,2,x,A4,A4,X,2,2,5,x
The journey has just begun, and it was a crazy sleepless night. I hope everyone can one day enjoy complicated puzzle as I do. It is fun that looking backward, everything is so straightforward yet before the Ah-Ha moments, all in front of me were pure uncertainty of chaos. Now I am here and at least finishing 4/13 of the puzzle, and there is less than 42 hours to figure out the rest internal pieces. Keep fighting.
以兩個核心公式完成邊塊。