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 6:36

I remember this thread. It was a good thread.

https://dis.4chan.org/read/prog/1358656286

And it looks like I never posted my solution.

Name: Anonymous 2014-02-09 16:33

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

Name: Anonymous 2014-02-12 4:11

>>3
Here, I've written something up. I haven't attempted to solve it yet, so the constants may not make any sense. What the hell:

Hello everyone. My name is Adam. I'm all grown up now, and I run a banana distribution company, along with my sister and younger brother. It still isn't simple.

We need to ship bananas from the continent of Curvia (which consists of the area under the curve (x, 20 * sin(x/4) + 16.4 * sin(x/8) - 19 * sin(x/16)) to the continent of Graphia (which consists of the area above the curve (x, -30 * sin(x/2) + 42.8 * sin(x/4) + 9.8 * sin(x/8) + 100) (x must be in [0, 128π] for both continents).

I handle distribution, so my shipping centers will be built along the shore of Curvia. Each shipping center has a designated radius r (r in [1, 15]) and costs 30 + 2*r + 0.2r^2 units/week to operate). A shipping center with radius r brings in 25*A crates of bananas per week, where A is the area given by the intersection of the circle (centered at the shipping center, with radius r) and the land of Curvia. Two shipping centers, obviously, cannot have overlapping circles, and local regulations prevent any two shipping centers from being such that the length of the shoreline curve between them is less than 10. (For collection purposes, the continent extends infinitely, so a distribution center at x=0 can gather bananas that would be harvested where x is negative.)

My sister handles processing, so her processing centers will be built along the shore of Graphia. Each processing center costs a flat fee of 40 units/week to operate, but we will also need to pay floor(n/5) * 50 units/week (where n is the total number of processing centers) in bribes to overcome local regulation.

My little brother runs the shipping lanes between Curvia and Graphia for us, and he's a bit hard to deal with. When given a list of shipping centers and processing centers, he sets up the routes to only run from a shipping center to the single closest processing center, no matter the operating cost. It costs him 0.1 * d + 0.005 * d^2 units/week to run a ship over a straight-line distance d (d includes the length of the return trip), and the ships run once a week, transporting up to 75 crates of bananas each. He won't handle assigning ships to different lanes or any kind of rotation, so once a ship is set up, it will forever run in that designated lane, once a week.

We'd like to maximize profit. The nth ship to arrive at a processing center will have ((80/π)*arctan(75-n) + 55)% of its cargo used (You can assume the ships line up to maximize total cargo usage, partial crates are discarded, however), and each crate of bananas can be processed into 40 units of profit for us. Where should we build the shipping and distribution centers to maximize weekly profit?

Name: Anonymous 2014-02-12 18:05

Adam and his sister do a lot of stuff together. They should fuck.

Name: Anonymous 2014-02-13 11:53

I would give Adam's sister my banana, meaning I would put my cock into her, meaning I would have sex with her, if you catch my drift.

Name: Anonymous 2014-02-13 15:37

Bananas are fucking hot.

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