• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

Seven-Eleven

radosr

Baruch MFE Faculty
Joined
7/18/07
Messages
640
Points
73
Bob enters a Seven-Eleven store and buys four items. The clerk enters the prices into his pocket calculator and multiplies them to get 7 dollars and 11 cents. Bob complains telling the clerk that he should add prices not multiply! The clerk apologizes, adds the prices and again gets 7 dollars and 11 cents! How much is the most expensive item Bob bought?
 
Information:
a*b*c*d = 7.11
a+b+c+d = 7.11
a>b>c>d>0
100*a, 100*b, 100*c, 100*d are integers

To find a.

711=3*3*79

(100a)*(100b)*(100c)*(100d) = 711000000 = 3*3*79*100*100*100
(100a)+(100b)+(100c)+(100d) = 711

Possible solution for (100a, 100b, 100c, 100d):
(316, 150, 125, 120)

So, costliest item costs 3 dollars 16 cents

-- Pratik
http://www.pratikpoddarcse.blogspot.com
 
Information:
a*b*c*d = 7.11
a+b+c+d = 7.11
a>b>c>d>0
100*a, 100*b, 100*c, 100*d are integers

To find a.

711=3*3*79

(100a)*(100b)*(100c)*(100d) = 711000000 = 3*3*79*100*100*100
(100a)+(100b)+(100c)+(100d) = 711

Possible solution for (100a, 100b, 100c, 100d):
(316, 150, 125, 120)

So, costliest item costs 3 dollars 16 cents

-- Pratik
http://www.pratikpoddarcse.blogspot.com
Nice solution. But how did you get this: Possible solution for (100a, 100b, 100c, 100d):
(316, 150, 125, 120)?
 
Well 79 is prime. So, one of the 4 numbers had to be 79, 158, 237, 316, 395, 474...
So 711-(that number) would be: 632, 553, 474, 395, 316, 237...
and 711000000/(that number) would be 90000, 45000, 30000, 22500. 18000, 15000...

Since all the multiples have a lot of zeroes in them, I am more comfortable trying for 711-316=395 first. I get a solution in my first attempt. Bingo!

Hope that helps!

http://www.pratikpoddarcse.blogspot.com
 
Back
Top