# Unscrambling the cube

Discussion in 'General Science & Technology' started by noodler, Nov 11, 2009.

Not open for further replies.
1. ### BlindmanValued Senior Member

Messages:
1,425

Like this.
Recursive count to 100
Code:
int i = 0;
void Count(){
if(i==100) return;
i++;
Count()
}

void main()
{
count()
}

Sequential count to 100
Code:
void main()
{
int i;
for(i = 0; i<=100; i++){}
}

Which is simpler???

3. ### noodlerBannedBanned

Messages:
751
Yeah.

Well. which is the simplest way to find a recurrence for the pocket cube? How would you, for example, go about looking for one, and are the three formulas I've posted a recurrence that is valid for the 3x3x3?

If the last is true and the three formulas are valid, what relation do they have to the posted sequence? What does the sequence say, and what do the posted formulas say, about each other?

5. ### BlindmanValued Senior Member

Messages:
1,425
OK noodler its late here, 3am ill look at your formulas again, but thats tomorrow.. Night and ill respond in daylight.

7. ### noodlerBannedBanned

Messages:
751
I'm sorry, I didn't spot this before:
You asked what "the n below the alpha" means.

$a_n\; =\; a_{n-1}\; +\; a_{n-2}$

Do you think this is a recursive formula or a recurrence? Is there a difference? Is the formula mathematical or algorithmical, or is it neither?

8. ### domesticated omInterplanetary homesteaderValued Senior Member

Messages:
3,231

Code:

int count(int selected_value)
{
int x = 0;
for (int i = 1; i <= selected_value; i++)
{
x = x + 1;
}
return x;
}

void main()
{
for (int z = 0; z <= 100; z++)
{
if (z == 100)
{
count(z);
}
}
}

Sorry - couldn't resist

Last edited: Jan 27, 2010
9. ### BlindmanValued Senior Member

Messages:
1,425
domesticated om cant realy see the point of the code you posted. Recursive code is simply a function that calls its self. Your code is counting 3 variables up to 100 x,z, and i and is not recursive. Also there is a syntax error.

The first line:
void count(int selected_value)

Should be:
int count(int selected_value)
and the returned int is dumped from the stack on return to the main function but that is valid.

Or just remove the line:
return x;

Sorry just being picky.

10. ### domesticated omInterplanetary homesteaderValued Senior Member

Messages:
3,231
Ah -- thank you sir

11. ### BlindmanValued Senior Member

Messages:
1,425
Is neither in its form.

Once again solved via sequential code.
Code:
// Fn = Fn-1+Fn-2

int F[100];
int i;
F[0] = 0;
F[1] = 1;

void main()
{
for(i = 2; i < 100; i++)
{
F[i] = F[i-1]+F[i-2];
}
}
or recursive
Code:
int F[100];
F[0] = 0;
F[1] = 1;

void NextF(int index)
{
if(index == 100) return;
F[index] = F[index-1]+F[index-2];
index++;
NextF(index);
}

void main()
{
NextF(2);
}

Both examples fill the array F[] with the set of Fibonacci numbers, one is sequential and the other is recursive. Interestingly this can not be done in parallel as each entry in the array depends on the previous.

12. ### noodlerBannedBanned

Messages:
751
So, a formula for the Fibonacci numbers isn't recursive, or mathematical?

Sorry, I think that's wrong. Fibonacci numbers are logarithmic, and logarithmic functions are recursive and involute. The Fibonacci numbers are therefore recursive forms of integers.

$a_n\; =\; a_{n-1}\; +\; a_{n-2},\;\; a_1\; =\; b_1\; =\; Z$

Last edited: Jan 27, 2010
13. ### domesticated omInterplanetary homesteaderValued Senior Member

Messages:
3,231
BTW - on the one I posted. I was just joking around. I was trying to demonstrate recursion by nesting one task inside a replica of the same task.

14. ### BlindmanValued Senior Member

Messages:
1,425
Technically not recursion. I have only used recursion a few times in commercial code. In the days before Z buffers for 3d rendering, I used it for navigating the linked list result of a tree sort. For bucket fill algorithms and my favorite was a self modifying recursive sprite render written in assembly way back in the 486cpu days. Anyways off subject

15. ### BlindmanValued Senior Member

Messages:
1,425
The formula F[n]=F[n-1]+F[n-2] (excuse the format i have used code notation) represents one iteration and is invalid without defining F[n-1] and F[n-2]. it is thus not an explicit example of recursiveness.

Don't you mean exponential ???

Also what are Beta[1] and Z and how do they relate to the Fibonacci sequence? How does this relate to the cube?

16. ### noodlerBannedBanned

Messages:
751
F[n]=F[n-1]+F[n-2] is only one iteration if it's iterated once. And there isn't any reason that the formula as written implies that n is an integer.

Since n is undefined,I can assume it's a value like 3.14159, say.
If I define bounds for n by setting F[1] = F[2] = 1, does that make the whole thing a complete description?

If F[n] = F[n-1] + F[n-2], F[1] = F[2] = 1 is a complete description, what does it describe? How big a stack is needed to recurse through [the formula for] n?

17. ### BlindmanValued Senior Member

Messages:
1,425
Noodler n must be an integer as it is an index into an array of discrete values. As for n = to an irrational number like pi or the square root of 2 is completely uncomputable.

if x < n <= z then the stack [array] size is equal to (z-x)+2. x and z are any two arbitrary integers with z>x.

18. ### noodlerBannedBanned

Messages:
751
But F[n], or Fn doesn't say that specifically. This is why n needs to be defined with the function, or n can be any number, including an irrational. It isn't the case that "n must be an integer" until the formula says so.

But back to the series. There are two that correspond to the corner pieces being permuted. If the series given by the formulas I posted (and once again, these aren't my property) is for the FTM, is that related by a similar recurrence (formula) to the first two, and if the formulas say that s(0) = 3/2, can this ratio be assumed to be part of the recurrence relation?

IOW, we need a 3-ary and a 2-ary number to form the recurrence formula, for the pocket cube?

19. ### BlindmanValued Senior Member

Messages:
1,425
2by2 cube. Lets ignore orientation first off.

8 pieces 8! = 8*7*6*5*4*3*2*1 = 40320 possible combinations of position.
Each piece can have 3 orientations thus 3^8 = 6561.

Thus for each position combination 40320 there are 6561 possible orientation combinations.
40320*6561 = 264,539,520 absolute combinations.

But then there is the problem of symmetry and the orientation of the 2by2 cube. We can orient the cube so that one piece is always in the same position and orientation. So it has 8 positions and 3 orientations that is 8*3=24 symmetry's can be found.

Thus as one position is fixed we have 7!= 7*6*5*4*3*2*1= 5040 and 3^7=2187.
Result 5040*2187=11022480 possible combinations excluding symmetry.

Sorry noodler but cant be bothered to find which formulas your talking about could you repost as you have posted lots of formulas..

20. ### noodlerBannedBanned

Messages:
751
There are three sequences:

S1 = 18, 243, 3240, 43234, ...
S2 = 9. 54, 321, 1847, ...
S3 = 6, 27, 120, 534, ...

S1 is the first 4 terms (excluding 1) for the 3x3x3, S2 is likewise for the 2x2x2, and S1 and S2 are for moves in the FTM. S3 is the sequence for the first 4 moves for the 2x2x2 in the QTM.

What, given the formulas previously posted, is the relation between S1, S2, and S3?

Simple huh?

(ed: mistakes corrected)

Last edited: Jan 29, 2010
21. ### noodlerBannedBanned

Messages:
751
Color coding and compression of codes:
"
Consider that the elements of a Rubik's cube are composed of black plastic. The assembled structure is then [what I will bang ahead and write as] a B-structure, or a B, with structure (i.e. black plastic with structure). There is a set g which maps B to itself. This structuring uses black as an abstract basis and plastic as a physical basis, hence there is a space within a space.
The structure set S is open, since structure is based on d a number of spatial dimensions, and N a number of sections of B which form a cell (of color elements). B is also the base for a number of colors (C), also an open set.
The group of operations on B is closed under the structure group of S in SO(n=d), S includes the slice group of G which is the set of planes in position, pairwise parallel or orthogonal (i.e. that form a cube-relative shape or cuboid).

Together C and B form a code-group where b is the number of 0 bits in any code, that can be written or rewritten in C.
C is degenerate, and is a function of arity of the b-sets. In B, this correlates to a mapping function F.
F is the set containing the spatial encoding (the face group) which is closed under rotation, and association (since the faces associate cube-wise, by construction and therefore by any map to B).

The rotation generators, or rotors, induce transpositions in the code word W, which is the "inital map" at T.
Since C is essentially a set of pairwise subsets of color, C has 2-arity by construction. There is a triadic component in G the generator set, which is divided by C, over b the number and order of zeros in W. This component is the set K of 3-faceted elements of B, when they have a pair of colors c in C, and C is closed. The pair can be on two separate elements of K or on the same element[, which is the swapping function].

The set of colors is arbitrarily chosen from a universal set, and C also corresponds to a choice of spacetime [frequency and periodicity] coordinates, for G. This is the generally relative nature of a set of closed operations in G (the group of symmetries of space and time), and of the encoding basis (anything written "in G"). That's general coding, relative to B.
Relations are between basis changes, over F which preserve the structure and the information content. Since rotations preserve the structure of B, then if B has a chosen basis the rotors are 'structure and content'-preserving operators.

Codes W are encoded and decoded (in T) cyclically, any subset of rotations encoded as a word, which represents an instruction for an abstract machine, will have a finite number of iterations in G, recursively. Iterations are steps Tn in the cyclic transposition of the code word written in the basis b,c, where c is a 2x2-ary code (i.e. pairwise complemented sets of the b-sets). This 2s-complement encoding of W, is the quotient function [space] Q|F.

A version of the Pocket Cube exists, dubbed the "Junior Cube". This version has only two colors."

--www.noshit.org

So the Junior version multiplies the b-sets by 2. This reduces the arity of the "c-sets". C in this sense is both color and complements of color, so there is a map from C to itself. The map from C to B is open, it represents the "color-channel" for F. B is a carrier for the C-code sets. The twist group of generators introduces parity to the 3-facet subgroup. Groups of elements with 2 facets (the 2-facet group of the structure set) have one less degree of parity than K, which is the Pocket Cube's vertex set. "Twist" is the parity generator.
B has the character "the absence of color", a function W is assumed which has the character "the presence of color", and both B and W are true for all colors C and functions of color F.

The term "arity" is primarily used with reference to operations. If f is the function f : S^n → S, where S is some set, then f is an operation and n is its arity.
[n is the logarithm of f(S), mathematically.]

Arities greater than 2 [ = log2] are seldom encountered in mathematics, except in specialized areas, and arities greater than 3 [ = log3] are seldom encountered in theoretical computer science. Practical computer programming commonly defines functions with many arguments, say N, but there is a matter of use of conventions (in the particular language as well as in the culture of the programmers), whether these are regarded as N separate arguments or as an N-tuple of (often heterogenously) typed arguments.

In mathematics, depending on the branch, arity may be called type, adicity or rank.

In computer science arity may be called adicity, a function that takes a variable number of arguments being called variadic.

In linguistics and in logic, arity is sometimes called valency, not to be confused with valency in graph theory.

However, the facets of B, including C are logarithmic ratios, as the arity of functions F3/F2. |G| is a graph, with T edges and nodes, so T is graph-symmetric.
The logarithm of B "to the C" is C, n is the arity of B. The logarithm of G is n, this is known to be 11 for K. If S (the structure group) is a superset of K it has 11-arity in G when N = 2. So we assume any M or abstract machine we can use, which has a structure and a color basis included in W, and word it can read or write is at least 2-dimensional, or the T is a tape of some kind with symbols S on it.

So the S1, S2, S3 above are abstract logarithmic structures of some kind we want to decode.
We abstract this notion of decoding W or any word "in W which is in the basis b,c" to having first decoded K's arity and adicity. That was Rubik 101, chapter 1, we are still decoding chapter 2, another logarithmic function of C. C in this sense is computation(al), and we have log2 machines M, with flat "screens" log2(S).

Last edited: Jan 29, 2010
22. ### noodlerBannedBanned

Messages:
751
Physical representation of $M_1$

With a 3x3x3 version of Rubik's group (the original cube), skew one of the layers slightly, or if you like, rotate it by 1/8.
Leaving this layer in place, you have one other - the opposite, that can also be rotated. Thus M is 1-dimensional, once the other two have been 'blocked'.

But then M must also be 2-dimensional in order to block (by a 1/8 layer move).
The proof is by construction, since 1970 something.

23. ### noodlerBannedBanned

Messages:
751
So fairly obviously M is a switch of some kind.

When blocked it's either a blocked channel or process waiting to unblock.
Unblocking is restoring the face-degree (geometry) of the blocked (1/8 rotated) "channel or process". A channel that restores cubic symmetry has a choice of 4 "messages" it can send, in 1 of 4 out-degrees.

So in that case, a Pocket Cube with only 4 colors is either a blocked-waiting or a context-switched process. Each process has 4 ways to copy itself by signaling. In actuality the process is "you" and you switch context by rotating the whole cube to "read the input", as you internally compare 2 or 3 whole faces at a time. Each face is the "instruction context", you decompose into another "message" and resend.

So the process of descent or ascent into G, involves "spawning" processes and switching context, all the children are blocked-waiting. Much the same as how a certain monolithic OS , also 1970 something era, handles multitasking.

If each "process" is a 4-pole, single-throw switching operation, then the pole-to-pole distance (m) is {+,-}. Then if a pole is a zero that means 2x3-faceted elements "on a stack" are all-black, and in the 3x3x3 the 2-facet between is as well. A row of uncolored elements being switched from one face group to another (this takes two moves) is equivalent to a string of zeros bbb... of length N.

This can be considered a "preamble" for the interpreter (of the numbers). If the "string" is extended onto another element "over horizon", starting at a vertex there are 3 out-degrees.
A vertex and 3xadjacent black edges is an empty node which is also a vertex figure, "Sending" it around the space by deconstructing and reconstructing its
shape in a 4-cycle, choosing the out-degree randomly, and (on another cube group "processor") in orderly fashion by trying to maintain the alignment of other conjunctions of colors, is a test of the "scrambled" and "unscrambled" versions of processing a code-word,

You could see the random version of this process as a commissioning run of the processor. Once scrambled, the orderly transition of the vertex figure can be used to reorder the rest of the elements - this is the one the operation XY'Z'X makes from n = 0, it covers the sequences above, and has any number of inverses and complements (i.e. it rewrites easily) with each of X, Y, or Z as the first and last character, So reconstruct the figure and use algorithms that preserve it to resolve the scrambled code.

\