Tuesday, June 17, 2014

Given n coupons, how many coupons do you expect you need to draw with replacement before having drawn each coupon at least once ?

Alternatively Suppose that there is an set of n different coupons, from which coupons are being collected, equally likely, with replacement. What is the probability that more than t sample trials are needed to collect all n coupons ? 

Thursday, November 14, 2013

5 pirates of different ages have a treasure of 100 gold coins puzzle

5 pirates of different ages have a treasure of 100 gold coins. 

On their ship, they decide to split the coins using this scheme: 

The oldest pirate proposes how to share the coins, and ALL pirates (including the oldest) vote for or against it. 

If 50% or more of the pirates vote for it, then the coins will be shared that way. Otherwise, the pirate proposing the scheme will be thrown overboard, and the process is repeated with the pirates that remain.

As pirates tend to be a bloodthirsty bunch, if a pirate would get the same number of coins if he voted for or against a proposal, he will vote against so that the pirate who proposed the plan will be thrown overboard.

Assuming that all 5 pirates are intelligent, rational, greedy, and do not wish to die, (and are rather good at math for pirates) what will happen?

Tuesday, November 12, 2013

2 Boys and train puzzles

Suppose 2 boys are walking in the woods and they decide to take a shortcut through a railroad tunnel. They had walked 2/3 of the way through the tunnel, but then something horrible happened: a train was coming in the opposite direction towards the 2 boys, and it was coming close to the other entrance of the tunnel. Each boy ran in a different direction to get out of the tunnel and avoid the incoming train. Each boy ran at the same exact speed of 10 miles per hour, and each boy managed to escape the train at the exact instant in which the train would have hit and killed him. If the train was moving at a constant speed and each boy was capable of instantaneous acceleration, then how fast was the train going?

Wednesday, October 16, 2013

Determine winner of 2/9 number game

Two players play the following game: they pick a random number N (less than 2 billion) then, 
starting from 1, take turns multiplying the number from the previous turn with either 2 or 9 (their choice). Whoever reaches N first wins. 
The candidate should write a function that given N decides who wins (first or second player)?

Friday, July 26, 2013

What strategy should be used to kill the fewest dwarfs, and what is the minimum number of dwarfs that can be saved with this strategy?

A dwarf-killing giant lines up 10 dwarfs from shortest to tallest. Each dwarf can see all the shortest dwarfs in front of him, but cannot see the dwarfs behind himself. The giant randomly puts a white or black hat on each dwarf. No dwarf can see their own hat. The giant tells all the dwarfs that he will ask each dwarf, starting with the tallest, for the color of his hat. If the dwarf answers incorrectly, the giant will kill the dwarf. Each dwarf can hear the previous answers, but cannot hear when a dwarf is killed. What strategy should be used to kill the fewest dwarfs, and what is the minimum number of dwarfs that can be saved with this strategy?

Source: http://www.businessinsider.com/toughest-job-interview-questions-2013-7?op=1#ixzz2a9upxPNJ

Tuesday, March 19, 2013

How many passes does it take to fill in slots so that max number of people are happy


 There are 5 slots(1,2,3,4,5) and 5 people(A,B,C,D,E). Each of them provide their preferences. A=1, B=2, C=3, D=4, C=4. Given an arbitary starting sequence say BCDEA, going clock wise: how many passes does it take to fill in those slots so that max number of people are happy. People are happy if A gets 1, B gets 2, C gets 3, etc. Remember D and E cannot be kept happy together at the same time because both of them prefer Slot-4.
So Question is : Can you do better than N passes?

Suppose you reach your home and noticed that the light bulb in your corridor is not working. What will you do in such a situation?


Saturday, November 3, 2012

If 1.5 dogs eat 1.5 pounds of meat in 1.5 days, how much will 16 dogs eat in 4 days?

1.5 dogs eat 1.5 pounds of meat in 1.5 days this means that 1.5 dogs eat 1 pound of meat/day
or to get rid of the decimal, 3 dogs eat 2 pounds of meat/day so 16 dogs would eat 32/3 pounds of meat/day
because 2*16/3=32/3 so in 4 days they will have eaten 128/3 pounds of meat because 4*32/3=128/3

the answer is therefore 128/3 pounds of meat which can written as 42 2/3 .

we love comment so lets us know if any thing wrong or other way to approach the same :)

Sunday, September 30, 2012

How will you represent (3AC)14 in base 7 numeral system.


It can be done using this formula!
If a no X is represented in base 14 as
X = an a(n-1) a(n-2) .... a(0)
then in base 7 we can write it as
X=.....rqp
where
p=(2^0)a(0)%7;
q=((2^1)a(1) + p/7)%7
r=((2^2)a(2) + q/7)%7
..........
nth term=((2^n)a(n) + (n-1)th term/7)%7
(will go further because a no. in base 14 will require more digits in base 7).
The logic is simple, just based on properties of bases, and taking into account the fact that 7 is half of 14. Else it would have been a tedious task.
Eg. here it is given 3AC.
C =12;
so last digit is (2^0 * 12)%7 = 5
A=10
next digit is (2^1 * 10 + 12/7)%7 = (20+1)%7=21%7=0
next is 3;
next digit is (2^2 * 3 + 21/7)%7 = (12+3)%7=15%7=1
next is nothing(0);
next digit is (2^3 * 0 + 15/7)%7 = (0+2)%7=2%7=2
Hence, in base 7 number will be, 2105.

Now try how you can perform any base to any other base conversion ?

You are given n dice. Each die has m sides i.e has values from 1 to m. Given m,n,x calculate the probability that the sum of all the dice is greater than or equal to x.

Example  n=4 m=2 x=8 ans: 1/16=0.0625  n=2 m=6 x=3 ans:35/36=0.972

Monday, September 24, 2012

You are given two hourglasses. One measures 4 minutes and one measures 7 minutes. How would you measure exactly 9 minutes?


StepTime4 minute timer7 minute timer
10 minStartStart
24 minsFlip3 minutes left
37 mins1 minute leftFlip
48 minsStopFlip (1 minute left)
59 mins
Stop

Tuesday, August 21, 2012

You have 50 red marbles and 50 blue marbles. Your have two jars. If I am to choose a jar at random, what ratios of marbles would you put in each jar to increase the probability of me choosing a red marble?


Determine which jar has the heavier marbles in the least amount of weighings

You have 10 jars .Each jar has 100 marbles
9 of the 10 jars -> each marble weighs 1 gram each
last jar -> each marble weights 1.1 grams each
electronic weight scale
    - place what you want to weight on it
    - hit a button
    - get the total weight

find the defective jar ?

Answer:Take 1 marble from jar 1, 2 from jar 2, 3 from jar 3 and so on...so u have 55 marbles in all
Weigh them all together...if total weight is 55.1....then jar 1 is the one with obese marbles...if 55.2..then jar 2...and so on...  again 55.3 can't be the combination of jar 1 and 2 as (.1 +.2 ) since defective jar is only one.

Wednesday, February 22, 2012

Three Doors, 1 Prize Puzzle , One of Toughest Puzzle on Probabality


You are on a gameshow and the host shows you three doors. Behind one door is a suitcase with $1 million in it, and behind the other two doors are sacks of coal. The host tells you to choose a door, and that the prize behind that door will be yours to keep.
You point to one of the three doors. The host says, "Before we open the door you pointed to, I am going to open one of the other doors." He points to one of the other doors, and it swings open, revealing a sack of coal behind it.
"Now I will give you a choice," the host tells you. "You can either stick with the door you originally chose, or you can choose to switch to the other unopened door."
Should you switch doors, stick with your original choice, or does it not matter?


Monday, February 20, 2012

Einstein's Riddle




ALBERT EINSTEIN'S RIDDLE ARE YOU IN THE TOP 2% OF INTELLIGENT PEOPLE IN THE WORLD? SOLVE THE RIDDLE AND FIND OUT.


There are no tricks, just pure logic, so good luck and don't give up.

1. In a street there are five houses, painted five different colors.

2. In each house lives a person of different nationality

3. These five homeowners each drink a different kind of beverage, smoke different brand of cigar and keep a different pet.  

THE QUESTION: WHO OWNS THE FISH?

HINTS

   1. The British man lives in a red house.
   2. The Swedish man keeps dogs as pets.
   3. The Danish man drinks tea.
   4. The Green house is next to, and on the left of the White house.
   5. The owner of the Green house drinks coffee.
   6. The person who smokes Pall Mall rears birds.
   7. The owner of the Yellow house smokes Dunhill.
   8. The man living in the center house drinks milk.
   9. The Norwegian lives in the first house.
   10. The man who smokes Blends lives next to the one who keeps cats.
   11. The man who keeps horses lives next to the man who smokes Dunhill.
   12. The man who smokes Blue Master drinks beer.
   13. The German smokes Prince.
   14. The Norwegian lives next to the blue house.
   15. The Blends smoker lives next to the one who drinks water.

ALBERT EINSTEIN WROTE THIS RIDDLE EARLY DURING THE 19th CENTURY. HE SAID THAT 98% OF THE WORLD POPULATION WOULD NOT BE ABLE TO SOLVE IT.  

Feel free to comment your answers and share to your friends.

Thursday, February 9, 2012

Manager and Engineer Puzzle

The FBI has surrounded the headquarters of the Norne corporation. There are n people in the building. Each person is either an engineer or a manager. All computer files have been deleted, and all documents have been shredded by the managers. The problem confronting the FBI interrogation team is to separate the people into these two classes, so that all the managers can be locked up and all the engineers can be freed. Each of the n people knows the status of all the others. The interrogation consists entirely of asking person i if person j is an engineer or a manager. The engineers always tell the truth. What makes it hard is that the managers may not tell the truth. In fact, the managers are evil geniuses who are conspiring to confuse the interrogators.
  1. Under the assumption that more than half of the people are engineers, can you find a strategy for the FBI to find one engineer with at most n-1 questions?
  2. Is this possible in any number of questions if half the people are managers?
  3. Once an engineer is found, he/she can classify everybody else. Is there a way to classify everybody in fewer questions?