Can a Rubik's Cube be brute-forced?
stylewarning.com
stylewarning.com
For example, you find a way to swap two pieces on the top layer and mangle the bottom (f), turn the top (g), and then do the opposite (f^-1), swapping a different pair and un-mangling the bottom. Between complementary swaps, edge flips, and corner rotations, you can build an entire solution with this technique. (My current version of this does the edges first, ignoring any damage to corners and then does corners.)
Somewhat related - many years ago there was a tutorial of the Gap computer algebra system that analyzed the rubik's cube group. I can't find the original, but there is a translation to Julia here: https://oscar-system.github.io/GAP.jl/stable/examples/
You eventually develop the intuition to solve any move without having to "memorize" anything.
(ps.: after a quick search I see that one can buy replacement stickers for a few bucks on Amazon :D)
Can a Rubik's Cube be brute-forced? - https://news.ycombinator.com/item?id=36645846 - July 2023 (108 comments)
(Reposts are fine after a year or so; links to past threads are just to satisfy extra-curious readers)
Reposts are fine after a year or so. This is in the FAQ: https://news.ycombinator.com/newsfaq.html.
Links to past threads are just to satisfy extra-curious readers. Edit: I guess I already said that above.
Edit: I appreciate my comment being hidden to reduce distraction for others, and to (selfishly) to prevent downvoting (not that I'm collecting MIPs or anything! <sweatsmile>)
I struggled for years to find the right language for presenting those links because nearly every wording seemed to provoke this misunderstanding. I eventually settled on simply saying "Related". That seems to minimize (but alas not eliminate) it. I often say "Related. Others?" which seems to work pretty well (https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...).
It's still my intention to integrate this related-links business more into HN's UI, which could maybe help with this quite a bit.
Where submissions have had recent discussion but not above HN's somewhat vague "significant discussion" threshold (I generally go by <20 comments), I'll also note that. Often it's because I'd recalled earlier submission and wasn't sure myself whether or not those were dupes.
Since other HN readers are also involved in flagging dupes, or boosting repeat submissions for stories under the threshold, communicating this clearly is useful. A point I've also emphasized in the past:
<https://news.ycombinator.com/item?id=40849853>
My own first comment on that thread my be buried dues to downvotes, it's the reply to the linked comment and read (prior to clarifying edits linking & citing guidelines):
If you're calling a submission a dupe, say so.
In this case, there's an 11-hour old submission, but at only 6 comments, it's well below the threshold I (a non-privileged HN participant) usually call for dupes, that being ~20 comments.
So no, this is not a dupe.
Since it's difficult to assess an author's intent on a vague or link-only comment, being explicit as to what the situation is is something I'd strongly encourage.
Hm, so something akin to a bidirectional path-finding problem, where one can still call it "brute force" because both known positions (start and goal) are each doing a breadth-first search, as opposed to something fancier than picks a direction.
This was in sharp contrast to my calculus classes where the results were basically thrown at you fully-formed. If you're lucky, you might get to walk through a proof with the professor, but you're never going to see how they mentally navigate the search space.
I wonder if just making random moves over and over would be faster.
If insead you want to find the shortest possible solution for any giveb configuration, that indeed is much harder! The best optimal solvers at the moment use very large pruning tables to help the brute-force search.
A nice exercise could be solving a 2x2x2 cube. That one is much more manageable.
This page is great is you want to learn more: https://www.jaapsch.net/puzzles/compcube.htm
Amazingly this means we can solve a Rubik's Cube without ever knowing what the original configuration is, as long as we can ask at any time if the cube is solved or not.
[0] https://bruce.cubing.net/ham333/rubikhamiltonexplanation.htm...
I think you mean current configuration? Otherwise it's kind of silly, the original configuration is irrelevant once you know the configuration you are currently at.
i = 0
while not solved
apply move(i)
Interestingly, there is no constant function `move(i) = x` that makes this algorithm correct.If there was, there would be a single element x of the rubik's cube group that generates the entire group (every element could be written as x^n)
This would imply that the group is commutative (x^n * x^m = x^(n+m) = x^(m+n) = x^m * x^n), which every cuber knows is false from experience (permuting moves does not lead to the same final configuration)
An interesting question would then be: whats the simplest piecewise-constant function that makes this algorithm work?
I.e. is it possible to use move x1 for the first n1 steps, then x2 for the second n2, then x3 for the next n3, ..., then xk for the next nk? And if so, what is the smallest k that makes it so?
Or more specifically, there is a fixed sequence of moves that will traverse through every possible configuration of a Rubik's cube then take you back to whereveryou started. One of those states is the solved state. Meaning whenever you complete this sequence you will have done a full loop of all possible cube states.
The interesting thing is that it doesn't matter where you start, you can follow this same sequence. So you can be blindfolded, never see the cube, perform the sequence and one of those states will be a solved Rubik's cube.
That I believe is OPs point.
Say we have an array p[1], p[2], ..., p[n] with all possible rubiks cube configurations
Then this function will solve the cube:
move(1) = p[1]^(-1)
move(i) = p[i]^(-1) * p[i-1]
In laymans terms, the resulting algorithm is: assume the initial configuration is p[1], then solve it. If it wasn't, undo those moves then solve as if the initial position was p[2], etc...So, yeah. Those fixed solving sequences / hamiltonian paths are actually very common. We can make one for any permutation of the group elements.
So I posed a more interesting question: what is the simplest sequence of moves that has this property?
But reassembling is the true brute.