Friday, February 20, 2009

Puzzle: House Numbers

Presenting a simple but interesting puzzle.

Problem:
You live on a street with N houses, where N is between 50 and 500. The houses are numbered consecutively from 1 to N and are all on one side of the street. You notice that all the numbers on one side of your house add up to exactly the same total as all the numbers on the other side of your house. What is the number of your house?

Solution: Let 'x' be your house number. Then,

sum (i=1 to x-1){i} = sum(i=x+1 to n){i}

x(x-1)/2 = {n(n+1)/2 - x(x+1)/2}

x(x-1) + x(x+1) = n(n+1)

x^2 = n(n+1)/2

Looking at this equation, the conclusion is that the value of n should be such that:
- n/2 and (n+1) are both themselves squares, or,
- n and (n+1)/2 are both themselves squares

A simple C program indicates that the value of n is 288 and your house number is therefore, 204.

Tuesday, February 17, 2009

Puzzle: Safe boating

A simple version of the traditional boating and the hungry companions problem follows. Will try to find similar problems and post them as a bunch.

Problem:
A boatman has to ferry across a stream a wolf, a goat, and a basket of cabbages. His boat is so small that only one of the three, besides himself, can be contained in it.

How is he to manage, so that the wolf shall have no opportunity of killing the goat, or the goat of eating up the cabbages ?

Puzzle: Water and Wine

Problem: You have two glasses each filled with exactly the same amount of liquid. One containing water, the other, wine.

First take a teaspoon of water from the water glass and pour it into the wine glass. Next stir the wine and water until well mixed. Then take a teaspoon of the water and wine mixture and pour it into the glass of water.

The question is: is there more/less/equal wine in the water glass than water in the wine glass ?

Puzzle: Truth City

Problem: You are on your way to Truth City, where the inhabitants always tell the truth. At one point you reach a fork in the road, with one branch leading to Truth City and the other leading to Lies City, where the citizens are all liars. The road signs at the junction are, as you can imagine, confusing, but there is a man standing there from whom you can ask directions.

The only problem is, you don’t know where he is from – the city where everyone always gives the right answer or the city where everyone lies. If you have time to ask him only one question, what question will ensure that you will be headed in the right direction ?

Puzzle: Hats off

Problem: Inside of a dark closet are five hats: three blue and two red. Knowing this, three smart men go into the closet, and each selects a hat in the dark and places it unseen upon his head. Once outside the closet, no man can see his own hat.

The first man looks at the other two, thinks, and says, “I cannot tell what colour my hat is.”

The second man hears this, looks at the other two, and says, “I cannot tell what colour my hat is either.”

The third man is blind. The blind man says, “Well, I know what colour my hat is.”

What colour is his hat?

Puzzle: Ages of sons

Problem: Two mathematicians meet on a plane.
"If I remember correctly, you have three sons”, says A. “What are their ages today?”.

“The product of their ages is thirty-six”, says B, “and the sum of their ages is exactly today’s date”.

“I am sorry, B”, A says after a minute, “but that doesn’t tell me the ages of your sons”.

“Oh, I forgot to tell you, my youngest son has red hair”.

“Ah, now it’s clear”, A says, “I now know exactly how old your three sons are”.

What are the ages of B’s sons ?