Calling a game "hard" would seem to be a matter of personal judgement. Not so, according to an international team of computer scientists. For the past several years, the scientists have been analyzing Super Mario Bros. as if it were a math problem and beating a particular level is the solution. Now, they've extended their analysis to cover any possible arbitrary level, and they've shown that Super Mario Bros. belongs to a class of problems called PSPACE-complete.

The team's work benefits from how much we already know about how Super Mario Bros. operates. For example, every time the game needs a random number, its number generator isn't actually random. Mario's number generator starts with a fixed seed that's updated deterministically each time a scene is calculated. It's only when a player helps create a particular scene that the scene becomes effectively random—something that's not at issue when a computer is solving a level.

There are also well-described cases in which, as the authors put it, "the implementation

of Super Mario Bros. is counter to the intuitive Mario physics with which most players are familiar." These include the ability to pop Mario through a wall or to jump through a brick ceiling, provided there's a monster on top. And, while the game tracks objects that move slightly offscreen, the game forgets about bad guys who wander too far off the edges.

Still, a lot of the work involves the Mario equivalent of a spherical cow. The levels used in the team's work have arbitrary dimensions and require a customized Super Mario Bros. that remembers what happens to objects that fall off the visible screen. Like the real game, however, things are loaded from a fixed level file, and there are time limits, checkpoints, multiple lives, and coins.

Within those limits, the authors find that Super Mario Bros. is PSPACE-hard. Like NP problems, PSPACE appears to need exponential time on a traditional computer to solve. But PSPACE-hard problems also require exponential time to determine if a proposed solution is correct.

The authors also look at a more typical version of the game—one in which offscreen objects are forgotten, the screen has a fixed size, and there are a limited number of sprites on screen at one time. Here, the game can be solved in polynomial time, and certain iterations fall into NP-hard.

While this sort of work may seem like a waste of time, one of the authors (MIT's Erik Demaine) says it's actually valuable from a teaching perspective. His students need to understand various forms of mathematical difficulty, and using video games as examples, he argues, makes this intuitive. He's also used Donkey Kong as a teaching aid.

Another author, University of Ottawa's Giovanni Viglietta, has placed some modified ROMS used in the work online. Drs. Demaine and Viglietta will be joined by Aaron Williams, a professor of computer science at Bard College at Simon’s Rock, in presenting their new paper at the International Conference on Fun with Algorithms next week.