Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Banana programming challenge: Utilitarianism

Name: Anonymous 2014-02-09 6:15

Hello everyone. My name is Adam. For as long as I can remember, my sister and I have loved eating bananas. We do not share the same banana eating habbits however. I typically like eating the bananas earlier, when they are more green. My sister likes to eat the bananas later. You might think to yourself that we have ourselves a nice setup. I can buy a bunch of bananas and we can share, me eating the bananas earlier ones and her eating the later ones. But it turns out to be not so simple.

Suppose that the value I get from eating a banana can be given by ceil(.22*d^3-2.7*d^2+7.7*d+3.8) for integer values of d between 0 and 6 inclusive and d represents the number of days passed since purchasing the bananas. Also suppose that the value my sister gets from eating a banana is given by a graph that is symmetrical to mine about 3. As far as the cost of the bananas, the value of a dollar is worth 5 units of value to us.

On days that a banana is not eaten either of us, our little brother takes one for himself. This is to be avoided as he does not contribute money towards the bananas.

Maximize the combined value my sister and I can get from a bunch of bananas using the number of bananas bought and when they are eaten as variables. Bananas can only be bought at most one bunch per week and at most each person can eat one banana in a given day. The number of bananas consumed by my sister and I cannot differ by more than 1 for a given week. Bananas are sold in bunches of between 6-8 inclusive. Assume each banana weighs the same (.48 lb) and cost $1.42/lb.

Name: Anonymous 2014-02-09 16:33

This one is solvable by a brute force check, though. Perhaps something like a massive shipping problem?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List