Sunday, May 11, 2014

Cigars on Circular Table

Problem Let's say we play a simple game. I have a circular table and an unlimited supply of identically shaped Cuban cigars. We each take turns placing a cigar on the table without disturbing any other cigars already there in the process and without overlapping any pair of cigars. The winner will be last person to successfully place a cigar on the table subject to the given restrictions. If I give you the option of going first, how would you play in order try and win   Solution Since the circle is symmetric.around the...

Measure 45 minutes

Problem You have two strings of rough non-countinuous composition (in other words these strings are not ideally uniform.) You know that each will take exactly half an hour to burn no matter which end is lit. How can you measure a time interval of 45 minutes with 1.2 match sticks available 2.only one match (which only sustains a flame for a few seconds) Solution Solution with 2 matches...Old solution for 2 matches.1.Burn one string full..measure 30 min.2. Burn second string from both sides..and measure 15 min.3. Total time measure...

Cards with Vowel & Even number

Problem There are 4 cards on a table. Each has a number on one side and a letter on the other. The cards show A,B,1 and 2. Which 2 cards would you turn over to test the rule that "All cards with a vowel on one side have an even number on the other".   Solution A and 1, since by elimination...1.we have to take A as if there is a odd no.. back of A then our rule get's violated so without picking A we can't be sure that our rule holds good.2. B we can leave since it doesn't satisfy the rule at all, doesn't have a vowel...

Wire Connections

Problem There are 66 wires connecting from the top floor to the ground floor. You can see the ends of the wires but you don't know which one on the ground floor connects to which one on the top floor. You can tie the ends of several wires together and test the connections at the other end by using a bulb and battery. For example, if you first tie wires A, B, and C together at the ground floor and then go up to the top floor, you will figure out that the bulb will light if you put it between A and B, A and C, or B and C. You...

OLD MONKS

Problem There are monks in a monastry who don't speak(or communicate in any sense) with each other and have no have no mirrors or any reflective surface at their disposal. Evn the water they drink is from a "surahi" type pitcher(the opening is narrow and no reflection can be seen) and the floor is of extremely porous clay so that if u drop water to see reflection, the ground soaks it up so fast that it won't work.Now their leader is allowed to speak and he tells them that some monks have been infected with a disease that has marked...

Handshakes at Party

Problem I was at a party with MS one evening where he got bored and started keeping track of the number of handshakes made by people. A person was called "odd person" if he made an odd number of handshakes, otherwise he was called "even person". After some time MS said to me, "Hey AD, do you know that there are an even number of odd persons?" I replied, "Big deal, MS. There will be always an even number of odd persons!" But still he seemed confused. Justify ...  SAME NUMBER OF HANDSHAKES------------------------- At a dinner...

Key Exchange Puzzle

Problem Jan and Maria have fallen in love (via the internet) and Jan wishes to mail her a ring. Unfortunately, they live in the country of Kleptopia where anything sent through the mail will be stolen unless it is enclosed in a padlocked box. Jan and Maria each have plenty of padlocks, but none to which the other has a key. How can Jan get the ring safely into Maria's hands? Solution Diffe Hilemann key exchange work's in a similar way... Jan sends the ring in a box with padlock A. Maria receives it she put her padlock B and sends it back...

Russian Roulette

Problem Lets play a game of Russian roulette. You are tied to a chair and can't get up. Here is the gun , six chambers all empty. Now I put two bullets in the gun and I put these bullets in the adjacent chambers. I close the barrel and spin it. I put the gun to your head and pull the trigger. Click and the slot was empty. Now before we start the interview I want to pull the trigger one more time , which one do you prefer , that I spun the barrel first or that I just pull the trigger ? What happens if  the two bullets aren't...

Ages of Sons

Problem There are two guys standing before a building with multiple floors. First: "I have three children, the product of their ages is 36, can you guess their ages?" Second: "No" First: "The sum of their ages is equal to the number of floors in the opposite building, can you guess now?" Second: "No" First: "My youngest son is a very good dancer" Second: "Yeah, I know now" Assuming that both these guys are extremely intelligent and follow common-sense logic to find out the ages of first's children. ...

Cut a rectangular Cake

Problem How do you cut a rectangular cake into two equal pieces when someone has already taken a rectangular piece from it? The removed piece an be any size or at any place in the cake. You are only allowed one straight cut.    Solution Join the centers of the original and the removed rectangle. It works for cuboids too! References http://sudhansu-codezone.blogspot.in/2011/12/cut-rectangular-cake.html ...

Truth AND Lies

Problems 1.When a person has to find out which of the two paths lead to his destination and there are two guys sitting there, one of which always speaks the truth and the other always lies. What is the single question he can ask to reach his aim? 2.There are two ways (like previous question). One right and the other wrong. But there are 3 guys. One will always speak the truth or keep mum(if he does not know the answer). One will always lie or keep mum(if he does not know the answer). The third will never keep mum and may speak...

Rope Around EARTH

Problem A fool wants to tie a rope around the earth. So he buys a rope of 40,000 KM and ties it around the world. His neighbour, also a fool, wants to do the same only he wants the rope on sticks 1 meter above the ground. How much more rope does he need?   Solution The outline of a circle is 2*PI*r. If you want a rope that is one meter above the ground rnew=r+1. So you need 2*PI*(r+1)-2*PI*r more rope.So,x=2*PI*(r+1)-2*PI*rx=2*PI*r+2*PI-2*PI*rx=2*PIx=6.28It does not matter what the radius of the circle is. You always need...

THE DEVIL & COLORED HATS

100 people find themselves at the gates of hell. The devil tells them that they'll have a chance to go to heaven instead, but first they'll have to play a game. The devil is going to line them all up in a straight queue, each person facing the back of the next person in line. The order of people in this line will be randomly chosen when the game starts. He is then going to put a red or blue hat on each person. Each hat can be red or blue at random. Nobody knows the color their hat will be before the game starts. Each person...

Black and white hats - Who knows what he is wearing

There are four man standing in front of a firing-squad. Two of them (nr.1 & 3) wear a black hat and two of them (nr.2 & 4) wear a white hat. They are all facing the same direction and between nr.3 and nr.4 stands a brick wall (see picture). So nr.1 can see nr.2 & 3, nr.2 sees nr.3, nr.3 sees only the wall and nr.4 doesn't see a thing. The men know that there are two white and two black hats. The commander of the firing-squad is willing to let the men go if one of them can say what color hat he is wearing. The men are not...

Prisoners and Boxes

You are the janitor at a prison with 100 prisoners locked in separate, soundproof and windowless cells. You watch one day as the warden brings the prisoners out to a central room where there are 100 boxes laid out, labeled 1 through 100. He hands each prisoner a slip of paper and a pen, and asks everyone to write their name on their slip and hand it back to him. All the prisoner's have different names. The warden then makes a proposition to the prisoners. He will put them back in their cells and will put each of the 100 slips...

Prisoner and lightbulb

Problem There is a prison with 100 prisoners, each in separate cells, which are sealed off, soundproof and windowless. There is a lobby in the prison with a lightbulb in it. Each day, the warden will pick one of the prisoners at random (even if they have been picked before) and take them out to the lobby. The prisoner will have the choice to flip the lightbulb switch if they want. The lightbulb starts in the "off" position. When a prisoner is brought out to the lobby, he also has the option of saying "Every other prisoner has...

Any five Cards

Problem You meet a magician and his assistant, who decide to show you a trick. The assistant leaves the room, and the magician hands you an ordinary deck of 52 cards. He has you choose any 5 cards from the deck and give them to him. He looks over the 5 cards you chose, takes one of them, and hands it back to you. "That going to be your card," he says. He asks you to put it in your pocket out of sight. He then takes the four remaining cards and arranges them in a stack in a special order. All four cards in the stack are face-down....

Travelling MONK

A monk leaves at sunrise and walks on a path from the front door of his monastery to the top of a nearby mountain. He arrives at the mountain summit exactly at sundown. The next day, he rises again at sunrise and descends down to his monastery, following the same path that he took up the mountain. Assuming sunrise and sunset occured at the same time on each of the two days, prove that the monk must have been at some spot on the path at the same exact time on both days....

Leap year Birthday

Problem Bill and Stacie are delighted when their new baby, Patrick, is born on February 29th, 2008. They think it's good luck to for him to be born on the special day of the leap year. But then they start thinking about when to celebrate his next birthday. After some thought, they decide that they want to celebrate Patrick's next birthday (when he turns 1) exactly 365 days after he was born, just like most people do. What will be the date of this birthday? Answer 28th, 2009. Solution  At first it might seem like...

Crossing the BRIDGE past the GUARD

Problem A guard is stationed at the entrance to a bridge. He is tasked to shoot anyone who tries to cross to the other side of the bridge, and to turn away anyone who comes in from the opposite side of the bridge. You are on his side of the bridge and want to escape to the other side. Because the bridge is old and rickety, anyone who tries to cross it does so at a constant speed, and it always takes exactly 10 minutes to cross. The guard comes out of his post every 6 minutes and looks down the bridge for any people trying to...

NEWYORK HAIR (Pigeonhole Principle)

Problem You are visiting NYC when a man approaches you. "Not counting bald people, I bet a hundred bucks that there are two people living in New York City with the same number of hairs on their heads," he tells you. "I'll take that bet!" you say. You talk to the man for a minute, after which you realize you have lost the bet. What did the man say to prove his case? Solution This is a classic example of the pigeonhole principle. The argument goes as follows: assume that every non-bald person in New York City has a different...

Paying with RINGS

Problem A man comes to a small hotel where he wishes to stay for 7 nights. He reaches into his pockets and realizes that he has no money, and the only item he has to offer is a gold chain, which consists of 7 rings connected in a row (not in a loop). The hotel proprietor tells the man that it will cost 1 ring per night, which will add up to all 7 rings for the 7 nights. "Ok," the man says. "I'll give you all 7 rings right now to pre-pay for my stay." "No," the proprietor says. "I don't like to be in other people's debt, so I cannot...

The MISSING Servent

Problem A king has 100 identical servants, each with a different rank between 1 and 100. At the end of each day, each servant comes into the king's quarters, one-by-one, in a random order, and announces his rank to let the king know that he is done working for the day. For example, servant 14 comes in and says "Servant 14, reporting in." One day, the king's aide comes in and tells the king that one of the servants is missing, though he isn't sure which one. Before the other servants begin reporting in for the night, the king asks...

TWO HOURGLASSES to measure 2 minutes

Problem You have two sand hourglasses, one that measures exactly 4 minutes and one that measures exactly 7 minutes. You need to measure out exactly 2 minutes to boil an egg. Using only these two hourglasses, how can you measure out exactly 2 minutes to boil your egg?  What if boiling eggs  take 9 minutes?   Solution Boiling the eggs take 2 minutes 4 minutes : 7 minutes #1:#24 : 7 Start both timers0 : 3 After 4 min4 : 3 Invert #11 : 0 After 3 min1 : 7 Invert #2 and start cooking egg0 : 6 After 1 min (egg half-cooked)0...

TRUTH OR LIES

Problem You're walking down a path and come to two doors. One of the doors leads to a life of prosperity and happiness, and the other door leads to a life of misery and sorrow. You don't know which door is which. In front of the door is ONE man. You know that this man either always lies, or always tells the truth, but you don't know which. The man knows which door is which. You are allowed to ask the man ONE yes-or-no question to figure out which door to go through. To make things more difficult, the man is very self-centered,...

Ants on a board

Problem There are 100 ants on a board that is 1 meter long, each facing either left or right and walking at a pace of 1 meter per minute. The board is so narrow that the ants cannot pass each other; when two ants walk into each other, they each instantly turn around and continue walking in the opposite direction. When an ant reaches the end of the board, it falls off the edge. From the moment the ants start walking, what is the longest amount of time that could pass before all the ants have fallen off the plank? You can...

Engineers & Managers

Problem You have just purchased a small company called Company X. Company X has N employees, and everyone is either an engineer or a manager. You know for sure that there are more engineers than managers at the company. Everyone at Company X knows everyone else's position, and you are able to ask any employee about the position of any other employee. For example, you could approach employee A and ask "Is employee B an engineer or a manager?" You can only direct your question to one employee at a time, and can only ask about...

Worm Crawls

A rubber string is 10 meters long. A worm crawls from one end to the other at 1 meter/hr. After each hour the string stretches to become 1 meter longer than it's last length.Will it reach the end ? Solution Yes, the worm will reach the end because at the end of every hour when rubber band stretches, the distance travelled by the worm in past hr(s) will also increase and remaining distance to travel becomes less as compared to earlier.For exapmle:at the end of 1st hour:worm has tarvelled: 1meterNow, when the whole length of rubber band becomes...

The Knight's Tour is a famous chess problem, in which a knight starts on the top-left square of an ordinary chessboard and then makes 63 moves, landing on every square of the chessboard exactly once (except for the starting square).Can you complete the Knight's Tour? For a further challenge, can you find a "closed" solution, meaning that the knight can make a 64th move to land back on the starting square (thus making the solution circular)? Solution This...

Saturday, May 10, 2014

Given 9 Dots, draw 4 Lines without picking up pen

Problem Look at the 9 dots in this image. Can you draw 4 straight lines, without picking up your pen, that go through all 9 dots? Solution ...

Putting numbers in 3X3 matrix - s.t. Rows OR columns or diagonals add till 15

How can you place the numbers 1 through 9 in a 3x3 grid such that every row, column, and the two diagonals all add up to 15? Solution It first seems logical to put the 5 in the middle square becuase it is the median and mean of the numbers from 1 to 9 (and also the average of any 3 numbers adding up to 15). The next thing to do is place the 1 since it's the smallest and will thus be likely to quickly constrain what we can do afterward. We can...

Robots on a line

Two robots are placed at different points on a straight line of infinite length. When they are first placed down, they each spray out some oil to mark their starting points. You must program each robot to ensure that the robots will eventually crash into each other. A program can consist of the following four instructions: Go left one space Go right one space Skip the next instruction if there is oil in my current spot Go to a label [Note...

Brothers and sisters

Problem You and a friend are standing in front of two houses. In each house lives a family with two children."The family on the left has a boy who loves history, but their other child prefers math," your friend tells you."The family on the right has a 7-year old boy, and they just had a new baby," he explains."Does either family have a girl?" you ask."I'm not sure," your friend says. "But pick the family that you think is more likely to have a girl. If they do have a girl, I'll give you $100."Which family should you pick, or does it not matter? Solution They...

Using 5,5,5,5,5 can you make 37 along with any arithmetic operation.

Using 5,5,5,5,5 can you make 37 along with any arithmetic operatio...

Make 3 3 7 7 equal to 24

Using only and all the numbers 3, 3, 7, 7, along with the arithmetic operations +,-,*, and /, can you come up with a calculation that gives the number 24? No decimal points allowe...

Cards in the Dark

Problem You are standing in a pitch-dark room. A friend walks up and hands you a normal deck of 52 cards. He tells you that 13 of the 52 cards are face-up, the rest are face-down. These face-up cards are distributed randomly throughout the deck.Your task is to split up the deck into two piles, using all the cards, such that each pile has the same number of face-up cards. The room is pitch-dark, so you can't see the deck as you do this.How can you accomplish this seemingly impossible task? Solution There are 13 cards with face up, and rest 39...

Islanders with dotted forheads

Problem There is an island with 100 women. 50 of the women have red dots on their foreheads, and the other 50 women have blue dots on their foreheads.If a woman ever learns the color of the dot on her forehead, she must permanently leave the island in the middle of that night.One day, an oracle appears and says "at least one woman has a blue dot on her forehead." The woman all know that the oracle speaks the truth.All the woman are perfect logicians (and know that the others are perfect logicians too). What happens next? Solution Base case....

Get the job puzzle

Problem A company plan to recruit people. But, ends up finding many more than eligible people.So, they plan a strategy to cut short the people to their suit the headcount of their requirement. People will be lined up in a queue 1, 2, 3… N.  At first phase, people at odd locations will be eliminated. Same thing will apply for next phase. For example, Round 1: 1, 2, 3, 4, 5, 6….N Round 2:  2, 4, 6.. N  (People at odd locations eliminated) Round 3: 4, 6… N (People at odd locations eliminated) Given the value of N, where will you...

ATM Money Withdrawal Limit

Problem Assumptions:a) I have infinite money in my accountb) The daily limit of amount of money that can be withdrawn from an ATM is finitec) You can login into an ATM Machine only once a dayd) If you login into the machine and enter a large number to withdraw, you will not get anything. And hence, you will not be able to withdraw anything from the ATM for the day.e) I do not know what the daily limit is.What strategy should I choose so that I can withdraw N rupees in minimum number of days? Solution Of course, you can do it in N days (withdrawing...

Number the 8 boxes so that no consecutive numbers touch

There are 8 boxes. Place the numbers 1 through 8 in each square so that no consecutive number touches another (including diagonally). In other words, 1 cannot touch 2, 5 cannot touch 6, 5 cannot touch 4, etc, etc. ...

Minimum Sips

Problem Given 1000 bottles of juice, one of them contains poison and tastes bitter. Spot the spoiled bottle in minimum sips. Solution We can do it in log(n) and that would be 10 sips. Of course it can be done in 1000 sips by checking each bottle but to do it in 10 sips you can take one drop from 500 bottles and mix them, if it is sour than the bottle is in those 500 or it is in different 500.Then out of those 500 you take 250 and do the same and rest is the binary search ...

Aeroplanes round the world

Problem On Bagshot Island, there is an airport. The airport is the homebase of an unlimited number of identical airplanes. Each airplane has a fuel capacity to allow it to fly exactly 1/2 way around the world, along a great circle. The planes have the ability to refuel in flight without loss of speed or spillage of fuel. Though the fuel is unlimited, the island is the only source of fuel.What is the fewest number of aircraft necessary to get one...

River, Soldiers & Boat and children

Problem  Consider there are 10 soldiers on the one side of the river. They need to go to the over side of the rever. There is no bridge in the rever and no one can swin in the rever. One of the soldiers spots the boat with two boys inside. The boat is very small and the boys in the boats also very small. The boat can either hold two boys or one soldier. Now tell me how can all soldiers go to the other side of the river using this boat ? Solution First you have the two boys take the boat to one side of the river and leave a boy on that...

Measure weights in balance

Problem Puzzle 1:The puzzle is if the shopkeeper can only place the weights in one side of the common balance. For example if shopkeeper has weights 1 and 3 then he can measure 1, 3 and 4 only. Now the question is how many minimum weights and names the weights you will need to measure all weights from 1 to 1000. This is a fairly simple problem and very easy to prove also. Answer for this puzzle is given below.Solution :This is simply the numbers 2^0,2^1,2^2 ... that is 1,2,4,8,16... So for making 1000 kg we need up to 1, 2, 4, 8, 16, 32, 64,...

Last ball of Red Balls & Blue Balls

Problem A bag has 20 blue and 14 red balls.Each time you randomly take two balls out of the bag.(Assume each ball has equal probability of being taken).You do not put the two balls back.Instead,if both balls are of same color,you add a blue ball to the bag;if they have different color,red ball is put in the bag.Assume that you have infinite supply of red and blue balls,if you keep on repeating this process ,what will be color of last ball left in the bag.Will the case remains same if we have 13 red balls???? Hint: Analyze the number of...

Deck of cards - Pick the cards with same color

Problem  A casino offers a card game using a normal deck of 52 cards.The rule is that you turn over two cards at a time.If both of them are red,they go to your pile ;if both are black they go to dealer's pile;and if one black and one red they are simply discarded.The process is repeated until you go through all the 52 cards.If you have more cards in your pile you will get $100,otherwise(including ties)you will get nothing.The casino allows you to negotiate price you want to pay for the game.How much you would be willing to pay for the game. Solution To...

Honest Man and single Question

Problem An honest man holds a card with one of the three possible numbers on it “1”, “2” or “3”. You can ask one question and the man allowed to answer only “Yes”,”No” and “I don’t know”. The honest man obviously never lies. Which question would you ask to say with 100% certainty which number is on the card the honest man holds? Solution          Question should be: "If I substract 2 from your number, and then take squery root, would the result be greater than zero?" Man's number 3 -> Sqrt(3-2)=Sqrt(1)=1, (1>0)==TRUE,...

Elephant and Bananas

Problem There are 2 cities A and B, 1000 Kms apart. We have 3000 bananas in city A and a elephant, which can carry max 1000 bananas at any given time. The elephant needs to eat a banana every 1 Km. How many maximum number of bananas can be transferred to city B? Note: The elephant cannot go without bananas. Generalized Question: There are 2 cities A and B, ‘D’ Km apart. We have ‘N’ bananas in city A and a elephant, which can carry max ‘C’ bananas at any given time. The elephant needs to eat ‘F’ banana every 1 Km. Write a program that will...

Friday, May 9, 2014

50 Trucks with Payload

Problem   Given a fleet of 50 trucks, each with a full fuel tank and a range of 100 miles, how far can you deliver a payload? You can transfer the payload from truck to truck, and you can transfer fuel from truck to truck. Assume all the payload will fit in one truck. Solution We want to use as little fuel as possible so we try minimize the number of trucks we use as we go along. Let’s say we start with all 50 trucks with full fuel (5000 miles range).For each mile, we lose 50 miles in range. After two miles, we lose 100 miles leaving...

Why does mirror lies sometimes?

Problem Imagine you are standing in front of a mirror, facing it. Raise your left hand. Raise your right hand. Look at your reflection. When you raise your left hand your reflection raises what appears to be his right hand. But when you tilt your head up, your reflection does too, and does not appear to tilt his/her head down. Why is it that the mirror appears to reverse left and right, but not up and down? Solution The definition of left and right depends on the observer and is reversed when facing the opposite direction. The definition of...

Wednesday, May 7, 2014

Average salary of n people in the room

Question: How can n people know the average of their salaries without disclosing their own salaries to each other? Solution: Let's say salaries of n people (P1, P2, P3.....Pn) are S1, S2, S3.....Sn respectively. To know the average of the salary i.e. (S1 + S2 + S3 + ..... + Sn) / n, they will follow the following steps - P1 adds a random amount, say R1 to his own salary and gives that to P2 (P2 won't be able to know P1's salary as he has added a random amount known to him only). In this case, P2 will receive the figure (S1 + R1) from...

Point inside a triangle or NOT

Problem Given three corner points of a triangle, and one more point P. Write a function to check whether P lies within the triangle or not. Example For example, consider the following program, the function should return true for P(10, 15) and false for P’(30, 15) B(10,30) / \ / \ / \ / P \ P' / \ A(0,0) ----------- C(20,0) Solution Method 1 - Area of triangles made by point and other 2 vertices of triangle Let the coordinates...