Thursday, October 6, 2011

How not to solve a Rubik's Cube

The Rubik's Cube is one of my favorite puzzles. Upon first glace at a sufficiently scrambled cube, one might feel an instant feeling of dismay. With so many combinations, how could anyone hope to figure out how to unscramble it in a reasonable amount of time?

Many people would give up right then and there. But Rubik's Cubes have been solved countless times by countless people. It's far from an unsolvable problem, and in fact many of us take our fun from the thrill in the challenge.

I have successfully solved a Rubik's Cube on a number of occasions. I'm far from an expert solver, or a speed solver, generally it'll take me a couple of hours to solve an arbitrarily scrambled cube, not because it takes that long, but because I can only do it in stages and spending too long on a single stage get's my brain a little wonky :)

I remember the first time I solved the cube was right around the time of my thirteen birthday. Being proud, I continued to play with the solved cube until I accidentally scrambled it again. To my initial frustration, I then had to solve it a second time, which I did. It was promptly buried in the backyard after that.

(Aside: It was buried not because it frustrated me to the point I wanted to get rid of it, but we also happened to be making a Time Capsule at the same time and I thought it would make a good addition. That Time Capsule I believe is due to be unearthed next summer actually.)

Nevertheless, puzzle solved, I prompt forgot about the device for a number of years. Fast forward to several months back when I happened to see one at a local department store and decided to buy it.

I've solved this cube a couple of times since then, this time things are a little different however. Instead of just solving the cube once and forgetting about it, over time I'm practicing on it, trying to become better at solving it so that I can solve it in general for any specific cube without help.

To be fair, I've never actually solved a cube, from scratch, without some sort of assistance. Even when I solved the first cube all those years ago, I had a sort of guide that came with the cube. Now, this guide was far from a defacto "here are step by step solving instructions", but rather just a general set up "helper" steps to get where you wanted to go.

These helper steps are called algorithms, and are basically a short (or long) set of instructions on how to take the cube in one configuration and get it to another configuration. For example, how to move a block on the bottom, to the top, without changing a series of surrounding cubes (but not all cubes). I've always used these to help me, though again, even with this set of helper steps solving the cube is still fairly difficult. You still need to get it the right stage to do perform the algorithm, and could make other unwanted changes as well. Assembling them all together to solve the cube is still the hard part.

Some might label using the algorithms as "cheating", but to me, cheating at a cube would be more akin to rearranging the stickers or taking the cube apart (as many, including my original, are capable of being dismantled) and reassembling it correctly. Even expert speed solvers use these algorithms, likely taught to them by a book or someone else, or perhaps learned from scratch in some cases. Using algorithms is just a natural part of learning how to solve the cube. I suppose you could invest many hours in addition to actual solving time to develop the algorithms, or it may just be the software engineer in me which has taught me to use what's already been developed and not waste time reinventing the wheel :)

But in fact, this blog post is not about how to solve a Rubik's Cube. There are many other sites for that, one of my favorites is linked here: http://www.chessandpoker.com/rubiks-cube-solution.html

No, rather this post is about how *not* to solve a Rubik's Cube. But wait, you cry, why would anyone care about how not to solve the cube?

The answer is that there is an oft-quoted, but misguided, way that people often use to try and solve the cube. When someone first starts trying to solve it, they might start by randomly twisting sides in the hope they'll get somewhere. This procedure is doomed to fail (unless maybe you happen to be a computer program with dozens of gigabytes of memory). But rather, the misconception among novice cubers seems to be that there exists a fixed sequence of moves (moves, which I'll define below) which will solve the cube regardless of it's starting configuration (we'll call this the Magic Sequence). So a cuber with this mindset will spend all of his or her time searching for the Magic Sequence, without actually really paying attention to the mechanics of the cube.

In fact, searching for the Magic Sequence is at least equally (in fact more so) doomed to fail then twisting the cube randomly. I suppose even random twists could conceivably solve the cube eventually even if it takes eons. But trying to use a single set to solve the cube regardless of it's starting configuration is simply impossible, as I will demonstrate here. And so, it's important to explain why this method can't work and that a cuber trying to use it will ultimately never succeed.

First, let's consider what I mean by a "move". Among cubers, "moves" can have a variety of meanings, anything from a single turn to an entire algorithm. However, a common definition for a move often used by newer cubers and people searching for the Magic Sequence is a single turn, either clockwise or counter clockwise, of one of the cube's six sides (sometimes called a Quarter Turn by cubers).

Now, if you'll consider it, what is the cube actually made of? In fact, a Rubik's Cube is not a singular cube, but rather 26 smaller cubes (9 on each end, plus 8 going in a ring down the middle. There is no dead center cube, as that's where the rotation mechanism lives).

We can easily enumerate each of of these smaller 1-26 cubes and keep track of their orientation as we work the cube. Keep in mind that this enumeration would exist regardless of the color of each "face" of the cube.



Thus, from any starting configuration, there are only 12 possible unique moves, by this definition, that we can make to get the cube in a new configuration:

1. Top layer goes clockwise or counter clockwise
2. Bottom layer goes clockwise or counter clockwise
3. Right layer goes clockwise or counter clockwise
4. Left later goes clockwise or counter clockwise
5. Front later goes clockwise or counter clockwise
6. Back layer goes clockwise or counter clockwise

Here is an illustration of 6 of the 12 possible moves. The other 6 are just mirrors on the non-visible sides.







Some people might try to argue that there are more moves then this. For example, turning the bottom two layers clockwise. But, this is really equivalent to turning the top later counter-clockwise. Likewise, turning the right layer clockwise twice is really just two applications of the same unique move. Each move will have a fixed, predetermined affect on the cube that can't be altered.

A solved cube, with all sides showing the same color, will live as one, and only one, possible configuration of the individual cubes. The cube can only exist in a single configuration at a time, it cannot exist in two different states simultaneously. Agreed? This is Rubik's cube, not Schrodinger's cube, after all.

Let's say that I start with the cube in a given configuration, called Configuration A. I then perform a sequence of moves on the cube (where a sequence is an ordered set of the twelve moves listed above). We'll call this Sequence A. Upon applying Sequence A, to Configuration A, we end up in another Configuration B (which could possibly be equal to Configuration A). The important thing to remember is that every time I start the cube in Configuration A, and apply sequence A, I'll *always* end up in Configuration B. Likewise, if I start the cube in Configuration B, and perform Sequence A backwards, I'll always end up with Configuration A. This is true for all possible Configurations and Sequences of the cube. There is no possible sequence that I can perform on a configuration such that applying the same sequence to the same configuration will result in multiple configurations. Make sense? The diagram below shows the symmetric nature of applying a sequence to a configuration.



Given that, to disprove the "Magic Sequence", we can use what's called a proof by contradiction. The basic premise is that if we can show that the existence of a magic sequence would lead to a contradiction given the rules of the cube we've described (cannot exist in more than one state, and configuration + sequence = a single new configuration), then it can't exist.

Let's call a cube's solved state Configuration Z.
First, let's imagine that the "Magic Sequence" did exist. This would mean that there exists a sequence such that I can apply the sequence to Configuration A and end up with Configuration Z, and that I can apply the identical sequence to Configuration B, and end up with Configuration Z, (where A and B are *not* the same configuration, and represent any configuration the cube could be in).

But then, what would happen to Configuration Z if I performed the "Magic Sequence" backwards? Remember that we stated the cube could only exist in one configuration at any one time.

If the "Magic Sequence" existed, then I'd be able to perform it backwards from the solved state (Configuration Z) and end up with *both* Configuration A AND Configuration B, which is impossible, since the cube can only be in one configuration at a time. In other words, I can't apply the "Magic Sequence" to Configuration Z, and wind up with A, then later apply the same sequence to Configuration Z, and wind up with B, since a fixed sequence of moves will always have the same result on the cube. Therefore, the "Magic Sequence" does not exist.



Make sense?

Now, there are plenty of other ways to solve a cube. Many of them involve the application of multiple algorithms in order, which is sort of like a Magic Sequence. But the important distinction is that the algorithms involve decision-making, e.g. applying a different algorithm next based on the result of the last. If such a "Magic Sequence" like the one disproved existed, you'd be able to solve the cube without any decisions.

Feel free to leave any questions or comments you might have below and I'll do my best to answer them!

Happy cubing!

Tuesday, July 12, 2011

Why the Wii U should support GameCube

Recently announced was Nintendo's next generation console: the Wii U.

A lot of buzz has been generated around the new console, and with good reason.

Begin a long time fan of Nintendo, I am highly intrigued by the new console. It supports a new array of features, including an innovative touch screen controller and high definition game support.

The funny thing is, I remember reading an article a number of years back that suggested a touch screen controller was among the first prototypes for the Wii; but they decided against it due to fear of imitating the DS too much....I have no idea if that's true or not; but if so this certainly seems an interesting turn of events!

I'm glad to hear that the Wii U will support Wii games and all current Wii-based controllers (classic controller, balance board, etc); although this rumored concept of only one Wii-U Tablet controller per console sounds limiting; Nintendo might just figure out a way to make it work (they could also change their mind on this as supposedly it's already been suggested that you could bring your controller over to a friends house).

But what I really want to talk about is legacy game support on the Wii U. My understanding is that the Wii support for GameCube games is due to having an on board GameCube processor, of which the GC controller ports and GC Memory Cards are wired into (but also have an inturrupt to the Wii processor so they can be used by Wii software as well).

My experience when playing a GC game on the Wii has been just that: it basically acts just like a GameCube and is indistinguishable from the original console. It bypasses the Wii processor altogether.

It is obvious to see why it's tempting to remove GC support: removing the processor leaves more room in the chassis for newer, powerful processors and makes the console cheaper by not having to manufacture a second processor. Plus, the GameCube console is over 10 years old and approaching obsolescence.

But I think there's a very good case for providing GC support on the Wii U, in some form or another.

When the Wii came out with GameCube support, most people were pretty happy that they could ditch their GC with ease, why have two consoles when you can have just one? But then came the real kicker: There was also going to be a Virtual Console which would allow you to play games from the NES, SNES and N64 consoles. I think this, more then GameCube support, really set our imaginations a flame: any Nintendo fan will tell you how much they love the charm and nostalgia of the classic Nintendo games. Playing our favorite classics on a modern, updated console, without having to blow on the cartridge 50 times? Queue the drool in 3....2....1....

But Nintendo did more then they realized when they announced the Virtual Console: they set a precedent. For once; a company was saying "We stand by our old work; we want you to enjoy it as you always did, now and for years to come." It wasn't that you could only play Nintendo Wii games, but you could play nearly the entire Nintendo home console library: NES+SNES+N64+GC+Wii. From that point on, I was left with an potentially dangerous expectation: consoles should only add functionality onto their predecessors and never remove functionality (or at least, remove the minimum possible, only where it would significantly conflict with the design of the next console: e.g. the GameBoy Player on GC).

As a result, I imagined the Wii as less of gaming console and more of a gaming hub: a device that could support many different types of games from many different types of systems. As a fan of removing redundancy, this was a very exciting prospect, and a trend I personally expected to continue into future consoles such as the Wii U.

So then another question presents itself: Will the Wii U support Virtual Console titles?

Although no official word on this has been presented, I'll be fairly shocked if the answer is anything other then "Yes."

If my assumption is correct, then let's look at the list of consoles of the Wii U would support:

NES
SNES
N64
Wii
Wii U

with one glaring omission: the GameCube!

Why would you develop a console that A) Supports the 3 oldest consoles; B) Supports the 2 newest console, but C) Simply decides to ignore the 4th console in the middle?

It doesn't make a heck of a lot of sense to me. Thus, I think the Wii U should absolutely add some level of support for GameCube games, if nothing else, so that it doesn't feel like they are pointlessly skipping a console in their gaming library (supporting all consoles except one).

Now, I'm not saying the Wii U has to support GC games in the same way the Wii does (use a GC chip, have on board GC controller & Memory card slots).

But there are lots of other ways they can add GC support. One of the most obvious ways is to include GameCube games onto the Virtual console. As for controllers perhaps sell an optional adapter to connect the GC controller to USB, and run the GameCube games with emulation (I'm going to assume the Wii U's processor would be powerful enough to run GC emulation software).

Another option is to sell some sort of "mini-GameCube" device for a cheap price that includes GC ports, a disc reader and memory card slots and connects to the Wii U but is otherwise an empty shell that relies on the Wii U for processing: a "GameCube player" or sorts if you will.

There are hybrid approaches as well: allow the Wii U to read GC discs natively, but not include the ports on board but only via an optional mechanism and run the games through emulation. Heck, I'm sure you could figure out a way to connect a GC controller with a Wii-U controller or even a Wii Remote!

Point is, there are lots of different ways to do it; and no serious excuse for not doing it. The absolute minimum I would like to see is GC games on the Virtual Console and support for playing them via the Wii's Classic Controller (which we know to be supported). But this presents a problem: as much as I am a fan of eliminating the need for multiple devices (see my previous post on the subject), I am not of fan of needing to purchase the same things multiple times. In fact, I fully expect a migration tool for porting your Virtual Console purchases from the Wii to the Wii U (again, Nintendo set a precedent for this by announcing you could transfer DSi games to a 3DS).

What I think would be a great option for Nintendo and consumers is to allow a "trade in service" where people could send in older games and receive a credit to get the same game (or an equivalent in Nintendo Points) on the Wii (-U) Shop Channel. You could do this for GC discs, N64 cartridges, etc. Nintendo could recycle the components to make new games/equipment while the consumer would not have to purchase the same thing twice. I really wanted to see this materialize with the Wii Virtual Console, but it never did. However, if more of Nintendo's legacy games continue to wind up on the Virtual Console, I feel it's becoming more of a necessity.

So, not saying any of this is going to happen, but it's a possibility. Would lack of GC support altogether stop me from purchasing a Wii U? Probably not, but it gives me less of an incentive knowing that I'd need to hold onto my Wii (or GameCube) as well. Obviously Nintendo is a company first, with a revenue line to think about, without which they can't produce new consoles and games. But I seriously hope Nintendo continues to put their customers first, which I feel to date they have been doing a good job of. In the end, it will be more profitable for them since it will make many of us, including myself, more likely to purchase their games and equipment.

It makes no sense for the Wii's successor to not support Virtual Console games and it makes even less sense for Nintendo to simply ignore GameCube in the list of consoles the Wii U supports.

Let's hope Nintendo sees it that way too.

Sunday, June 19, 2011

Project: Starry Expanse

Happy Sunday everyone!

When I was kid, I was very interested in the "Myst" franchise. It was a very challenging game: you needed to figure out what to do each step of the game with no real direction. My friend and I played it for about 2 months before finally getting to the end.

It was followed by a sequel, called Riven, which if anything was 10 times more challenging.

There were 3 more sequels to the original, but made by difference companies. They were fun names nonetheless, but never really had the charm and appeal of the originals Myst&Riven.

Myst&Riven were "semi-3D", basically a series of still images that you clicked on to go the next still. You could click to move forwards, up, down, left, right, to give you an artificial feeling of being in a 3D environment. Given the limited technology at the time (circa. 1993), this was pretty ground breaking.

Later, a remake of the original was created called "realMyst". Gameplay was nearly identical to the first, but instead of still images, the game was recreated with a brilliant 3D engine allowing for full range of access across the environment, day/night effects, weather effects and more.

It was very exciting and while playing realMyst it gave me a wonderful feeling of nostalgia + intrigue. "This was the way Myst was meant to be played..." I said to myself. The idea was just ahead the technology at the time.

But my thoughts immediately jumped to the next most logical question: Would there ever be a realRiven?

Myst was later re-released to multiple platforms including the DS, PSP and iPhone.

Unfortunately, they seemed to only like releasing the good old-fashioned "still-based" navigation system, rather then an immersible 3D environment. Personally, I never understood this choice, as the immersible environment I felt would have a better chance of bringing in new fans.

Logically, if they did that, realRiven could follow (and possibly with game 3&4, 5 was already based on the full 3D environment).

But no 3D remakes of the other games never surfaced. Why? I cannot stay, but that hasn't stopped a group of fans from recreating the sequel in 3D themselves!

The project is called Starry Expanse. If you're a Myst fan you'll get the reference. If not, go get yourself a copy of realMyst (I believe it's on Steam), beat it, and then you'll get the reference.

This is a very neat project! Recreating a game in real time 3D is no small feat, so I wish them the best of luck. You can even make a donation on their site (I did) and get your name in the Credits!

Check out their site for more info. It's a really great project and will hopefully help open Myst & Riven to a new world of fans.

Take care!