### Solving the Motorcycle Madness Upgrade Problem

1 Comment Published May 28th, 2009 in Entertainment, tips&tricks#### Problem definition:

Given your balance, pick a subset of upgrades such that summation of Power, Traction and Aerodynamics are maximized and summation of costs doesn’t exceed balance. Problem can be found on this page: http://apps.facebook.com/motorcycle_madness/upgrade.php

#### Solution:

We will use linear programming method. Let’s use an example here. For the initial problem:

Balance: $73,845

Upgrades available:

Suspension

Traction: +30

Aerodynamics: +50

Cost: $30,000

Sport Stabilizer

Traction: +50

Cost: $25,000

Transmissions

Power: +20

Traction: +30

Cost: $35,000

Jet Kit

Power: +50

Cost: $40,000

Nitrous Kit

Power: +100

Cost: $80,000

Tires

Traction: +30

Cost: $18,000

Throttle Body

Power: +25

Cost: $17,500

Brakes

Traction: +20

Cost: $12,000

Stealth Radiator Cover

Aerodynamics: +50

Cost: $10,000

Exhaust

Power: +30

Cost: $20,000

Air Filters

Power: +20

Cost: $15,000

### Steps:

- Assign a variable for each upgrade and find cumulative gain for each. Cumulative gain is addition of gains in each category (Power, Traction and Aerodynamics).

(gain x1000)**variable****upgrade****gain**a Suspension 80 b Sport Stabilizer 50 c Transmissions 50 d Jet Kit 50 e Nitrous Kit 100 f Tires 30 g Throttle Body 25 h Brakes 20 i Stealth Radiator Cover 50 j Exhaust 30 k Air Filters 20 - Write down objective function as summation of each upgrade multiplied by its gain.

p = 80a+50b+50c+50d+100e+30f+25g+20h+50i+30j+20k - Write down balance constraint as summation of each upgrade multiplied by its cost.

30a+25b+35c+40d+80e+18f+17.5g+12h+10i+20j+15k <= 73 - Write down supply constraints. Only one upgrade is available for each of them.

a <= 1, b <= 1, c <= 1, d <= 1, e <= 1, f <= 1, g <= 1, h <= 1, i <= 1, j <= 1, k <= 1 - Go to an online linear programming solver site, ex. http://www.zweigmedia.com/RealWorld/simplex.html
- Type your problem into problem box.

Maximize p = 80a+50b+50c+50d+100e+30f+25g+20h+50i+30j+20k subject to

30a+25b+35c+40d+80e+18f+17.5g+12h+10i+20j+15k <= 73

a <= 1

b <= 1

c <= 1

d <= 1

e <= 1

f <= 1

g <= 1

h <= 1

i <= 1

j <= 1

k <= 1 - Click “Solve”. Optimal solution appears below.

p = 193.333; a = 1, b = 1, c = 0, d = 0, e = 0, f = 0.444444, g = 0, h = 0, i = 1, j = 0, k = 0

That is, you should buy upgrades a (Suspension),b (Sport Stabilizer) and i (Stealth Radiator Cover).

f (0.444444) is smaller than 1, so there is not enough balance left after buying a,b and i and it will not be bought.

That’s all. Good luck.

Ha! Nice use of mathematics ðŸ™‚