Thursday, July 5, 2007

Solution to the series

The next term in the series is 63.
Solution :-
The nth number of the series is the sum of the nth prime number and nth fibonacci number..

The fibonacci series goes lik this 0, 1, 1, 2, 3, 5, 8, 13..
The nth term is the sum of the (n-1)th and (n-2)th term..

The prime numbers go lik this 2, 3, 5, 7, 11, 13, 17...

http://www.research.att.com/~njas/sequences/
This is an online encyclopedia of integer sequences.. Go there and try searching our sequence.
This is a useful link i found while attempting programming competitions at http://www.topcoder.com

Solution to the Three Doors and 1 Prize Problem..

This is a famous problem in probability called the Monty Hall problem.. For more info goto
http://en.wikipedia.org/wiki/Monty_Hall_problem

The answer is it is always better to switch ur choice to the other door.. Chance of winning doubles if u switch ur door.. The solution goes like this..

Suppose doors are numbered 1,2 and 3. Its clear tat u hav an equal probability of choosing any of the doors. Now suppose tat the prize is behind door 1 and the other 2 doors hav goats behind.

Suppose tat u will always switch ur choice when the gameshow host asks u..

If ur choice was door 2, the gameshow host will open up door 3 for u and show u a goat. So since the prize is behind door 1 u will win if u switch to door 1.

If u picked door 3, the gameshow host will open up door 2 for and show u a goat.. So u will win again if u switch ur choice to door 1..

Now suppose ur choice was door 1, the gameshow host will open any of door 2 or 3 for u. This time u will lose if u switch ur door..
So u hav a 2/3 chance of winning if u switch ur door..

Now suppose ur choice was never to switch..

if door 2 was ur choice, u will lose..
if door 3 was ur choice, u will lose again..
if u had picked door 1, u will win.
So u hav a 1/3 chance of winning if u dont switch..

So ur chance of winning doubles if u switch ur doors..
Hope its clear.. The wikipedia article has links to java applets tat demonstrates tat the solution is correct..

Monday, July 2, 2007

Coloring the Cube

U are given a cube and 6 different colors.. In how many ways can u color the cube by coloring each side with a unique color ??

Guess the next term....

2, 4, 6, 9, 14, 18, 25, 32, 44...
guess the next term in the sequence??

Three Doors and 1 Prize

Suppose you're on a game show, and you're given the choice of three doors: Behind one door is a car; behind the others, goats. You pick door No. 1, and the host, who knows what's behind the doors, opens another door, say No. 3, which has a goat. He then says to you, "Do you want to switch to door No. 2?" Wat will be your choice??

Solution to the 2 Mathematicians

The first clue was the product of their ages is 72.
So take all the possibilities.
72 ,1,1 = not possible coz mathematicians met after 27 years.
36, 2,1= not possible
18,2,2
9,4,2
4,6,3
6,6,2
12,3,2
12,6,1
24,3,1
3,3,8

Now the second clue is tat the sum of their ages is a number tat the other guy can clearly see.. But still the other guy cant guess the answer.
18,2,2 =22
9,4,2 =15
4,6,3 =13
6,6,2 = 14
12,3,2 =17
12,6,1 =19
24,3,1 = 28
3,3,8 = 14
So if the guy couldnt guess the answer tat means tat the total must hav been 14. thn u hav 2 possible ways u can factorise 72 wit the sum 14..
so the answer must be 6,6,2 or 8,3,3
The third clue says tat the youngest daughter just started walking.
So.. 8,3,3 s nt possible.. here u hav 2 younger daughters of the same age.

Therefore 6,6,2 is the answer :)

Solution to Cookie Seller

The solution goes lik this.. :)
We hav inifinte number of boxes of each type..
By taking all multiples of 6 we will get all the even multiples of 3 above 6.. and by taking all multiples of 9 we will be able to make all odd multiples of 3. Thus we can make all the multiples of 3 above the number 6..
So wat abt the the other numbers?? hmmm..
Now take the number 29.. it gives 2 as remainder when divided by 3.. if we add 400 to 29 ie 429 is a multiple of 3. So any number above 410 which gives a remainder of 2 when divided by 3 can be made by using a 400 box and the rest 6 and 9.
ie, 421= can be made as 400 + 21 ( 2 *6+1*9) and so on..
Now take the number 28. it gives a remainder 1 when divided by 3. If we add 800 to 28 ie 828 is divisble by 3..
So any number above 806 can be made by these 3 types of boxes..
So wat abt the maximum tat cannot be sold
805 - 400 is divisible by 3..
804 is divisible by 3
803 is nt divisble by 3, 803-400=403 is nt divisble by 3, a 803-800=3 cannot be made using our boxes..

So 803 is the max number of boxes tat cannot be sold..