Model the following scenario as a multivariable equation with a set of constraints and find the maxima

54 Views Asked by At

Greg wants to maximize his credit card rewards and has narrowed his options down to 3 credit cards. However, Greg only wants to apply for 2 new credit cards to avoid hurting his credit score. Based on Greg's spending over the last year, which 2 credit cards will give him the greatest credit card rewards?

Last Year's Spending:

  • $3,000 on groceries

  • $2,000 on gas

  • $1,000 on misc items

Credit Card 1:

  • 2% cash back on all purchases

Credit Card 2:

  • 4% cash back on groceries

  • 1% cash back on all other purchases

  • $100 annual fee

Credit Card 3:

  • 6% cash back on gas

  • 3% cash back on groceries

  • 0.5% back on all other purchases

  • $150 annual fee

*An annual fee is a flat rate fee charged once a year for using a credit card

Model each credit card and propose a way to solve for the maximum rewards Greg can collect by optimizing his spend across any 2 of the 3 credit cards.


So I was able to pretty easily model the basic attributes of the credit cards and define the constraints.

This is all very verbose but I find it helps me see the problem better since the constraints are complex.

$a_0$ = Greg's total grocery spend

$a_1$ = Grocery spend on card 1

$a_2$ = Grocery spend on card 2

$a_3$ = Grocery spend on card 3

$b_0$ = Greg's total gas spend

$b_1$ = Gas spend on card 1

$b_2$ = Gas spend on card 2

$b_3$ = Gas spend on card 3

$c_0$ = Greg's total misc spend

$c_1$ = Misc spend on card 1

$c_2$ = Misc spend on card 2

$c_3$ = Misc spend on card 3

$r$ = collected rewards

Constraints

$a_1 + a_2 + a_3 = a_0$

$b_1 + b_2 + b_3 = b_0$

$c_1 + c_2 + c_3 = c_0$

$a_0 = 3000$

$b_0 = 2000$

$c_0 = 1000$

$a_1 \ge 0$

$a_2 \ge 0$

$a_3 \ge 0$

$b_1 \ge 0$

$b_2 \ge 0$

$b_3 \ge 0$

$c_1 \ge 0$

$c_2 \ge 0$

$c_3 \ge 0$

Model

This is where I am now:

$r = (a_1 * .02) + (b_1 * .02) + (c_1 * .02) + (a_2 * .04) + (b_2 * .01) + (c_2 * .01) + (a_3 * .06) + (b_3 * .03) + (c_3 * .005)$

That's a lot, but there's one thing missing, the annual fees on credit cards 2 and 3! I can't figure out how I'd model them into a solvable function, or even if that is possible. I've looked into translating if-then logic into mathematical equivalents but I've gotten nowhere. My first thought was to use LaGrange Multipliers to find a local maximum, but I don't know how to get the annual fee concept worked into the equation.

If $ a_1 + a_2 + a_3 > 0 $, fee = 150, or something like that. I'm a bit removed from linear algebra and multivariable calculus days. Some more than anything I just need a direction to be pointed toward.