Skip to content

Restore and update Rubik's Cube example - #412

Open
stertooy wants to merge 1 commit into
gap-system:masterfrom
stertooy:rubik
Open

Restore and update Rubik's Cube example#412
stertooy wants to merge 1 commit into
gap-system:masterfrom
stertooy:rubik

Conversation

@stertooy

Copy link
Copy Markdown
Contributor

Closes #371.

Not sure where the example is supposed to go, since all the other examples are also gone.

I've made some minor changes to the example. I replaced Complementclasses with ComplementClassesRepresentatives, since the former has been removed. I also changed the output to match that of GAP 4.16.0, instead of GAP 4.4.

Preview here.

@fingolfin

Copy link
Copy Markdown
Member

Thanks.

Part of the reason examples are gone is that it wasn't clear where to put them, and so we figured we might as well remove them, and if someone cares and would like to add them back, hope that they also have an expectation where to find such examples.

Comment thread doc/example/index.md
---

This is an updated GAP 4 version of a GAP 3 example by [Martin Schönert](https://www.math.rwth-aachen.de/~Martin.Schoenert/), 1993. An almost classical permutation group of small degree is examined with some elementary GAP commands.
The output given here has been produced by GAP 4.16.0, the input is available in form of a plain GAP 4 [input file](rubik.in).<!-- TODO -->

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the TODO comment

@fingolfin fingolfin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Here are some thoughts on how we could perhaps improve it a bit.

Still doesn't settle where to best put this in the navigation of the website.

If we ever add more examples, a "list of all examples" page might also be useful?

(And once we have "try GAP in your browser" on the website, we should link to that, I guess?)

Comment thread doc/example/index.md
Comment on lines +10 to +16
<p style="text-align: right"><i>
Ideal Toy Company stated on the package of<br />
the original Rubik cube that there were more than<br />
three billion possible states the cube could attain.<br />
It's analogous to Mac Donald's proudly announcing<br />
that they've sold more than 120 hamburgers.</i><br />
(J. A. Paulos, Innumeracy)</p>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand you are "backporting" this existing example, but I'd say if we do that, should also bring it to the 21st century and use CSS to format a quote like this. I.e., instead of manually inserting line breaks, and using <p> block, I think this should be in a div or maybe a quote and then the formatting should be CSS -- so the wrapping could presumably be achieved via width or max-width or so?

Comment thread doc/example/index.md
+--------------+
```
then the group is generated by the following generators, corresponding to the six faces of the cube.
```

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```
```gap-repl

Comment thread doc/example/index.md
Comment on lines +19 to +33
```
+--------------+
| 1 2 3 |
| 4 top 5 |
| 6 7 8 |
+--------------+--------------+--------------+--------------+
| 9 10 11 | 17 18 19 | 25 26 27 | 33 34 35 |
| 12 left 13 | 20 front 21 | 28 right 29 | 36 rear 37 |
| 14 15 16 | 22 23 24 | 30 31 32 | 38 39 40 |
+--------------+--------------+--------------+--------------+
| 41 42 43 |
| 44 bottom 45 |
| 46 47 48 |
+--------------+
```

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While ASCII art is fun, I wonder if we can't improve on this via some SVG or so. Ah well, not important.

Comment thread doc/example/index.md
Comment on lines +57 to +59
Next let us investigate the operation of the group on the 48 points (we reduce the line length to get a more appropriate output format).
```
gap> SizeScreen( [71, ] );;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reducing the line length here seems questionable to me -- it is very technical and distracts from the content; at the same time, clearly a line length limit was already in place above (perhaps 80) ? I think are free to format example output as we deem fit, there is no requirement to make this precisely reproducible?

Suggested change
Next let us investigate the operation of the group on the 48 points (we reduce the line length to get a more appropriate output format).
```
gap> SizeScreen( [71, ] );;
Next let us investigate the operation of the group on the 48 points,
```

Comment thread doc/example/index.md
gap> Size( cube1b );
40320
```
Now a permutation group of degree 8 that has order 40320 must be the full symmetric group S(8) on eight points.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, S(8) seems like unusual notation. How about e.g. this?

Suggested change
Now a permutation group of degree 8 that has order 40320 must be the full symmetric group S(8) on eight points.
Now a permutation group of degree 8 that has order 40320 must be the full symmetric group $S_8$ on eight points.

Actually we could also show how GAP can verify this:

Suggested change
Now a permutation group of degree 8 that has order 40320 must be the full symmetric group S(8) on eight points.
Now a permutation group of degree 8 that has order 40320 must be the full symmetric group $S_8$ on eight points.
Indeed, GAP agrees:
```gap-repl
gap> IsNaturalSymmetricGroup(cube1b);
true
```

Comment thread doc/example/index.md
```
Of course, theoretically it is clear that `cmpl1` must indeed be a complement.

In fact we know that `cube1` is a subgroup of index 3 in the wreath product of a cyclic 3 with S(8). This missing index 3 tells us that we do not have total freedom in turning the corners. The following tests show that whenever we turn one corner clockwise we must turn another corner counterclockwise.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again S(8). Also maybe avoid super long lines?

Suggested change
In fact we know that `cube1` is a subgroup of index 3 in the wreath product of a cyclic 3 with S(8). This missing index 3 tells us that we do not have total freedom in turning the corners. The following tests show that whenever we turn one corner clockwise we must turn another corner counterclockwise.
In fact we know that `cube1` is a subgroup of index 3 in the wreath product of a cyclic 3 with $S_8$.
This missing index 3 tells us that we do not have total freedom in turning the corners.
The following tests show that whenever we turn one corner clockwise we must turn another corner counterclockwise.

Comment thread doc/example/index.md
gap> IsElementaryAbelian( Kernel( blockhom1 ) );
true
```
We can show that the product of this elementary abelian group 3^7 with the S(8) is semidirect by finding a complement, i.e., a subgroup that has trivial intersection with the kernel and that generates `cube1` together with the kernel.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
We can show that the product of this elementary abelian group 3^7 with the S(8) is semidirect by finding a complement, i.e., a subgroup that has trivial intersection with the kernel and that generates `cube1` together with the kernel.
We can show that the product of this elementary abelian group $3^7$ with the $S_8$ is semidirect by finding a complement, i.e., a subgroup that has trivial intersection with the kernel and that generates `cube1` together with the kernel.

Comment thread doc/example/index.md
<permutation group of size 479001600 with 11 generators>,
<permutation group of size 479001600 with 11 generators> ]
```
So there are even 4 classes of complements here. This time we get a semidirect product of a 2^11 with an S(12), namely a subgroup of index 2 of the wreath product of a cyclic 2 with S(12). Here the missing index 2 tells us again that we do not have total freedom in turning the edges. The following tests show that whenever we flip one edge we must also flip another edge.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

math mode, S(12), overlong lines

Comment thread doc/example/index.md
gap> last = r;
true
```
This concludes our example. Of course, GAP can do much more, but demonstrating them all would take too much room.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"them" is grammatically incorrect, and "too much room" is a German-ism.

Some alternative suggestions:

Suggested change
This concludes our example. Of course, GAP can do much more, but demonstrating them all would take too much room.
This concludes our example. Of course, GAP can do much more, but demonstrating everything it can do would take too much space.
Suggested change
This concludes our example. Of course, GAP can do much more, but demonstrating them all would take too much room.
This concludes our example. Of course, GAP offers many more features, but demonstrating all of them would take too much space.
Suggested change
This concludes our example. Of course, GAP can do much more, but demonstrating them all would take too much room.
This concludes our example. Of course, GAP can do much more, but covering all of its capabilities would take too much space.
Suggested change
This concludes our example. Of course, GAP can do much more, but demonstrating them all would take too much room.
This concludes our example. Of course, GAP can do much more, but illustrating all its functionality would take too much space.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Restore Rubik's cube example

2 participants