.....Advertisement.....
.....Advertisement.....
Monday, December 28, 2009

Dirty little secret: Computer generates math puzzles

Q: The Kakuro puzzles in The Roanoke Times are very clever and very difficult to solve. What I can't wrap my head around is how they are created. Can you explain, even at a high level, how the creators go about making these puzzles?

Tom Sanders, Moneta

A: In case any of my other readers hasn't tried one, let me explain that Kakuro puzzles are sort of a cross between a crossword puzzle and math homework. You follow the clues to fill a grid with numbers. Each number has to work both "across" and "down" just like a letter in a crossword.

I put your question to Jim Bumgardner, author of several Kakuro books, including "Masters Kakuro: 172 Challenging Puzzles." He's also a computer programmer, so perhaps you can see where this is headed.

"I do indeed make Kakuro puzzles with a computer -- that is, I write software that makes Kakuro, Sudoku and other kinds of logic puzzles.

"Essentially, I figured out how I would go about constructing a puzzle if I were to do it with a pencil ... and then I programmed the computer to follow the same steps."

So the computer makes a random grid, fills it with random numbers and generates the "clues."

Now he needs to find out if the puzzle can actually be solved, so he has programmed the computer to solve the puzzle the same way he would.

"If my computer can solve the puzzle, I can, too -- it just will take me a lot longer." If the computer can't do it, Bumgardner figures he can't either and that puzzle gets scrapped.

So, while it's not that hard to have the computer generate a new puzzle, the hard part was telling the computer how to do it.

"For me, the real art and craft go into making my software," Bumgardner said. "Any 'art' that I can apply to a handmade puzzle I can also work into the software I write to construct the puzzles."

If you'd like to try one of Bumgardner's Kakuro or Sudoku puzzles, turn to today's Extra section or visit www.krazydad.com and click the puzzles link.

Last word on ersatz reindeer

Thanks to all the readers who have written in about the reindeer at Crossroads Mall. I'm especially glad to have heard from the visionary behind it all, Carole Keith, now a sales associate with Long & Foster Realtors.

"We always had a great Christmas season," she recalled. She became Crossroads' promotions director in the mid-1960s and started turning the mall into a winter wonderland.

She doesn't know exactly where she got the idea of using real deer -- it just popped into her head. The mall bought two deer from a taxidermist each year until they had eight. Then came Rudolph with a light-up nose. The deer were arranged on a ramp to give the impression that they were taking off.

For elves, she hired her own children and others from the neighborhood.

One of those elves was David Trail.

"I 'elfed' the Christmas seasons while in the eighth and ninth grades, which would have been 1971 and 1972," Trail wrote. He was glad to earn some cash this way, but he did make a mistake, he recalled. He told his buddies what he was doing.

"Several of my classmates ... came to the mall and snapped photos of me while elfing and took great pleasure in showing the photos at school after their failed extortion attempt."

Next week: The Grammar Guru returns! So be on the lookout for grammar that makes you grumble.

Have a question? Have an answer? Call Tom Angleberger at 777-6476 or send an e-mail to woym@roanoke.com. Don't forget to provide your full name, its proper spelling and your hometown.

.....Advertisement.....