Hi eveyone, I'm currently have an mathematical issue, hope that you guys could help me:

Find ax + by ≤ z satisfying a = b or a + 1 = b or a = b + 1 and ax + by least different from z

For instance, when x = 64, y = 7, z = 490:
64a + 7b ≤ 490
With this inequation , a = 7 and b = 6 is the most appropriate answer.

Could you guys please tell me how to find a and b for similar equation? Thank you very much!​



Answer :

Answer:

  look for points between the limit lines

Step-by-step explanation:

You want to find 'a' and 'b' to satisfy ax +by ≤ z with the least possible difference from z, given that b-1 ≤ a ≤ b+1.

Solution

A graphing calculator can be helpful for this. The region ax+by≤z can be graphed, along with lines a=b±1. The grid point on or between the limit lines and closest to the region boundary is the one you're looking for.

Example

In the attachment, we have used (x, y, z) = (23, 16, 82). The solution region is shaded orange, and the limit lines a=b±1 are drawn in blue. The point (a, b) = (2, 2) is seen to be the grid point on or between the limit lines and closest to the orange boundary line.

__

Additional comment

It may be helpful to use a=b to solve for their values: a=b=⌊z/(x+y)⌋, then compute the difference from z. That difference relative to the values of x and y will tell you whether it can be useful to increase 'a' or to increase 'b'.

In your problem, the a=b solution is 490/(64+7) ≈ 6.9. The value of z for a=b=6 is 426, which differs from 490 by 64. This is the value of x, so increasing 'a' by 1 will reduce the difference to zero, giving you (a, b) = (7, 6).

In the made-up problem we chose, (a, b) = (2, 2) gives z = 78 against a target of 82. The difference from target is less than either of x or y, so this is the best solution.

View image sqdancefan