cleanIn classic mythology, there is the story of the Sphinx, a monster with the body of a lion and the upper part of a woman. The Sphinx lay crouched on the top of a rock along the highroad to the city of Thebes, and stopped all travellers passing by, proposing to them a riddle. Those who failed to answer the riddle correctly were killed. This is the riddle the Sphinx asked the travellers: "What animal walks on four legs in the morning, two legs during the day, and three legs in the evening?"

This is part of the story of Oedipus, who replied to the Sphinx, "Man, who in childhood creeps on hands and knees, in manhood walks erect, and in old age with the aid of a staff." Morning, day and night are representative of the stages of life. The Sphinx was so mortified at the solving of her riddle that she cast herself down from the rock and perished.

cleanSomething very extraordinary happened on the 6th of May, 1978 at thirty-four minutes past twelve a.m. What was it?

At that moment, the time and day could be written as 12:34, 5/6/78.

logicThere are 4 big houses in my home town. They are made from these materials: red marbles, green marbles, white marbles and blue marbles.
Mrs Jennifer's house is somewhere to the left of the green marbles one and the third one along is white marbles.
Mrs Sharon owns a red marbles house and Mr Cruz does not live at either end, but lives somewhere to the right of the blue marbles house.
Mr Danny lives in the fourth house, while the first house is not made from red marbles.
Who lives where, and what is their house made from ?

From, left to right:
#1 Mrs Jennifer - blue marbles
#2 Mrs Sharon - red marbles
#3 Mr Cruz - white marbles
#4 Mr Danny - green marbles
If we separate and label the clues, and label the houses #1, #2, #3, #4 from left to right we can see that:
a. Mrs Jennifer's house is somewhere to the left of the green marbles one.
b. The third one along is white marbles.
c. Mrs Sharon owns a red marbles house
d. Mr Cruz does not live at either end.
e. Mr Cruz lives somewhere to the right of the blue marbles house.
f. Mr Danny lives in the fourth house
g. The first house is not made from red marbles.
By (g) #1 isn't made from red marbles, and by (b) nor is #3. By (f) Mr Danny lives in #4 therefore by (c) #2 must be red marbles, and Mrs Sharon lives there.
Therefore by (d) Mr Cruz must live in #3, which, by (b) is the white marbles house. By (a) #4 must be green marbles (otherwise Mrs Jennifer couldn't be to its left) and by (f) Mr Danny lives there.
Which leaves Mrs Jennifer, living in #1, the blue marbles house.

What word looks the same backwards and upside down?

SWIMS.

logicmathshortRamanujan discovered 1729 as a magic number. Why 1729 is a magic number ?

It can be expressed as the sum of the cubes of two different sets of numbers.
10^3 + 9^3 = 1729
and
12^3 + 1^3 = 1729

logicmathprobabilityYou have a basket of infinite size (meaning it can hold an infinite number of objects). You also have an infinite number of balls, each with a different number on it, starting at 1 and going up (1, 2, 3, etc...).
A genie suddenly appears and proposes a game that will take exactly one minute. The game is as follows: The genie will start timing 1 minute on his stopwatch. Where there is 1/2 a minute remaining in the game, he'll put balls 1, 2, and 3 into the basket. At the exact same moment, you will grab a ball out of the basket (which could be one of the balls he just put in, or any ball that is already in the basket) and throw it away.
Then when 3/4 of the minute has passed, he'll put in balls 4, 5, and 6, and again, you'll take a ball out and throw it away.
Similarly, at 7/8 of a minute, he'll put in balls 7, 8, and 9, and you'll take out and throw away one ball.
Similarly, at 15/16 of a minute, he'll put in balls 10, 11, and 12, and you'll take out and throw away one ball.
And so on....After the minute is up, the genie will have put in an infinite number of balls, and you'll have thrown away an infinite number of balls.
Assume that you pull out a ball at the exact same time the genie puts in 3 balls, and that the amount of time this takes is infinitesimally small.
You are allowed to choose each ball that you pull out as the game progresses (for example, you could choose to always pull out the ball that is divisible by 3, which would be 3, then 6, then 9, and so on...).
You play the game, and after the minute is up, you note that there are an infinite number of balls in the basket.
The next day you tell your friend about the game you played with the genie. "That's weird," your friend says. "I played the exact same game with the genie yesterday, except that at the end of my game there were 0 balls left in the basket."
How is it possible that you could end up with these two different results?

Your strategy for choosing which ball to throw away could have been one of many. One such strategy that would leave an infinite number of balls in the basket at the end of the game is to always choose the ball that is divisible by 3 (so 3, then 6, then 9, and so on...). Thus, at the end of the game, any ball of the format 3n+1 (i.e. 1, 4, 7, etc...), or of the format 3n+2 (i.e. 2, 5, 8, etc...) would still be in the basket. Since there will be an infinite number of such balls that the genie has put in, there will be an infinite number of balls in the basket.
Your friend could have had a number of strategies for leaving 0 balls in the basket. Any strategy that guarantees that every ball n will be removed after an infinite number of removals will result in 0 balls in the basket.
One such strategy is to always choose the lowest-numbered ball in the basket. So first 1, then 2, then 3, and so on. This will result in an empty basket at the game's end. To see this, assume that there is some ball in the basket at the end of the game. This ball must have some number n. But we know this ball was thrown out after the n-th round of throwing balls away, so it couldn't be in there. This contradiction shows that there couldn't be any balls left in the basket at the end of the game.
An interesting aside is that your friend could have also used the strategy of choosing a ball at random to throw away, and this would have resulted in an empty basket at the end of the game. This is because after an infinite number of balls being thrown away, the probability of any given ball being thrown away reaches 100% when they are chosen at random.

logicmathHow to measure exactly 4 gallon of water from 3 gallon and 5 gallon jars, given, you have unlimited water supply from a running tap.

Step 1. Fill 3 gallon jar with water. ( 5p – 0, 3p – 3)
Step 2. Pour all its water into 5 gallon jar. (5p – 3, 3p – 0)
Step 3. Fill 3 gallon jar again. ( 5p – 3, 3p – 3)
Step 4. Pour its water into 5 gallon jar untill it is full. Now you will have exactly 1 gallon water remaining in 3 gallon jar. (5p – 5, 3p – 1)
Step 5. Empty 5 gallon jar, pour 1 gallon water from 3 gallon jar into it. Now 5 gallon jar has exactly 1 gallon of water. (5p – 1, 3p – 0)
Step 6. Fill 3 gallon jar again and pour all its water into 5 gallon jar, thus 5 gallon jar will have exactly 4 gallon of water. (5p – 4, 3p – 0)
We are done !

logicmathprobabilityWhat is the least number of people that need to be in a room such that there is greater than a 50% chance that at least two of the people have the same birthday?

Only 23 people need to be in the room.
Our first observation in solving this problem is the following:
(the probability that at least 2 people have the same birthday + the probability that nobody has the same birthday) = 1.0
What this means is that there is a 100% chance that EITHER everybody in the room has a different birthday, OR at least two people in the room have the same birthday (and these probabilities don't add up to more than 1.0 because they cover mutually exclusive situations).
With some simple re-arranging of the formula, we get:
the probability that at least 2 people have the same birthday = (1.0 - the probability that nobody has the same birthday)
So now if we can find the probability that nobody in the room has the same birthday, we just subtract this value from 1.0 and we'll have our answer.
The probability that nobody in the room has the same birthday is fairly straightforward to calculate. We can think of this as a "selection without replacement" problem, where each person "selects" a birthday at random, and we then have to figure out the probability that no two people select the same birthday. The first selection has a 365/365 chance of being different than the other birthdays (since none have been selected yet). The next selection has a 364/365 chance of being different than the 1 birthday that has been selected so far. The next selection has a 363/365 chance of being different than the 2 birthdays that have been selected so far.
These probabilities are multiplied together since each is conditional on the previous. So for example, the probability that nobody in a room of 3 people have the same birthday is (365/365 * 364/365 * 363/365) =~ 0.9918
More generally, if there are n people in a room, then the probability that nobody has the same birthday is (365/365 * 364/365 * ... * (365-n+2)/365 * (365-n+1)/365)
We can plug in values for n. For n=22, we get that the probability that nobody has the same birthday is 0.524, and thus the probabilty that at least two people have the same birthday is (1.0 - 0.524) = 0.476 = 47.6%.
Then for n=23, we get that the probability that nobody has the same birthday is 0.493, and thus the probabilty that at least two people have the same birthday is 1.0 - 0.493) = 0.507 = 50.7%. Thus, once we get to 23 people we have reached the 50% threshold.

logicIn a small town in the United States, a teenage boy asked his parents if he could go to a friend's party. His parents agreed, provided that he was back before sunrise. He left the house that evening clean-shaven and when he returned just before the following sunrise his parents were amazed to see that he had a fully grown beard. What happened?

The small town was Barrow in Alaska, the northernmost town in the United States. When the sun sets there in the middle of November, it does not rise again for 65 days. That allowed plenty of time for the boy to grow a beard before the next sunrise.

logicmathThe owner of a banana plantation has a camel. He wants to transport his 3000 bananas to the market, which is located after the desert. The distance between his banana plantation and the market is about 1000 kilometer. So he decided to take his camel to carry the bananas. The camel can carry at the maximum of 1000 bananas at a time, and it eats one banana for every kilometer it travels.
What is the most bananas you can bring over to your destination?

First of all, the brute-force approach does not work. If the Camel starts by picking up the 1000 bananas and try to reach point B, then he will eat up all the 1000 bananas on the way and there will be no bananas left for him to return to point A.
So we have to take an approach that the Camel drops the bananas in between and then returns to point A to pick up bananas again.
Since there are 3000 bananas and the Camel can only carry 1000 bananas, he will have to make 3 trips to carry them all to any point in between.
When bananas are reduced to 2000 then the Camel can shift them to another point in 2 trips and when the number of bananas left are <= 1000, then he should not return and only move forward.
In the first part, P1, to shift the bananas by 1Km, the Camel will have to
Move forward with 1000 bananas – Will eat up 1 banana in the way forward
Leave 998 banana after 1 km and return with 1 banana – will eat up 1 banana in the way back
Pick up the next 1000 bananas and move forward – Will eat up 1 banana in the way forward
Leave 998 banana after 1 km and return with 1 banana – will eat up 1 banana in the way back
Will carry the last 1000 bananas from point a and move forward – will eat up 1 banana
Note: After point 5 the Camel does not need to return to point A again.
So to shift 3000 bananas by 1km, the Camel will eat up 5 bananas.
After moving to 200 km the Camel would have eaten up 1000 bananas and is now left with 2000 bananas.
Now in the Part P2, the Camel needs to do the following to shift the Bananas by 1km.
Move forward with 1000 bananas – Will eat up 1 banana in the way forward
Leave 998 banana after 1 km and return with 1 banana – will eat up this 1 banana in the way back
Pick up the next 1000 bananas and move forward – Will eat up 1 banana in the way forward
Note: After point 3 the Camel does not need to return to the starting point of P2.
So to shift 2000 bananas by 1km, the Camel will eat up 3 bananas.
After moving to 333 km the camel would have eaten up 1000 bananas and is now left with the last 1000 bananas.
The Camel will actually be able to cover 333.33 km, I have ignored the decimal part because it will not make a difference in this example.
Hence the length of part P2 is 333 Km.
Now, for the last part, P3, the Camel only has to move forward. He has already covered 533 (200+333) out of 1000 km in Parts P1 & P2. Now he has to cover only 467 km and he has 1000 bananas.
He will eat up 467 bananas on the way forward, and at point B the Camel will be left with only 533 Bananas.