O'Reilly logo

Sams Teach Yourself Ruby in 21 Days by Mark Slagell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Unjumbler

Scrambled words are hard for humans to deal with, though there are humans who have an uncanny knack for unscrambling them quickly. If you look at the scrambled word clabena and can unscramble it in your head in a few seconds, you're one of those lucky ones. Most of the rest of us would end up writing down lots of more or less random arrangements of the letters (canebal, neablac, acalenb, …and so on) hoping that we stumble across one, say balenca, close enough to the answer to make us see it. When no such inspiration strikes, we have to try a lot of permutations—because there are, to be exact, n! of them for any n-letter word. For clabena, that's 7! = 5040.

The job is a little easier for a computer because it can spin out all the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required