BNL

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).

Some math thing suggested by friend

BNL lunch break.
Adam was talking about a function T(f(x),g(x)) that takes any linear function f(x) and apply g(x), but make it seems like f(x) is the x-axis.
Without drawing a graph, it's quite ambiguous of what the above sentence mean.
A graph example, where f(x) = x, g(x) = sin(x).

So I told him, to do that, just do the g(x) on x-axis and then rotate the entire graph with the origin as center until the original x-axis is on f(x).

He then asked, what if f(x) is not a linear function.

For a second I can't think of something out, and soon, I was distracted so I said I will look up tonight.

On the road back to my office, the answer popped up. My answer is trivial and it's just one way to see the question, and I believe there must be other ways.

T(f(x),g(x)) generates a graph, where each point of the graph is the point g(x) away from (x, f(x)) and on the line that perpendicular to f'(x) and intersects (x,f(x)).

Finding a universal equation for this T(f(x),g(x)) to graph it:
It's trivial. The above description almost instantly lead to the result.
T(f(x),g(x)) = (x - g(x) \sin(\tan^{-1}(f'(x))),f(x) + g(x) \cos(\tan^{-1}(f'(x)))
I have to use parametric, because can be a one to many function even if both functions are one to one functions.
If f(x) is not differentiable at some points, then the graph is not defined at those points.
Some nice graphs generated from Mathematica
f(x) = x^2, g(x) = floor(|x|)

f(x) = sin(x), g(x) = sin(4x)

Ones I used maxima + gnuplot
f(x) = sin(x), g(x) = floor(x)

f(x) = sin(x), g(x) = x

f(x) = sin(x), g(x) = log(x)

f(x) = sin(x), g(x) = x^2

f(x) = sin(x), g(x) = sqrt(2)

I hope I know what this stuff Adam thought of is called.

Third day in BNL

I'm currently in BNL's high school research program(HSRP). The first day I wasn't approved on site because I was born in China, even though my citizenship is Australian.
Aww... sensitive country... background check...

No offense to all those waaaaaay too serious Chinese people who can't understand my sarcastic blog post and take a joke by saying.
"Sometimes, I wish I were never Chinese."

Everyone I know beside me is doing something with programming. They do statistics or writing programs control lasers or...
Uhh... why do I get to handle poisonous crystal(CdZnTe) and use radiation and some compressed gas to test do stuff with it's structure?
The last few days I'm doing nothing but safety training.
I didn't get to do any real work!

Some very funny thing happened today when someone mentioned using light store information.

Mgccl: so there is no waaaaaay... light can stores information... even if light is polarized...
kupo: individual photons can have spin
Mgccl: how can you make photons don't move around...
kupo: ?
dotCOMmie: Mgccl: you can make a buffer d:

Haha, buffer. Get it? Buffer and buffer.
My point is, a storage have to be able to keep it's contents. But light moves and hit surfaces and lose energy and GONE.

This is my temporary office at BNL.


Isn't it nice? I believe I have the biggest office out of all those high school researchers.
You want it? Too bad it isn't yours. Muhahahaha

Anyone who is also doing the HSRP and reading this, please go to cafeteria at lunch breaks, there are fun people from Shoreham-Wading River High School.
And of course....
Asian girls.
I saw one of the hottest1 Asian girl ever. She seems to be a Japanese college student.
So please come down to cafeteria and enjoy having expensive food2 and math with me and a few other people3!

Facebook believe I'm gay again.

Maybe is because I replied a wall post to another male. Guess straight guys not suppose to do that. I have to refrain myself from reply to other people's wall post.

  1. 1. As hot as the Jericho girl I once liked
  2. 2. Three 1 cm radius 6 cm in length sausage and 2 spoonful of mash potato = over $6.50
  3. 3. Only if you are from SWR or if you like math/computer science/games/math jokes
Syndicate content
Honey Pot that kill bots