What is red and smells like blue paint?
SPOILER WARNING
...
...
...
...
...
via Best Brain Teasers

## Monthly Archives for June, 2013

## Binary expression tree

Is there any way to algorithmically determine if two algebraic expressions are equivalent? For example is 5+x equal to x+5? Or how will a computer know ? Does the figure below give you a hint?
Brought to my attention by Shaleen. The original question can be found on Stack Overflow.

## An algorithmic puzzle

Suppose you have an array of size n+1, each entry being an integer from 1 to n. Find a duplicate entry in linear time using only O(1) (constant) space.
via Gurmeet's puzzle page

## Integer programming

3 objects A,B and C together cost 50 cents.
B costs more than 3 times as much as A, but no more than 4 times as much.
C costs more than 6 times as much as A, but no more than 3 times as much as B.
The costs are all integers.
What are the smallest and largest prices that B can take?
This is an example of integer …

**Continue reading the story**"Integer programming"## Skyscraper puzzle

Here is a link to what are called skyscrapper puzzles. The puzzle consists of a rectangular grid of dimensions n x n. Each row and column is to be filled with numbers from 1 to n so that all numbers occur in each row/column exactly once. These numbers represent building heights. Another constraint is the number of buildings that can be seen from the …

**Continue reading the story**"Skyscraper puzzle"## Mirror guns

You find yourself in a rectangular room with Osama Bin Laden. Osama has a laser pistol to fire you. The 4 walls of the room are perfectly reflecting mirrors. Osama is about to shoot you either directly or through the mirror. The only way you can save yourself is by placing 16 bodyguards with shields in the room so that any shot from Osama to …

**Continue reading the story**"Mirror guns"## A betting game

There are two urns. Each urn initially contains $1.
You keep throwing dollars into the urns 1 dollar at a time, until the 2 urns together contain 1 million dollars. Except, you bias the probability as follows:
Suppose urn 1 contains $a and urn 2 contains $b, then the extra urn goes to urn 1 with probability a/(a+b). Thus the urns are slightly magnetic, the urn with …

**Continue reading the story**"A betting game"## Passing a cube through a smaller cube

Can you pass a large cube through a hole in a smaller cube so that the larger cube passes and comes out through the other side of the hole? Surprisingly (and of course, since I asked this puzzle) the answer is YES!
- via Peter Winkler's video here

## Read More About this Post Here

Find a nine digit number abcdefghi that uses all the digits 1,2,3,...9 exactly once and satisfies:
a is divisible by 1
ab (2 digit number with digits a and b) is divisible by 2
abc (3 digit number with digits a, b and c) is divisible by 3
.......
.......
abcdefghi is divisible by 9.
via singingbanana through youtube