Archive for the ‘puzzles’ Category

xkcd: Blue Eyes – The Hardest Logic Puzzle in the World

Wednesday, September 26th, 2007

xkcd presents a tough logic puzzle.

I’ve done my best to make the wording as precise and unambiguious as possible (after working through the explanation with many people), but if you’re confused about anything, please let me know. A word of warning: The answer is not simple. This is an exercise in serious logic, not a lateral thinking riddle. There is not a quick-and-easy answer, and really understanding it takes some effort.

Related:

Classic Computer Science Puzzles

Tuesday, September 18th, 2007

Coding Horror has a nice summary of classic puzzles in computer science, which you may have seen in your university courses.

I prefer to think of programming languages as utilitarian tools for real world problems. They let me accomplish pragmatic (and often prosaic) goals. PHP is about as unsexy a language as you’ll ever find, but does that matter when it’s the technology driving the current Boardwalk and Park Place of the web world? I’m not a fan of puzzle questions in interviews; I’d rather have potential developers give me a presentation or write a reasonably useful program in the real development environment they’ll be using on the job. Solve all the puzzles you want, but the only one we’re getting paid to solve is the customer’s problem.

That said, many fundamental computer science concepts can be summarized well in puzzle form, which aids tremendously in teaching and learning these key concepts. Here’s a quick list of the classic computer science puzzles that I remember from my university days

William Wu’s Riddles

Thursday, January 18th, 2007

William Wu has quite a large collection of tech-interview style riddles and puzzles.

This is an archive of problems I’ve been collecting since the Spring of 2002. They come from many places, including word of mouth, college courses, books, and job interviews for hi-tech positions. Many are even written by members of our own forum community. These carefully chosen puzzles will demand you to think in creative ways you perhaps normally would not. In fact, some will seem outright impossible at first … but once you crack them, the epiphany can be truly rapturous!

Newcomb’s Paradox

Thursday, December 14th, 2006

Here’s another logical paradox for you to ponder.

A highly superior being from another part of the galaxy presents you with two boxes, one open and one closed. In the open box there is a thousand-dollar bill. In the closed box there is either one million dollars or there is nothing. You are to choose between taking both boxes or taking the closed box only. But there’s a catch.

The being claims that he is able to predict what any human being will decide to do. If he predicted you would take only the closed box, then he placed a million dollars in it. But if he predicted you would take both boxes, he left the closed box empty. Furthermore, he has run this experiment with 999 people before, and has been right every time.

What do you do?

On the one hand, the evidence is fairly obvious that if you choose to take only the closed box you will get one million dollars, whereas if you take both boxes you get only a measly thousand. You’d be stupid to take both boxes.

On the other hand, at the time you make your decision, the closed box already is empty or else contains a million dollars. Either way, if you take both boxes you get a thousand dollars more than if you take the closed box only.

  • Link
  • As suggested, you should read the entire essay here.
  • You can follow the discussion here.

13 Balls problem: One of the hardest interview questions

Wednesday, December 13th, 2006

Brush up on your logical deduction skills for your next tech interview.

One of the most classic puzzles involving balls is figuring out the odd one out using common balance. There are many levels of puzzles based on the same concept for different levels of interviews – Simple ones for phone interviews to the most gruelling 1 hour hard work needing hard ones.

Problem space
The general problem is you will be given n balls and one of them is either heavier or lighter and you are asked to find out the minimum number of weighings using a common balance required to find out the odd one out.

World’s hardest Sudoku puzzle

Tuesday, November 7th, 2006

Supposedly, this is one of the hardest Sudoku puzzles to solve.

It’s times like these that the internet makes me most happy. When respectable online publications publish entertaining and interesting stories about the world’s hardest Sudoku puzzle, you’d at least expect them to give you a link to it, or a picture of it. Oh, yes, you guessed it. They don’t. But I couldn’t find it anywhere! So I undustriously hunted, and eventually found the secret formula hidden away in an ASCII-like tomb of Sudoku knowledge.

World's Hardest Sudoku Puzzle