## Author Archives: admin

## Guess hat color

Consider the picture below: In this picture, there are 4 prisoners buried in the ground. There is a brick wall separating A and B. C can see B and D can see both B and C. Between the 4 prisoners, 2 white and 2 black hats are worn. No one can see their own hat [Read the full story ...]

## Liars, truth-tellers, mathematicians and physicists

There are N mathematicians and N physicists in a circular table. Some of them are liars and some are truth-tellers. The number of truth tellers who are mathematicians is equal to the number of truth teller a who are physicists. They are all asked, "Is the person next to you a mathematician or a physicist?" [Read the full story ...]

## Guess a coin for freedom

A and B are prisoners. The jailer have them play a game. He places one coin on each cell of an 8x8 chessboard. Some are tails up and others are heads up. B cannot yet see the board. The jailer shows the board to A and selects a cell. He will allow A to flip [Read the full story ...]

## Two dimensional sort

You start with a shuffled deck of 52 cards numbered 1,2,3,...52. You place them in 4 rows and 13 columns. Then you sort each row in ascending order as per their number. Then you sort each column in ascending order. After this procedure, determine the maximum number of swaps needed to sort a particular row. [Read the full story ...]

## Find the missing number

You have an array with 99 distinct entries, each entry being an integer from 1 to 100. Find the missing number in the shortest possible time and O(1) memory. Bonus: Now you have an array with 98 distinct entries, each entry being an integer from 1 to 100. Find the two missing entries in the [Read the full story ...]

## Dividing a Pizza

Consider the circle shown below: The diameter BM is divided in to 11 equal length segments: BC,CD,DE,...LM. Then we complete semicircles with diameters CM,DM,...KM,LM on the top of BM and semicircles with diameters BC,BD,BE,....BL on the bottom of BM. These semicircles divide the circle in to 11 blade-shaped objects. Show that all blades have the [Read the full story ...]