Archie M. answered 04/08/22
Experienced Math Educator for Classes and Standardized Test Prep
Let
- x be the number of lilies.
- y be the number of roses, and
- z be the number of daisies.
We assume that x, y, and z are positive integers. (Note that z must be even since each daisy is $0.50 while each of the other two flowers is an integer dollar.)
We have a system of two linear Diophantine equations in three variables.
- x + y + z = 24 (number of flowers)
- 3x + 2y + 0.5z = 24 (dollars)
We can multiply the second equation by 2 so that the coefficients are integers:
- 6x + 4y + z = 48
Subtracting the first equation from the second, we get
- 5x + 3y = 24
Note that gcd(5, 3) = 1, so we can use the Euclidean Algorithm:
- 5 = 1 x 3 + 2
- 3 = 1 x 2 + 1
So 1 = (1 x 3) - (1 x 2) = (1 x 3) - 1 x (5 - 1 x 3) = (1 x 3) - (1 x 5) + (1 x 3) = 2 x 3 + (-1) x 5.
Multiplying both sides by 24, we get 24 = (48) 3 + (-24) 5.
Then
- x = 48 + (5/1) t = 48 + 5t
- y = -24 - (3/1) t = -24 - 3t
- z = 24 - x - y = 24 - (48 + 5t) - (-24 - 3t) = -2t
- where t is any integer
We want x > 0, y > 0, and z > 0, so
- 48 + 5t > 0 or t > -48/5 = -9 3/5
- -24 - 3t > 0 or t < -8
- -2t > 0 or t < 0
The only integer value of t that satisfies all three inequalities is t = -9. Therefore,
- x = 48 + 5(-9) = 3
- y = -24 - 3(-9) = 3
- z = -2(-9) = 18
Therefore, Ali can buy 3 lilies, 3 roses, and 18 daisies.