Marty and Jill want to copy three 60 minute tapes. They have two tape recorders that will dub the tapes for them, so they can do two at a time. It takes 30 minutes for each side to complete; therefore in one hour two tapes will be done, and in another hour the third will be done. Jill says all three tapes can be made in 90 minutes. How?
Jill will rotate the three tapes. Let's call them tapes 1,2, and 3 with sides A and B. In the first 30 minutes they will tape 1A and 2A, in the second 3 minutes they will tape 1B and 3A (Tape 1 is now done). Finally, in the last 30 minutes, they will tape 2B and 3B.
There are five vowels in English language (a, e, i, o, u, and sometimes y).
Easy version: Can you tell us a word contains of these 5 vowels?
Hard: Can you tell us a word contains of all these 6 vowels with y?
Very difficult: Can you tell us a word contains of all these vowels with y in their alphabetical order?
In their alphabetical order:
There is a small town in the midwest with exactly 2 barbershops, one on each side of town. The barbershop on the west side of town is pristine. Its floors are spotless, the windows are always perfectly clear, and the air always smells fresh. The barber has a friendly smile, shined shoes, a well-groomed head of hair, and a fancy shirt. The barbershop on the east side of town is a mess. Its floors and windows are dirty, and the air smells of garbage. The barber always has a grimace on his face. His skin is oily, his hair is short and ragged, and he has food on his clothes all the time.
A man travelling through the town realizes he needs a haircut. Knowing the stories of the two barbers, the man decides to go to the dirty barbershop on the east side of town.
Why does he do this?
Because there are only two barbers in the town, the barbers must cut each-other's hair. The barber on the west side of town has a nice haircut, so the east-side barber must be a good barber. On the other hand, the barber on the east side of town has ragged hair, meaning the west-side barber must not be very good. So the man goes to the east-side barber to get a better haircut.
There are n coins in a line. (Assume n is even). Two players take turns to take a coin from one of the ends of the line until there are no more coins left. The player with the larger amount of money wins.
Would you rather go first or second? Does it matter?
Assume that you go first, describe an algorithm to compute the maximum amount of money you can win.
Note that the strategy to pick maximum of two corners may not work. In the following example, first player looses the game when he/she uses strategy to pick maximum of two corners.
Example 18 20 15 30 10 14
First Player picks 18, now row of coins is
20 15 30 10 14
Second player picks 20, now row of coins is
15 30 10 14
First Player picks 15, now row of coins is
30 10 14
Second player picks 30, now row of coins is
First Player picks 14, now row of coins is
Second player picks 10, game over.
The total value collected by second player is more (20 + 30 + 10) compared to first player (18 + 15 + 14). So the second player wins.
Going first will guarantee that you will not lose. By following the strategy below, you will always win the game (or get a possible tie).
(1) Count the sum of all coins that are odd-numbered. (Call this X)
(2) Count the sum of all coins that are even-numbered. (Call this Y)
(3) If X > Y, take the left-most coin first. Choose all odd-numbered coins in subsequent moves.
(4) If X < Y, take the right-most coin first. Choose all even-numbered coins in subsequent moves.
(5) If X == Y, you will guarantee to get a tie if you stick with taking only even-numbered/odd-numbered coins.
You might be wondering how you can always choose odd-numbered/even-numbered coins. Let me illustrate this using an example where you have 6 coins:
18 20 15 30 10 14
Sum of odd coins = 18 + 15 + 10 = 43
Sum of even coins = 20 + 30 + 14 = 64.
Since the sum of even coins is more, the first player decides to collect all even coins. He first picks 14, now the other player can only pick a coin (10 or 18). Whichever is picked the other player, the first player again gets an opportunity to pick an even coin and block all even coins.
It was a grandeur party. In order to filter the uninvited guests, the security guard was assigned a task to check the secret password. The guests invited by the royal family also were shared with the secret password.
John wasn't an invited guest. He learned that the password is needed to make an entry. He hides himself and started watching the guests and the security.
The first guest comes. Security told him, TWELVE and the guest replied SIX. He wished him and allowed him to enter.
The second guest comes. Security told him SIX and the guest replied THREE! He was too allowed.
John made an entry as third guest. Security told him EIGHT and John replied FOUR. He was thrown out of the party!
The answer should be five. The password is not half of the digit, but the number that represents the number of digits told by security.
You are standing next to three switches. You know these switches belong to three bulbs in a room behind a closed door – the door is tight closed, and heavy which means that it's absolutely impossible to see if any bulb is on or not. All three switches are now in position off.
You can do whatever you want with the switches and when you are finished you open the door and go into the room. While in there you have to tell which switch belongs to which bulb.
How will you do that?
Turn on the first switch and wait for a while.
Turn off the first one and turn on the second.
Go into the room.
One bulb is shining, the second bulb is hot and the third one nothing.
A young peasant wanted to marry the king's daughter. The king didn't like the idea of his daughter marrying a peasant, but he wanted to appear fair in front of his subjects. The king said that he would put two pieces of paper into a hat, one reading "exile" and the other reading "marriage". Later that day, the peasant overheard the king saying that both pieces of paper would read "exile", thus ensuring that the peasant would be out of his way for good. The peasant remained undaunted and, as arranged, arrived at the king's court where a large crown gathered for the big event. The peasant then did something that assured him the hand of the king's daughter. What did he do?
The peasant picked one of the pieces of paper and tore it up. He then asked the kind to show him the other piece of paper which, of course, said EXILE. The king, not wishing to appear fraudulent in front of his subjects, granted that the piece of paper the peasant had picked must have said MARRIAGE.
In the land of Brainopia, there are three races of people: Mikkos, who tell the truth all the time, Kikkos, who always tell lies, and Zikkos, who tell alternate false and true statements, in which the order is not known (i.e. true, false, true or false, true, false). When interviewing three Brainopians, a foreigner received the following statements:
I am a Mikko.
I am a Kikko.
a. They are both lying.
b. I am a Zikko.
Can you help the very confused foreigner determine who is who, assuming each person represents a different race?
Person 1 is a Miko.
Person 2 is a Ziko.
Person 3 is a Kikko.
You've been placed on a course of expensive medication in which you are to take one tablet of Plusin and one tablet of Minusin daily. You must be careful that you take just one of each because taking more of either can have serious side effects. Taking Plusin without taking Minusin, or vice versa, can also be very serious, because they must be taken together in order to be effective. In summary, you must take exactly one of the Plusin pills and one of the Minusin pills at one time.
Therefore, you open up the Plusin bottle, and you tap one Plusin pill into your hand. You put that bottle aside and you open the Minusin bottle. You do the same, but by mistake, two Minusins fall into your hand with the Plusin pill.
Now, here's the problem. You weren't watching your hand as the pills fell into it, so you can't tell the Plusin pill apart from the two Minusin pills. The pills look identical. They are both the same size, same weight (10 micrograms), same color (Blue), same shape (perfect square), same everything, and they are not marked differently in any way.
What are you going to do?
You cannot tell which pill is which, and they cost $500 a piece, so you cannot afford to throw them away and start over again. How do you get your daily dose of exactly one Plusin and exactly one Minusin without wasting any of the pills?
Carefully cut each of the three pills in half, and carefully separate them into two piles, with half of each pill in each pile. You do not know which pill is which, but you are 100% sure that each of the two piles now contains two halves of Minusin and half of Plusin. Now go back into the Plusin bottle, take out a pill, cut it in half, and add one half to each stack. Now you have two stacks, each one containing two halves of Plusin and two halves of Minusin. Take one stack of pills today, and save the second stack for tomorrow.
Allan, Bertrand, and Cecil were caught stealing so the king sent them to the dungeon.
But the king decided to give them a chance.
He mad them stand in a line and put hats on their heads.
He told them that if they answer a riddle, they could go free.
Here is the riddle: "Each of you has a hat on your head. You do not know the color of the hat on your own head. If one of you can guess the color of the hat on your head, I will let you free. But before you answer you must keep standing in this line. You cannot turn around. Here are my only hints: there are only black and white hats. At least one hat is black. At least one hat is white."
Allan couldn't see any hats.
Bertrand could see Allan's hat but not his own.
Cecil could see Bertrand's hat and Allan's hat, but not his own.
After a minute nobody had solved the riddle. But then a short while later, one of them solved the riddle. Who was is and how did he know?
Bertrand knew the answer because Cecil didn't say anything after one minute. If Bertrand and Allan's hats were both the same color, then Cecil would know what color his hat was. But Cecil didn't know. So Bertrand knew that Allan's hat was a different color than his. Since Allan's hat was black, Betrand knew his hat was white.