Tuesday 23 October 2012

2n digit number

i) Consider a 4 digit number abcd. Will there exist a 'k' such that
abcd = k*ab*cd
If so, find the k and abcd?
ii) Now, consider a 6 digit number abcdef. Will there exist a 'k' such that 
abcdef = k*abc*def
If so, find the k and abcdef?
iii) Using these 2 results, what can you conclude about a existence of a 'k' for a generic 2n digit number?

Maximum and Minimum of array

Find the maximum and minimum of an array of 'n' numbers using only 3n/2 comparisons.

PS: This question was given to us in the DS class.

Saturday 20 October 2012

Color matching in concentric circles

A circle is divided into 8 equal sectors. Half are coloured red and half are coloured
blue. A smaller circle is also divided into 8 equal sectors, half coloured red and half
coloured blue. The smaller circle is placed concentrically on the larger. Prove that
no matter how the red and blue sectors are chosen it is always possible to rotate the
smaller circle so that at least 4 colour matches are obtained.

Saturday 13 October 2012

Monte Hall Variant - 2

Continuing to the previous problem, if each door contain a car with probability 'p'.
What will be your decision to the options listed in previous post?
Also, at what value of 'p' will you change your option?

Wednesday 10 October 2012

Monty Hall Variant

Consider 3 doors A,B,C and each of them can have a car worth Rs 3 lac with 0.5 probability. Now, you chose door A and the show host opened one of the door which contained a car. Now, he has given you 3 offers
Offer 1: You can stick to door A
Offer 2: You can change your door
Offer 3: Take 1,25,000 and leave the game

Which offer would you chose? What is the minimum amount the show host must offer you so that you can take his offer and leave the show?

Assumption: Show host knows everything behind the doors

Sunday 16 September 2012

Center of a circle

Using only a compass, can you find the center of a circle?
NOTE: You can't use anything other than compass. Not even a ruler or a scale. This implies, you can't make a straight also.

Dominoes on a square board

Suppose you have cut off the two diagonally opposite corner squares of a regular 8×8 square board, as shown above, 62 squares remain. Now you have a set of 2×1 dominoes, each of which covers two squares that are adjacent vertically or horizontally. Is it possible to use 31 of these dominoes to tile all 62 squares?

13 coins

You are given 13 coins out of which one is defected. You don't know the defect 'heavy' or 'light'. Also you are given an authentic coin. You are allowed to use weighing balance 3 times. Give a strategy to find the defected coin and its defect.

NOTE: This is in continuation to the puzzle "Balls and Weighing Balance". If you are asked to only the defected coin, you can do so without the authentic coin also. But to find the defect, you need to figure out a new strategy making use of authentic coin.
Just, to avoid confusion, total coins would be 14(13 + 1authentic coin)

Grid Infection

In an n by n grid of squares, two squares are neighbors if they share an edge. Initially, some squares are "infected". At successive clock ticks, an uninfected square gets infected if at least two of its neighbors are infected. How many squares must initially be infected so that all squares eventually get infected?

Fox in a Hole

Consider 'n' holes in a line. One of them is occupied by a fox. Each night, the fox moves to a neighboring hole, either to the left or to the right. Each morning, you get to inspect a hole of your choice. What strategy would ensure that the fox is eventually caught?

Poison in Drink????

There was a booz party going on with many guests. Some of the guests left early after enjoying their drinks. While the others drank overnight. Next morning, news came out that everyone in the booz party died due to poison. Only those who left did not died. Figure out the source of poison when the same drink drank by the early leavers were able to survive. It has nothing to do with the quantity of poison consumed.

Monday 13 August 2012

Varaint of a 10 digit number

Consider a 10-digit number A written as a_1a_2...a_10. A contains each of the digits from 0 to 9 exactly once. The number a_1 is divisible by one. The number a_1a_2 is divisible by two. The number a_1a_2a_3 is divisible by three, and so on...What is A?

A 10 digit number

Consider a 10-digit number A written as a_0a_1a_2...a_9. Now, suppose a_0 is the number of times the digit '0' appears in A; a_1 is the number of times '1' appears in A, and so on... a_9 is the number of times '9' appears. What is A?

Bulbs & Switches

Suppose you have 'n' lightbulbs and 'n' switches that correspond to each of the lightbulbs. Initially, all the lightbulbs are turned off. After you flip a switch, the corresponding lightbulb turns on. If you flip the same switch again, the lightbulb turns off. Each switch corresponds to only 1 lightbulb and vice versa. After 'k' random switches are flipped, what is the expected number of lightbulbs turned on?

Saturday 11 August 2012

Pieces of a Stone

Consider a stone of 'n' kg. What is the minimum number of pieces should the stone be broken so that you can measure all the weights from 1 to 'n' kg in a weighing balance (taraju)? What should be the weight of the each individual piece?

Height of a room

You need to measure the height of an isolated room. There is a bulb hanging from the roof of the room such that it just touches your head while you are in standing position. You are given a meter scale and an alarm clock.

Thursday 9 August 2012

Fly in the Tea

A person went to a restaurant and ordered a cup of tea. A fly fell off in his tea. He asked the waiter to replace it. After a while, the waiter brought a new cup of tea. What should be the strategy of the person to identify whether he has brought the same tea or not. He can take a sip if he wants.

Four Digit Whole Number

Find a four digit number 'n' such that the last 4 digits of n^2 are same as that of n

Wednesday 25 July 2012

Tripod Vs Quadpod Stand

Why a tripod stand is much more stable than a quadpod stand? Or why does camera persons always tripod stand rather than a quadpod stand?

Sunday 22 July 2012

Repeated Albhabets

Consider a 36 letter word. Find the expected number of the alphabets that would be repeated?

Wednesday 18 July 2012

Undercover Agent's Dillemma

You are an undercover agent, currently working with a criminal gang. The gang doubts you as an undercover agent but is not sure.
You have been given a gun to shoot another agent to prove that indeed you are a part of the gang. (You don't know whether the gun is loaded or empty)
Analyse the situation being the undercover agent and decide will you shoot the agent or will you shoot the head of the criminal gang.

Selection through identical balls

You randomly withdraw 3 balls out of a lot containing identical red, identical green and identical blue balls. What is the probability that you get 1 red, 1 green and 1 blue ball given the number of
a) Red balls = 3,  Green balls = 3,  Blue balls = 3
b) Red balls = p,  Green balls = q,  Blue balls = r such that p,q,r>3
c) Red balls = infinity,  Green balls = infinity,  Blue balls = infinity

Monday 16 July 2012

Search for Celebrity

Consider a party of n people. Consider a matrix A (nXn) with each entry being either 0 or 1. 
A(ij) = 1 if the ith person knows jth person in party
A(ij) = 0 if the ith person doesn't know jth person in party
Also note that A(ij) is not always equal to A(ji)


A celebrity is the one who doesn't know anybody but everybody knows him. 
Can you find the celebrity in O(n).

Disclaimer: This was again asked in GSach Interview which I was unable to answer. I guess you can try using directed graphs for solving this but not sure.

Array of natural number

Consider an array 'A' of 1st n natural numbers randomly permuted. Consider an array B formed from array A as given below
B(k) = number of elements from A(1) to A(k-1) which are smaller than A(k)
Obviously B(1) = 0;
i) Given A can you find B in O(n)
ii) Given B can you find A in O(n)


Disclaimer: The question was asked to me during GSachs interview and of course I was unable to answer. I am still unable to figure out the solution

Solid Diagonal of Brick

Given to you are 3 identical bricks and a measuring tape, you need to find the length of the solid diagonal of the brick without applying any mathematical formula.

Sunday 15 July 2012

Knight of chess

A knight of chess is present on A1 square of chessboard. Within 63 steps he moves H8 square of board such that in every move, he goes to a new square thereby covering all the 64 squares of the board. How many ways can he do this?

Saturday 14 July 2012

Casino Tables

Why do casino tables always keep a maximum limit on the money bet?

Guess the numbers

You need to guess 3 natural numbers x, y, z. You can be provided with two weighted average sums (i.e) ax+by+cz with any coefficients a,b,c (i.e.) you give any a,b,c i ll provide you with ax+by+cz, however this freedom is only allowed twice.

This question is very similar to the question "Guess the polynomial"

Find the flaw

Let S = 1-1+1-1+1-1+....................................
Now, clearly the series is divergent and the sum won't exist. But, find a flaw in this argument

S = 1-1+1-1+1-1+.................................... (i)
S =     1-1+1-1+1-1+....................................(ii)
Adding (i) and (ii)


2S = 1
S = 0.5

Friday 13 July 2012

Cadbury Pieces

A cadbury bar of m X n cm^2 has to be broken into pieces of 1X1 cm^2. Considering you can only break it either horizontally or vertically in one step. What is the minimum number of steps needed?

Thursday 12 July 2012

Number Elimination Game

There is a box containing 'n' numbers from 1 to 'n'. A person randomly picks 2 of them, say x and y and replaces them with a single number x+y+xy. He continue this until the last number is left. Find the last number remaining?


Coin Flipping


You first flip a coin and the outcome (H or T) is recorded. You keep flipping until the first outcome is repeated, ending the game. You get paid $1 for each time you flipped the opposite outcome. What do you expect to win?

Also if the coin is biased with P(H) = p, what do you expect to win?

Position for winning

There are 100 persons standing in a line. Each of them is asked to choose a number between 1 to 100. The first person to have a matching number of someone ahead of him in the line will win. The poor first person has no chance of winning. Which person has the maximum chance to win?

Camel and Grass

Consider a camel who needs to transport 3000 kg of grass to a city 1000 km far. However, camel can only load 1000kg in one go. Also for every km he walks, he eats a kg of grass. Find the maximum possible amount of grass that can be transported.

Guess the hat

Consider infinite people with each wearing a red or a black hat such that they can't see their hat but can see other's hat. Now, everybody has to tell the color of his hat simultaneously.
a) Derive a strategy such that infinite people can say correct answer
b) Derive a strategy that only finite people will say wrong answer

Sphere and the Heat Source

Consider a metallic sphere kept in vacuum. There is only one heat source kept at a distance from the sphere. You need to prove that there will always exist two diametrically opposite points on the sphere where temp would be same irrespective of the position of the heat source.

Wednesday 11 July 2012

Ping Pong game

Suppose A and B are equally strong ping pong players. Is the probability of A beating B in 3 out of 4 games is same as that of he beating in 6 out of 8 games?

St. Petersbug Paradox

Consider an event of tossing a coin until head appears. You earn 2^n $ if head appears on the nth trial. What do you expect to win? How much you would be willing to pay to play this game?

Differences in Area

Find the expected difference in area of a rectangle and a square whose length, breadth and side are chosen uniformly randomly from an interval of (0,1)?

Splitting Land


Your father owns a rectangular field, from which the city has appropriated a smaller rectangular patch. He wants to split the remainder between you and your brother by drawing only a line so that each of you two gets equal area.
How can he do this?

Guess the polynomial

Consider a polynomial p(x) of any degree such that all its coefficients are positive integer valued. You can ask the value of p(x) for any two values of x. What values of x will you ask and can you find the exact polynomial using these values?

Option on a dice

For Finance Enthusiasts
What will be the price of the option on the roll of a dice if the strike value is 3?

Sunday 8 July 2012

Colliding Ants

There are 'n' ants randomly placed on a meter scale. Each of them started moving independently and randomly in one of the direction. If the two ants collide, they reverse their directions and they fall if they reach the end of the scale. Under what initial arrangement of ants, will they take the maximum possible time to fall off?

Importance of Central Limit Theorum

This question would signify the usefulness of CLT

A coin is tossed 100 times. I would pay you 1000 if Head appears less than 40 times otherwise you pay me 100. Would you be willing to play?

Friday 6 July 2012

Envelopes Paradox

You are given two indistinguishable envelopes, each of which contains a positive sum of money. One envelope contains twice as much as the other. You may pick one envelope and keep whatever amount it contains. You pick one envelope at random but before you open it you are offered the possibility to take the other envelope instead.


NOTE: Think on the lines of the expected value if you choose the other envelope while holding the present envelope.

Daily Happenings

Why do red ambassadors consume less petrol than white?
Why do manhole covers are generally round?
Why do bucket is always of the shape of invert frustum rather than a frustum or a cylinder?

Thursday 5 July 2012

Color a Cube?

You need to color a cube with 6 colors with each face having a unique color. Find total possible coloring combinations?

Coin Tossing Events

Consider an event A when HTH comes simultaneously. Consider an event B when TTH comes simultaneously. Find the probability that the event A occurs before event B?

Tuesday 3 July 2012

Total Solutions

Find all possible non negative integer solutions of x,y. Assume k is a constant

1/x + 1/y = 1/k

Sunday Born Boy

Given are 2 children. What is the probability that both of them are boys given that one of them is a boy and is born on Sunday?

Last Man Standing

A queue of 100 guys is there. 1st one kills 2nd and passes the pistol to 3rd one, then 3rd one kills the next and so on. Once the 99th one kills the 100th one, 99th one passes the pistol to 1st one and the process continues on. Find the last person remaining?

Monday 2 July 2012

Journey to home

A student leaves the coaching everyday at 11. His brother leaves the house some time before 11 to reach coaching at 11 to pick the student. One day, the coaching got over at 10 and the student started walking towards home at 8km/hr. In the way, he found his brother coming and then they went together reaching home 20 mins earlier than usual time. Find the speed of his brother?

Sunday 1 July 2012

Can Prisoners survive?


There were 100 prisoners which were asked to stand in a line such that the 100th one can see all, 99th one can see the other 98 and so on. There are two sets of cap Black and White. The king decides to put these caps on each of the prisoners(the prisoner can't see his cap but can see all people standing before him caps) randomly and then the king asked each of them to tell their cap color starting from the 100th prisoner, then 99th and so on. If the prisoner answers correctly, the king leaves him otherwise the prisoner is shot dead. If the prisoners are allowed to formulate a strategy, how many prisoners can be saved.
NOTE: Every prisoner can hear every priosoner's answer

Balls and Weighing balance

There are some 'n' identical balls of which 1 is defective( don't know heavy or light). If you are allowed to use weighing balance 'k' times what can be the maximum value of 'n'?

A Card to identify


There are 5 cards randomly given to you. You throw one of them by your choice and arrange rest 4 of them in an order such that your friend can identify the card you threw by looking at the order?
Note: You can form a strategy with your friend

Maximum of two numbers

Write a function that will return maximum of 2 numbers(a,b) without actually comparing them.