Hello all,
I am new to the forum and I hope I am posting this question on right section.
If I am not, my deepest apologies.
So here goes:
We have:
a amount of stamps each valued 1 $, named x,
b amount of stamps each valued 1.4 $, named y,
c amount of stamps each valued 2.2 $, named z.
We are trying to reach a predefined sum of T with a combination of these stamps prefably getting an equal value, if we can't, a minimum higher value than T.
(Basically: ax + by + cz >= T)
How can we calculate this with minimum trial & error (none, if such thing is possible).
Does the title have anything to do with the problem given in the question?
It is soluble without
ANY trial and error because the minimization of the error provides the extra inequalities needed. We can deduce the algorithm below. I justify the first few steps in the algorithm.
\(\displaystyle \text {DEFINE } x = \lfloor t \rfloor \text { and } i = t - x.\)
NOTE: \(\displaystyle 0 \le i < 1.\)
\(\displaystyle x = 0 \implies a = 1,\ b = 0 = c.\)
Any other triplet of non-negative numbers will give a result greater than t by more than 0.99, which is the greatest excess possible with this triplet.
\(\displaystyle x > 0 \text { and } i = 0 \implies a = x,\ b = 0 = c.\) Obvious.
\(\displaystyle x = 1 \text { and } 0 < i \le 0.4 \implies b = 1,\ a = 0 = c.\)
Any other set will result in an excess over t greater 0.39, which is the greatest possible excess with this combination.
\(\displaystyle x = 1 \text { and } i > 0.4 \implies a = 2,\ b = 0 = c.\)
Anything else will result in an excess greater than 0.59.
\(\displaystyle x > 1 \text { and } 0 < i \le 0.2 \implies a = x - 2,\ b = 0,\ c = 2.\)
\(\displaystyle x > 1 \text { and } 0.2 < i \le 0.4 \implies a = x - 1,\ b = 1,\ c = 0.\)
\(\displaystyle x = 2 \text { and } 0.4 < i \le 0.6 \implies b = 2,\ a = 0 = c.\)
\(\displaystyle x > 2 \text { and } 0.4 < i \le 0.6 \implies a = x - 3,\ b = 1 = c.\)
\(\displaystyle x > 1 \text { and } 0.6 < i \le 0.8 \implies a = x - 2,\ b = 2,\ c = 0.\)
\(\displaystyle x > 1 \text { and } 0.8 < i \implies a = x + 1,\ b = 0 = c.\)
EDIT: Upon reflection, I am not sure that someone studying intermediate algebra should be expected to solve this problem. Ultimately the algorithm developed above can be justified algebraicaly, but I did not originally attack it that way. I attacked it by noticing that with the values given, I could get to within 19 cents of any given value of t once it was big enough. Then it was a matter of finding what was the meaning of big enough. This may be a good exercise in problem solving or discrete math (a field not very well defined in my opinion), but it is not easily approached from the standpoint of algebra.