Saturday, May 5, 2007

Stock Price

Rushabh works for the Stock Exchange as a Share Broker. He primarily keeps his eyes on Shares related to IT companies.

One day he met his friend Parag, during lunch time. Parag asked him about the price of a single Share of Info Tech company.

Rushabh answered cryptically by giving following three clues:

  • if price of a Share is multiple of 5, then it is between $1 and $30
  • if price of a Share is not a multiple of 7, then it is between $31 and $50
  • if price of a Share is not a multiple of 10, then it is between $51 and $60
What is the price of a Share of Info Tech company?

Note that the price of a Share is a positive integer.
















Answer is 56.

Solution:
1. If muliple of 5 > 5,10,15,20,25
2. If not a muliple of 7 > 31,32,33,34,36,37,38,39,40,41,43,44,45,46,47,48
3. If not a muliple of 10 > 51,52,53,54,55,56,57,58,59

Let say, its multiple of 5, In this case, it won't be multiple of 7 as none of number in case 1 is divisible by 7, so case 1 and case 2 will contrdict. So can't be a multiple of 5. If can't be a multiple of 5 then also can't be a multiple of 10. so case 3 will hold true and then number will be anyone from case 3.
Now acc to case 2, if its not a multiple of 7, it anyone from case 2 numbers. So only 56 from case 3 fits as Its a multiple of 7 so case 2 won't apply.

For more such articles, Visit: http://www.pankajbatra.com

Sweets

Patricia loves Indian sweets. During her visit to the Indian Sweets Shop, she purchased three different types of sweets – Rasgulla, Gulab Jamun and Barfi.

She purchased as many pieces of each type of sweets as its price in dollar. Each of the three types of sweet cost a different amount per piece. She spent less than $100.

Rasgulla cost the most, Gulab Jamun cost less and Barfi cost the least per piece. Compared to Rasgulla, one of the other two types of sweet costs $ 5 less per piece.

If she paid an average of $ 7 for each piece of sweet, how many of each type did she purchase?











Patricia purchased 9 Rasgulla, 4 Gulab Jamun and 1 Barfi. She paid $ 98.

Assume that she purchased R pieces of Rasgulla. Also assume that P and Q are the number of pieces of other sweets.

It is given that - she purchased as many pieces of each type of sweets as its price in dollar and she paid an average of $ 7 for each piece of sweet. Hence,
7 * (R + P + Q) = R*R + P*P + Q*Q

Since the average price per piece is $ 7 and Rasgulla cost the most, per piece cost of Rasgulla should be more than $ 7.

Also, it is given that - Compared to Rasgulla, one of the other two types of sweet costs $ 5 less per piece.

Consider R = 8 and hence, P = 3
7 * (8 + 3 + Q) = 8*8 + 3*3 + Q*Q
7 * (11 + Q) = 64 + 9 + Q*Q
Q*Q – 7*Q – 4 = 0
For Q = 1, 2, 4, 5, 6, 7, above equation is not valid.

Consider R = 9 and hence, P = 4
7 * (9 + 4 + Q) = 9*9 + 4*4 + Q*Q
7 * (13 + Q) = 81 + 16 + Q*Q
Q*Q – 7*Q + 6 = 0
Q = 6 or Q = 1

Q can not be 6 as total cost (81 + 36 + 16 = 133) would be more than $ 100. Hence, Q=1.

For all other values of R, the total cost would be more than $ 100.

Thus, Patricia purchased 9 Rasgulla, 4 Gulab Jamun and 1 Barfi. She paid $ 98.

For more such articles, Visit: http://www.pankajbatra.com

Wednesday, May 2, 2007

Jars

The Problem:

You've got two jars, one of them fits exactly 7 liters, the other one fits exactly 4 liters. How could you get exactly 2 liters with these two jars? You have unlimited supply of water and you are allowed to spoil some water.





The Solution:

7 0 fill the 7 ltr jar completely
3 4 fill the 4 ltr jar using the 7 ltr one completely
3 0 empty the 4 ltr jar
0 3 fill all water from 7 ltr jar to 4 ltr water
7 3 fill the 7 ltr jar completely
6 4 fill 4 ltr jar from 7 ltr one completely
6 0 empty the 4 ltr jar
2 4 fill 4 ltr jar from 7 ltr one completely
2 0 empty the 4 ltr jar

Now you have exactly 2 ltrs in 7 ltr jar

For more such articles, Visit: http://www.pankajbatra.com