- **Algebra**
(*http://mymathforum.com/algebra/*)

- - **optimal number of shares**
(*http://mymathforum.com/algebra/49268-optimal-number-shares.html*)

optimal number of shareshere is a problem: I have \$2000 I want to buy 2 different shares YYY (share price 109) and ZZZ (share price 14) what is the optimal number of YYY and ZZZ shares to buy to spend the most of \$2000 and have the remainder of that as close to zero as possible? 109y+14z=2000 what would be another equation in my Systems of equations? I cannot think of it. Please help. |

I am not sure that there is another equation. My thinking is that one should maximize the 14 dollar shares. To do that, I would buy just one 109 dollar share. This would leave 1891 to spend on the 14 dollar shares. 1891÷14=135.0717... If you buy 135 of these shares you will spend 1890 dollars. This amount when added to the 109 dollars sums to 1999 dollars. That's pretty darn close. But is there's an algebraic way to do it, I would like to become aware of it. And if there is another combination that comes closer to 2000 dollars, I would be surprised. |

The only constraint you have is that x and y be non-negative integers and the left side cannot exceed the right side. By brute force try y between 0 and 18 to see what gets you the closest. |

Hello, get42n8! Quote:
There is no second equation. This is a Diophantine equation, requiring integer solutions. This can be solved by Modular Arithmetic, but here is an algebraic solution. Solve for $z\!:\;\; z \;=\;\dfrac{2000-109y}{14} \quad\Rightarrow\quad z\;=\;142 - 8y + \dfrac{12+3y}{14}$ Since $z$ is an integer, $3(4+y)$ must be a multiple of 14. The first time this happens is: $\:y = 10$ Hence: $\:z \:= \: \dfrac{2000-109(10)}{14} \:=\:\dfrac{910}{14} \:=\:65$ Therefore: $\:\boxed{y \,=\,10,\;z\,=\,65}$ Check: $\:109(10) + 14(65) \:=\:2000$ |

Good job, soroban! Please help me to understand why $z \;=\;\dfrac{2000-109y}{14} \quad\Rightarrow\quad z\;=\;142 - 8y + \dfrac{12+3y}{14}$ |

Quote:
= 142 - 8y + \frac{12+3y}{14} $$ |

This problem can be modeled as integer programming model as follows: Min x Subject to 109y+14z+x=2000 x,y,z >=0 and integer In operations research area, there are some methods which can be ussed to solve these models. Also some softwares like Lindo solver can also be used. |

All times are GMT -8. The time now is 03:19 AM. |

Copyright © 2018 My Math Forum. All rights reserved.