Lunch

Save money in BNL cafeteria

When I first entered BNL summer research program, I was told the cafeteria offers 20% discount to research students.
After some investigation, it is in fact, not correct. I feel like BNL lied to me, cheated on me. I don't feel safe at BNL anymore.

Suppose function f(x) = amount I pay for food that normally cost $x. The definition of f(x) is:

f(x) = \normalsize \left{
\begin{eqnarray}
x &&(x<3.5)\\
x-0.75 &&(3.5 \le x < 5)\\
x-1 &&(5 \le x < 8)\\
x-1.5 &&(8 \le x < 12)\\
x-2.25 &&(12 \le x < 15)\\
x-3 &&(15 \le x )\\
\end{eqnarray}
Graph of f(x) compare to x and 0.8x

d(x) = \frac{f(x)}{x}
Graph of d(x) compare to 0.8

Graph of f(x) using d(x) with some transformation as gradient. darker = less percent discount.

Function s(x) is the average discount from 0 to x. Defined as
s(n) = \frac{\normalsize\int\limits_{0}^n d(x)\mathrm{d}x}{n}
s(15) = 0.85
s(x) is a monotonic increasing function for x>15.
So on average, if one spend $15 or more, one has less than 15% discount!

After analyze the entire system, how can we take advantage of it and get as much discount as possible?
You can break the order into pieces so it fit into some range, or combine order with someone else to get maximum profit.
For example, a $7(with tax) order composed of 2 $3.5 lasagna. Normally you pay $6, but split it into two orders, you pay$5.5. Doing it everyday can save up to $15 when the research program ends!
I don't have enough skills on problems like this, my guess is there is no simple analytical formula to find how exactly buy stuff to get the best result, it's best to use computer to find a numerical answer.

Without out a computer, you have to do a little calculations, bring a table of values would be nice, here is one from $3.5 to $15, every 10 cents gap. With amount of money before savings and discount expected. Orange = 20+% discount, Yellow = 18.75+% discount.(remember to add tax while looking at the menu)

$ % $ % $ % $ %
3.5 0.2143 6.4 0.1562 9.3 0.1613 12.2 0.1844
3.6 0.2083 6.5 0.1538 9.4 0.1596 12.3 0.1829
3.7 0.2027 6.6 0.1515 9.5 0.1579 12.4 0.1815
3.8 0.1974 6.7 0.1493 9.6 0.1562 12.5 0.1800
3.9 0.1923 6.8 0.1471 9.7 0.1546 12.6 0.1786
4.0 0.1875 6.9 0.1449 9.8 0.1531 12.7 0.1772
4.1 0.1829 7.0 0.1429 9.9 0.1515 12.8 0.1758
4.2 0.1786 7.1 0.1408 10.0 0.1500 12.9 0.1744
4.3 0.1744 7.2 0.1389 10.1 0.1485 13.0 0.1731
4.4 0.1705 7.3 0.1370 10.2 0.1471 13.1 0.1718
4.5 0.1667 7.4 0.1351 10.3 0.1456 13.2 0.1705
4.6 0.1630 7.5 0.1333 10.4 0.1442 13.3 0.1692
4.7 0.1596 7.6 0.1316 10.5 0.1429 13.4 0.1679
4.8 0.1562 7.7 0.1299 10.6 0.1415 13.5 0.1667
4.9 0.1531 7.8 0.1282 10.7 0.1402 13.6 0.1654
5.0 0.2000 7.9 0.1266 10.8 0.1389 13.7 0.1642
5.1 0.1961 8.0 0.1875 10.9 0.1376 13.8 0.1630
5.2 0.1923 8.1 0.1852 11.0 0.1364 13.9 0.1619
5.3 0.1887 8.2 0.1829 11.1 0.1351 14.0 0.1607
5.4 0.1852 8.3 0.1807 11.2 0.1339 14.1 0.1596
5.5 0.1818 8.4 0.1786 11.3 0.1327 14.2 0.1585
5.6 0.1786 8.5 0.1765 11.4 0.1316 14.3 0.1573
5.7 0.1754 8.6 0.1744 11.5 0.1304 14.4 0.1562
5.8 0.1724 8.7 0.1724 11.6 0.1293 14.5 0.1552
5.9 0.1695 8.8 0.1705 11.7 0.1282 14.6 0.1541
6.0 0.1667 8.9 0.1685 11.8 0.1271 14.7 0.1531
6.1 0.1639 9.0 0.1667 11.9 0.1261 14.8 0.1520
6.2 0.1613 9.1 0.1648 12.0 0.1875 14.9 0.1510
6.3 0.1587 9.2 0.1630 12.1 0.1860 15.0 0.2000

Someone can design a program so it's possible to calculate the most optimal solution if at most x order splits is possible for n individual food with each of the food's price p_n.

P.S. The summer science program(Research Program:Science Program::Gentoo:Ubuntu) started today. So many Asian girls!(at least 8) it's unbelievable! It's like MIT! Haha, I was wondering where's the Asian when I entered the research program(only me + 1 more person).

Syndicate content
Honey Pot that kill bots