Quote:Suppose you have two numbers. The difference of the two numbers is 12. The product of the two numbers is 17. Multiply the larger of the two numbers by 100, add 50 times the smaller number to that, round the total to the nearest whole number, and that's my price.
Is this the new Lenny?
The solution, of course, is fairly simple, especially when one notices that there is nothing that requires the values to be whole numbers (else, why the need to round?), so primality is not a concern:
. . . . .smaller number: x
. . . . .larger number: y
. . . . .difference: y - x = 12
. . . . .product: xy = 17
. . . . .The "difference" equation gives:
. . . . .y = x + 12
. . . . .Then:
. . . . .xy = x(x + 12) = 17
. . . . .x^2 + 12x = 17
. . . . .x^2 + 12x - 17 = 0
. . . . .The Quadratic Formula allows us to solve:
. . . . .x = (-12 ± sqrt[144 - 4(-17)]) / 2
. . . . .x = (-12 ± sqrt[144 + 68]) / 2
. . . . .x = (-12 ± sqrt[212]) / 2
. . . . .x = (-12 ± 2 sqrt[53]) / 2
. . . . .x = -6 ± sqrt[53]
. . . . ....or about x = -13.28 and about x = 1.28, making y, respectively,
. . . . .equal to about -1.28 and about 13.28.
. . . . .If x were negative, then we would have:
. . . . .100y + 50x = 100(-1.28) + 50(-13.28) = -792
. . . . ....which obviously doesn't make sense in this context. So x = 1.28, and:
. . . . .100y + 50x = 100(13.28) + 50(1.28) = 1392
The above is the reasoning. You'll want to do the
exact computations to find the
exact values, and then round
up to find the required value.
As always, check my work.
Eliz.