The method answer to this question is almost exactly the same as the answer to the question “Mixing Paintsâ€. The only difference here is that the target ratios are in the form a:b rather than 1:x. However, this m:n, a ratio simplified to its simplest terms and where a and b are natural numbers, can be converted into a unitary ratio (a ratio in the form 1:x), dividing both terms by ‘m’ gives us the ratio 1:(n/m), which is in the form of 1:x.
From here we can use the same formula that we used in “Mixing Paints†to solve the answer (I will include the derivation of the general solution that at the end of this solution):
So, let:
The number of pots of paint A = a,
The number of pots of paint B = b,
The ratio of paint A = 1:x,
The ratio of paint B = 1:y,
And, the target ratio = 1:z.
Referring to the previous answer,
a = (z+1) - ((y+1)(x-z)/(x-y))
b =(y+1)(x-z)/(x-y)
Using paints of ratios 1:4 and 1:5
Target ratio:
2:9 = 1:9/2 = 1:4.5
x =4, y = 5, z = 4.5
a = 5.5 - (6(-0.5))/-1
= 5/2
b = 6(-0.5)/-1
= 3
So the decorator needs 5/2 pots of paint A and 3 pots of paint B.
However, the answer gives us a fraction rather than a natural number, and we can’t buy parts of pots of paint, so we find a common denominator for both the numbers of pots and then remove the common factor, which would be the common denominator.
5/2 , 3/1
= 5/2 , 6/2
Answer = 5 pots of A and 6 pots of B.
Keeping in mind how to handle the fractions we get in this solution, let’s move on to the next answers.
3:14 = 1:14/3
x = 4, y = 5, z = 14/3
a = ((14/3)+1) - (6(-â…”))/-1
= 5/3
b = (6(-â…”))/-1
= 4
5/3 of A and 4 of B
= 5 of A and 12 of B
10:43 = 1: 43/10 = 1:4.3
x = 4, y = 5, z = 4.3
a = 5.3 - (6(-0.3))/-1
= 7/2
b = (6(-0.3))/-1
= 9/5
7/2 pots of A and 9/5 pots of B
Or, 35/10 pots of A and 18/10 pots of B
Or, 35 pots of A and 18 pots of B
Using paints with ratios 1:3 and 1:7
Target ratio:
2:9 = 1:4.5
x =3, y = 7, z = 4.5
a = 5.5 - (8(-1.5))/-4
= 5/2
b = 8(-1.5)/-4
= 3
5/2 of A and 3 of B
Or, 5 of A and 6 of B
3:14 = 1:14/3
x = 3, y = 7, z = 14/3
a = ((14/3)+1) - (8(-5/3))/-4
= 7/3
b = (8(-5/3))/-4
= 10/3
7/3 of A and 10/3 of B
= 7 of A and 10 of B
10:43 = 1:4.3
x = 3, y = 7, z = 4.3
a = 5.3 - (8(-1.3))/-4
= 27/10
b = (8(-1.3))/-4
= 13/5
27/10 pots of A and 13/5 pots of B
Or, 27/10 pots of A and 26/10 pots of B
Or, 27 pots of A and 26 pots of B
It is possible to achieve a ratio of a:b by using paints of ratios 1:x and 1:y only if x<b/a<y. It is impossible is b/a is not between x and y because, logically speaking, we can’t get a paint to be darker than the darkest of the two or lighter than the lightest if the two.
In an algebraic sense too, let’s consider the general solution for b, (y+1)(x-z)/(x-y). Since x < y, the denominator is negative, but if z<x, the numerator remains positive, thus giving a negative answer, but we can’t have negative number of pots.
If z>y, the value for b will be positive since the numerator will be negative like the denominator, but, the value for b is greater than z+1, and the general solution for a = (z+1) - ((y+1)(x-z)/(x-y)) = (z+1) - b, since b > z+1, the value for a is negative, so it is not a valid solution.
Proof that if a<0 if z>y:
a = (z+1) - ((y+1)(x-z)/(x-y))
= ((z+1)(x-y) - (y+1)(x-z))/(x-y)
= ((xz - yz + x - y) - (xy - yz + x - z))/(x-y)
= (xz -y - xy + z)/(x-y)
= (x(z-y) + z - y)/(x-y)
= (x(z-y) + (z-y))/(x-y)
= ((z-y)(x+1))/(x-y)
We know that x < y therefore x-y < 0
We know that z > y therefore z-y > 0
We know that x > 0 therefore x+1 > 0
Therefore a = mn/k < 0, where m, n > 0 and k < 0. Which means that if z > y, we would need a negative number of pots of A.
Therefore, to get a ratio a:b using paints with ratio 1:x and 1: y where x<y, x<b/a<y.
Derivation of general solution from “Mixing Paintsâ€:
Let:
The number of pots of paint A = a,
The number of pots of paint B = b,
The ratio of paint A = 1:x,
The ratio of paint B = 1:y,
And, the target ratio = 1:z.
Since we know that the mixing of paints A and B will give us the mean of the two ratios:
(a(1/(x+1)) + b(1/(y+1)))/a+b = 1/(z+1)
(I am using x+1, y+1, and z+1 rather than x, y, and z because both terms of a ratio add up to make a whole. Eg; 1:3 means that something is divided up into ¼ and ¾, not ⅓ and 3/3)
Now, we split the equation above into 2 parts, one being the numerator of both sides of the equation and the other being the denominator:
a(1/(x+1)) + b(1/(y+1)) = 1
=> (a(y+1) + b(x+1))/(x+1)(y+1) = 1
=> a(y+1) + b(x+1) = (x+1)(y+1)
a + b = z+1
=> a = (z+1) - b
Substituting 2) into 1),
((z+1) - b)(y+1) + b(x+1) = (x+1)(y+1)
=> (z+1)(y+1) - b(y+1) + b(x+1) = (x+1)(y+1)
=> b((x+1)-(y+1)) = (x+1)(y+1)-(z+1)(y+1)
=> b(x-y) = (y+1)((x+1)-(z+1))
=> b = ((y+1)(x-z))/(x-y)
Therefore, a = (z+1) - ((y+1)(x-z))/(x-y)