Thursday, February 16, 2012
Ant's travel in a grid
Friday, December 30, 2011
Gold bar with 7 segments
Wednesday, December 28, 2011
Pick a Random Byte
Three Switches
Answer: Stumped? The issue lies in the fact that there are only two possible positions for each switch (on or off), but three bulbs to identify. Identifying one bulb is super easy, just set one switch on and then go into the room to check which one is on. But then, how do we detect the other two?
So let’s think deeper, what are the other properties of a light bulb operated by a switch? Light bulbs definitely produce light, but they also produce heat (a not so very important characteristic!). Any chance we can use this idea to help solve our problem? Since a light bulb would take sometime to lose its heat after being switched off, you could still determine if it had ever been on by touching it.
So now, we can easily determine which bulb is operated by which switch. First, we turn the first switch on and leave the other two off. After 5 minutes, we turn the first switch off, turn the second switch on and leave the third switch off. Then we go into the room and touch one of the bulbs which is turned off. After that, it would be easy to tell that the first switch matches the warm bulb, the second switch matches the bulb thats turned on and the third switch matches the colder bulb.
Monday, December 19, 2011
Flipping Coins on the table
There are twenty coins sitting on the table, ten are currently heads and tens are currently tails. You are sitting at the table with a blindfold and gloves on. You are able to feel where the coins are, but are unable to see or feel if they heads or tails. You must create two sets of coins. Each set must have the same number of heads and tails as the other group. You can only move or flip the coins, you are unable to determine their current state. How do you create two even groups of coins with the same number of heads and tails in each group?
Answer: Create two sets of ten coins. Flip The coins in one of the sets over, and leave the coins in the other set alone. The first set of ten coins will have the same number of heads and tails as the other set of ten coins.
Sunday, December 18, 2011
Reaching the door of Heaven
A person dies, and he arrives at the gate to heaven. There are three doors in the heaven. one of them leads to heaven. another one leads to a 1-day stay at hell, and then back to the gate, and the other leads to a 2-day stay at hell, and then back to the gate. every time the person is back at the gate, the three doors are reshuffled. How long will it take the person to reach heaven?
this is a probability question - i.e. it is solvable and has nothing to do with religion, being sneaky, or how au dente the pasta might be ;-)
Answer:
1/3 of the time, the door to heaven will be chosen, so 1/3 of the time it will take zero days. 1/3 of the time, the 1-day door is chosen; of those, the right door will be chosen the next day, so 1/9 trips take 1 day. Similarly, 1/9 will take two days (choosing the 2-day door, then the right door).
After that, the cases split again, and again, and again. I can’t seem to make a nice infinite sum this way, so let’s try again.
Suppose the average days spent is X. 1/3 of the cases are done in zero days as before. 1/3 of the cases are 1 day plus X. 1/3 are 2 + X. So:
X = 1/3 * 0 + 1/3 * (1 + X) + 1/3 * (2 + X)
= 0 + 1/3 + X/3 + 2/3 + X/3
= 1 + 2X/3
Therefore,
X/3 = 1
X = 3
On average, it takes three days to get to heaven. Two if the noodles are limp.
Took me one blind alley, and about five minutes.
Can you properly the hotel charges?
Three people check into a hotel. They pay $30 to the manager, and go to their room. The manager finds out that the room rate is $25 and gives $5 to the bellboy to return. On the way to the room the bellboy reasons that $5 would be difficult to share among three people so he pockets $2 and gives $1 to each person. Now each person paid $10 and got back $1. So they paid $9 each, totaling $27. The bellboy has $2, totaling $29. Where is the remaining dollar ?
Solution: True its just a slip of tongue. 3 rooms money paid = $27 = Manager $25 + bellboy $2. Plus $1 to each of them.
Passengers and Random Seats
100 passengers are boarding an airplane with 100 seats.
Everyone has a ticket with his seat number. These 100 passengers boards the airplane in order.
However, the first passenger lost his ticket so he just took a random seat.
For any subsequent passenger, he either sits on his own seat or, if the seat is taken, he takes a random empty seat.
What's the probability that the last passenger would sit on his own seat ?
Solution:
Let us say that everyone is sitting except for the 100th passenger. Consider where can he sit - he can sit in either seat numbered 100 or 1. There cannot be any other seat vacant for him.
We can prove this using contradiction. Lets say that a seat numbered n=55 is vacant for 100th passenger. Since passenger 55 came earlier he should be sitting in his seat if its vacant. So seat 55 cant be vacant. This logic can be applied to all seats except for seat 1 and 100.
So all permutations of the seating arrangement would result in last person sitting in either seat 1 or seat 100. Both the options are equally likely.
So answer = 1/2.
Saturday, December 17, 2011
Fint out the matching socks
Michael have ten pairs of black socks, eight pairs of white socks and seven pairs of green socks. Everything is mixed in a draw. As there is no light he were not able to identify the color of the socks. How many of the socks did he want to take to match one pair ?
Solution:
The answer is 4 since in worst case all 3 socks taken first will be different color then the 4th one would be repetition. However if we consider a left sock to be different from right one, then at least 10 + 8 + 7 + 1 = 26 socks are needed.
How many races required?
Solution:
For 1st question:
Group 25 horses in 5 groups:
3. B3, B4, B5 can not be included in the solution as they are slower than B1 and B2.
Saturday, October 8, 2011
Four People on a Rickety Bridge
Answer: The initial solution most people will think of is to use the fastest person as an usher to guide everyone across. How long would that take? 10 + 1 + 7 + 1 + 2 = 21 mins. Is that it? No. That would make this question too simple even as a warm up question.
Let’s brainstorm a little further. To reduce the amount of time, we should find a way for 10 and 7 to go together. If they cross together, then we need one of them to come back to get the others. That would not be ideal. How do we get around that? Maybe we can have 1 waiting on the other side to bring the torch back. Ahaa, we are getting closer. The fastest way to get 1 across and be back is to use 2 to usher 1 across. So let’s put all this together.
1 and 2 go cross
2 comes back
7 and 10 go across
1 comes back
1 and 2 go across (done)
Total time = 2 + 2 + 10 + 1 + 2 = 17 mins
4 Quarts of Water
Answer: This question is very simple actually. Since we can’t hold 4 quarts in the 3 quart pail, we have to look to filling up the 5 quart pail with exactly 4 quarts. Lets count the steps as we move along
Answer: This question is very simple actually. Since we can’t hold 4 quarts in the 3 quart pail, we have to look to filling up the 5 quart pail with exactly 4 quarts. Lets count the steps as we move along
1. Fill 3 quart pail ( 5p – 0, 3p – 3)
2. Transfer to 5 quart pail (5p – 3, 3p – 0)
3. Fill 3 quart pail ( 5p – 3, 3p – 3)
4. Transfer to 5 quart pail (5p – 5, 3p – 1)
5. Empty 5 quart pail (5p – 0, 3p – 1)
6. Transfer to 5 quart pail (5p – 1, 3p – 0)
7. Fill 3 quart pail ( 5p – 1, 3p – 3)
8. Transfer to 5 quart pail (5p – 4, 3p – 0) We are done!!!
Globe Walker
How many points are there on the globe where, by walking one mile south, then one mile east and then one mile north, you would reach the place where you started?
Answer: The trivial answer to this question is one point, namely, the North Pole. But if you think that answer should suffice, you might want to think again!
Let’s think this through methodically. If we consider the southern hemisphere, there is a ring near the South Pole that has a circumference of one mile. So what if we were standing at any point one mile north of this ring? If we walked one mile south, we would be on the ring. Then one mile east would bring us back to same point on the ring (since it’s circumference is one mile). One mile north from that point would bring us back to the point were we started from. If we count, there would be an infinite number of points north of this one mile ring.
So what’s our running total of possible points? We have 1 + infinite points. But we’re not done yet!
Consider a ring that is half a mile in circumference near the South Pole. Walking a mile along this ring would cause us to circle twice, but still bring us to back to the point we started from. As a result, starting from a point that is one mile north of a half mile ring would also be valid. Similarly, for any positive integer n, there is a circle with radius
So the real answer to this question is 1 + infinity * infinity = infinite possible points!
Monday, December 7, 2009
Brain teasers and answers
- By moving one of the following digits, make the equation correct. 62 - 63 = 126 - 63 = 1 (In other words, 2x2x2x2x2x2, which equals 64)
- You have a fox, a chicken and a sack of grain. You must cross a river with only one of them at a time. If you leave the fox with the chicken he will eat it; if you leave the chicken with the grain he will eat it. How can you get all three across safely?
Take the chicken over first. Go back and bring the grain next, but instead of leaving the chicken with the grain, come back with the chicken. Leave the chicken on the first side and take the fox with you. Leave it on the other side with the grain. Finally, go back over and get the chicken and bring it over. - You have 12 black socks and 12 white socks mixed up in a drawer. It's early in the morning and you don't have any light to see the colors. How many socks must you pull out (blindly) to be sure of getting a matching pair?
3 socks. If the first sock is black, the second one could be black, in which case you have a matching pair. If the second sock is white, the third sock will be either black and match the first sock, or white and match the second sock. - What is special about the following sequence of numbers?
8 5 4 9 1 7 6 10 3 2 0
The numbers are in alphabetical order.
(eight, five, four, nine, one, seven, six, ten, three, two, zero) - Three travelers register at a hotel and are told that their rooms will cost $10 each so they pay $30. Later the clerk realizes that he made a mistake and should have only charged them $25. He gives a bellboy $5 to return to them but the bellboy is dishonest and gives them each only $1, keeping $2 for himself. So the men actually spent $27 and the bellboy kept $2 - what happened to the other dollar of the original $30?
Nothing. The 3 travelers paid a total of $27, making $25 for the hotel and $2 for the clerk. There is no missing $1. - You are the bus driver. At your first stop, you pick up 29 people. On your second stop, 18 of those 29 people get off, and at the same time 10 new passengers arrive. At your next stop, 3 of those 10 passengers get off, and 13 new passengers come on. On your fourth stop 4 of the remaining 10 passengers get off, 6 of those new 13 passengers get off as well, then 17 new passengers get on. What is the color of the bus driver's eyes?
The eye color of the reader of this problem. The first sentence is the key: "You are the bus driver" - A rooster lays an egg at the very top of a slanted roof. Which side is the egg going to roll off on?
Neither, roosters don't lay eggs. - U2 has a concert that starts in 17 minutes and they must all cross a bridge to get there. All four men begin on the same side of the bridge. You must help them across to the other side. It is night. There is one flashlight. A maximum of two people can cross at one time. Any party who crosses, either 1 or 2 people, must have the flashlight with them.
The flashlight must be walked back and forth. It cannot be thrown and other tricks like that are not needed to solve the problem. The solution is simply a matter of allocating resources in a certain order. Each band member walks at a different speed. A pair must walk together at the rate of the slower man's pace:
Bono: 1 minute to cross
Edge: 2 minutes to cross
Adam: 5 minutes to cross
Larry: 10 minutes to cross
For example: if Bono and Larry walk across first, 10 minutes have elapsed when they get to the other side of the bridge. If Larry then returns with the flashlight, a total of 20 minutes have passed and you have failed the mission.
Let’s name the as A,B,C & D and let’s assume that they take 1,2,5 and 10 minutes respectively. Here is how they should cross the bridge.
ABCD |—————————–-------|
CD |——-AB(2min)————->| ( AB comes and A returns)
ACD |<——-A-(1min)————--|B
A || ——-CD(10min)———>| BCD (CD come and B returns)
A || |<——-B-(2min)————--|
AB |—————————–-------|ABCD (AB come)
If you count all the trips ie. 2+1+10+2+2, it will be 17 minutes
- Why is it very common to have a 9 minute snooze interval on alarm clocks, why not 10 instead?
By setting the snooze time to 9 minutes, the alarm clock only needs to watch the last digit of the time. So, if you hit snooze at 6.45, the alarm goes off again when the last digit equals 4. They couldn't make it 10 minutes, otherwise the alarm would go off right away, or it would take more circuitry. - A bookworm eats from the first page of an encyclopedia to the last page. The bookworm eats in a straight line. The encyclopedia consists of ten 1000-page volumes and is sitting on a bookshelf in the usual order. Not counting covers, title pages, etc., how many pages does the bookworm eat through?
On a book shelf the first page of the first volume is on the "inside"__ __
so the bookworm eats only through the cover of the first volume, then 8 times 1000 pages of Volumes 2 - 9, then through the cover to the 1st page of Vol 10. He eats 8,000 pages.
B| | | |F
A|1 |...........................|10|R
C| | | |O
K| | | |N
| | | |T
----------------------------------
- An Arab sheikh tells his two sons to race their camels to a distant city to see who will inherit his fortune. The one whose camel is slower will win. The brothers, after wandering aimlessly for days, ask a wise man for advise. After hearing the advice they jump on the camels and race as fast as they can to the city. What does the wise man say?
Solution » - An 18-wheeler is crossing a 4 kilometer bridge that can only support 10,000 kilograms and that's exactly how much the rig weighs. Halfway across the bridge a 30 gram sparrow lands on the cab, but the bridge doesn't collapse. Why not?
Solution » - A completely black dog was strolling down Main Street during a total blackout affecting the entire town. Not a single streetlight had been on for hours. Just as the dog was crossing the middle line a Buick Skylark with 2 broken headlights speedily approaches his position, but manages to swerve out of the way just in time. How could the driver have possibly seen the dog to swerve in time?
Solution » - In a small cabin in the woods, two men lay dead. The cabin itself is not burned, but the forest all around is burned to cinders. How did the men die?
Solution » - Ida puts her coffee into the microwave, as she does every morning, for exactly 2 minutes. When the microwave goes off, she opens the door, but then closes the door again and sets the microwave for 2 more seconds. What good would 2 more seconds be?
Solution » - Beulah died in the Appalachians while Craig died at sea. Everyone was much happier with Craig's death. Why?
Solution » - You are a cook in a remote area with no clocks or other way of keeping time other than a four minute sandglass timer and a seven minute sandglass timer. (The kind you turn over - hourglass shaped) You do have a stove, however, with water in a pot already boiling. Somebody asks you for a nine-minute egg, and you know this person is a perfectionist and will be able to tell if you undercook or overcook the eggs by even a few seconds. What is the least amount of time it will take to prepare the egg? And how will you prepare it so that it is neither undercooked or overcooked?
Solution » - I am the owner of a pet store. If I put in one canary per cage, I have one bird too many. If I put in two canaries per cage, I have one cage too many. How many cages and canaries do I have?
Solution » - Here is a series of numbers. What is the next number in the sequence?
1
11
21
1211
111221
312211
13112221
Solution » - My daughter has many sisters. She has as many sisters as she has brothers. Each of her brothers has twice as many sisters as brothers. How many sons and daughters do I have?
Solution » - What seven-letter word has hundreds of letters in it?
Solution » - If you had a ton of feathers and a ton of stones which would be heavier?
Solution » - Tom's mother has three children. One is named April, one is named May. What is the third one named?
Solution » - Two women apply for a job. They are identical. They have the same mother, father and birthday. The interviewer asks, "Are you twins?" to which they honestly reply, "No".
How is this possible?
Solution » - You are standing outside a closed door. On the other side of the door is a room that has three light bulbs in it. The room is completely sealed off from the outside. It has no windows and nothing can get in or out except through the door. On the outside of the room there are three light switches that control each of the respective light bulbs on the other side of the door.
Your assignment is to determine which light switch controls which light bulb. You are allowed to enter the room only once, and once you come out, you must be able to state with 100% certainty which light switch controls which light bulb.
Solution » - If a bottle and a cork cost a dollar and a nickel, and the bottle costs a dollar more than the cork, how much does the cork cost?
Solution » - A boat has a ladder that has six rungs. Each rung is one foot apart. The bottom rung is one foot from the water. The tide rises at 12 inches every 15 minutes. High tide peaks in one hour.
When the tide is at its highest, how many rungs are under water?
Solution » - You have a lighter and two fuses that take exactly one hour to burn, but they don't burn at a steady rate. For example, one fuse could take 59 minutes to burn the first inch and then burn the rest of the fuse in the last minute.
How would you use these two fuses to measure 45 minutes?
Solution » - You have two buckets - one holds exactly 5 gallons and the other 3 gallons. How can you measure 4 gallons of water into the 5 gallon bucket?
(Assume you have an unlimited supply of water and that there are no measurement markings of any kind on the buckets.)
Solution » - A princess is as old as the prince will be when the princess is twice the age that the prince was when the princess's age was half the sum of their present ages.
What are their ages?
Solution » - During WWII, there was a bridge connecting Germany and Switzerland, and on the German side, there was a sentry tower with a guard in it. He would come out every three minutes to check on the bridge, and he had orders to turn back anyone who tried to get into Germany, and shoot anyone trying to escape without a pass. There was a woman who desperately needed to get into Switzerland, and she knew she didn't have time to get a pass. It would take her at least six minutes to cross the bridge, but she managed to do it. How?
Solution » - A man can make perfect counterfeit bills. They look exactly like real ones, they're made of exactly the same materials, made the same way, everything. So perfect, one could pretty much call them real bills. One day he successfully makes a perfect copy of another bill. However, he gets caught when he tries to use the copy. How is this possible?
Solution » - A prisoner is told "If you tell a lie we will hang you; if you tell the truth we will shoot you." What can he say to save himself?
Solution » - How many people can read hex if only you and dead people can read hex?
Solution » - A man is traveling with a fox and two chickens, if he leaves the fox alone with the chickens the fox will eat the chickens. He comes to a river and needs to cross it, he finds a small boat that can carry only him and one animal, how does he get himself, the fox and two chickens across the river safely?
Solution » - A man is looking at a picture of a man on the wall and states: Brothers and sisters I have none, but this man's father is my father's son. Who is the man in the picture in relation to the man looking at the picture?
Solution » - A man and his son had a terrible car accident and were rushed to the hospital. The man died on the way, but the son was still alive and a surgeon was called in to operate. However, the surgeon saw the young boy and said, "I can't operate on this boy. He's my son."
How is this possible?
Solution » - A wise king devised a contest to see who would receive the Princess' hand in marriage. The Princess was put in a 50x50 foot carpeted room. Each of her four suitors were put in one corner of the room with a small box to stand on. The first one to touch the Princess hand would be the winner and become the new King.
The rules of the test were that the contestants could not walk over the carpet, cross the plane of the carpet, or hang from anything; nor could they use anything but their body and wits (i.e. no magic or telepathy, nor any items such as ladders, block and tackles etc). One suitor figured out a way and married the Princess and became the new King. What did he do?
Solution » - Two guards were on duty outside a barracks. One faced up the road to watch for anyone approaching from the North. The other looked down the road to see if anyone approached from the South. Suddenly one of them said to the other, "Why are you smiling?"
How did he know his companion was smiling?
Solution » - You're riding a horse. To the right of you is a cliff and in front of you is an elephant going the same pace as you and you can't overtake it. To the left of you is a hippo running at the same speed and behind you is a lion chasing you. How do you get to safety?
Solution » - You have 50 quarters on the table in front of you. You are blindfolded and cannot discern whether a coin is heads up or tails up by feeling it. You are told that x coins are heads up, where 0 < x < 50. You are asked to separate the coins into two piles in such a way that the number of heads up coins in both piles is the same at the end. You may flip any coin over as many times as you want. How will you do it?
Solution » - You have four chains. Each chain has three links in it. Although it is difficult to cut the links, you wish to make a single loop with all 12 links. What is the fewest number of cuts you must make to accomplish this task?
Solution » - Walking down the street one day, I met a woman strolling with her daughter. "What a lovely child," I remarked. "In fact, I have two children," she replied. What is the probability that both of her children are girls?
Solution » - Three closed boxes have either white marbles, black marbles or both, and they are labeled white, black and both. However, you're told that each of the labels are wrong. You may reach into one of the boxes and pull out only one marble. Which box should you remove a marble from to determine the contents of all three boxes?
Solution » - A glass of water with a single ice cube sits on a table. When the ice has completely melted, will the level of the water have increased, decreased or remain unchanged?
Solution » - You are given eight coins and told that one of them is counterfeit. The counterfeit one is slightly heavier than the other seven. Otherwise, the coins look identical. Using a simple balance scale, can you determine which coin is counterfeit using the scale only once?
Solution » - You are given eight coins and told that one of them is counterfeit. The counterfeit one is slightly heavier than the other seven. Otherwise, the coins look identical. Using a simple balance scale, can you determine which coin is counterfeit using the scale only twice?
Solution » - I was visiting a friend one evening and remembered that he had three daughters. I asked him how old they were. "The product of their ages is 72," he answered. Quizzically, I asked, "Is there anything else you can tell me?" "Yes," he replied, "the sum of their ages is equal to the number of my house." I stepped outside to see what the house number was. Upon returning inside, I said to my host, "I'm sorry, but I still can't figure out their ages." He responded apologetically, "I'm sorry, I forgot to mention that my oldest daughter likes strawberry shortcake." With this information, I was able to determine all of their ages. How old is each daughter? You have enough information to solve the puzzle.
Solution » - You're in a room with two doors. There's a guard at each door. One door is the exit, but behind the other door is something that will kill you. You're told that one guard always tells the truth and the other guard always lies. You don't know which guard is which. You are allowed to ask one question to either of the guards to determine which door is the exit. What question should you ask?
Solution » - How far can a dog run into the forest?
Solution » - If eggs are 12¢ a dozen, how much would it cost for 100 eggs?
Solution » - You are a prisoner sentenced to death. The Emperor offers you a chance to live by playing a simple game. He gives you 50 black marbles, 50 white marbles and 2 empty bowls. He then says, "Divide these 100 marbles into these 2 bowls. You can divide them any way you like as long as you use all the marbles. Then I will blindfold you and mix the bowls and marbles up. You can then choose one bowl and remove one marble. If the marble is white, you live, but if the marble is black...you die.
How do you divide the marbles up so that you have the greatest probability of choosing a white marble?
Solution » - What is the next number in this series?
1, 2, 6, 42, 1806, ?
Solution » - What do the following numerals specify?
11111121113122223222
Solution » - You must buy 100 chickens for exactly $100. You must buy at least one chicken from each store. The first store charges 5 cents/chicken, the second charges $1/chicken and the third charges $5/chicken. How many chickens should you buy from each store?
Solution » - What is special about the following number sequence?
8, 5, 4, 9, 1, 7, 6, 10, 3, 2, 0
Solution »