## Red paint vs Blue paint

Posted on: June 30th, 2013 by
What is red and smells like blue paint? SPOILER WARNING ... ... ... ... ... via Best Brain Teasers

## Find the next number in the sequence

Posted on: June 29th, 2013 by
4

1 11 21 1211 111221 312211 13112221 ? via Idoia

## Binary expression tree

Posted on: June 28th, 2013 by
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 $(a+b)^2=a^2+2ab+b^2$? 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

Posted on: June 27th, 2013 by
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

Posted on: June 26th, 2013 by
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

Posted on: June 25th, 2013 by
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

Posted on: June 24th, 2013 by
4

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

Posted on: June 23rd, 2013 by
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

Posted on: June 22nd, 2013 by