You have $100 with you and you have to buy 100 balls with it. 100 is the exact figure and you cant go below or above the numbers and you have to use the entire $100. If there is no kind of tax applied how many of each of the following balls will you be able to buy:
Green Balls costing $6
Yellow Balls costing $3
Black Balls costing $0.10
Now, how many of each must you buy to fulfill the condition given?
1 green ball = $6
29 yellow balls = $87
70 black balls = $7
Detailed Explanation :
Let us denote the number of balls to be brought with a variable
p = green sponges
q = yellow sponges
r = black sponges
Now using a simple expression:
p + q + r = 100
6p + 3q + 0.1r = 100
Multiplying the first equation by 6 then 3 and subtracting the two equations, we get:
6p + 6q + 6r = 600
3p + 3q + 3r = 300
3q = 500 - 5.9r
3p = 2.9r - 200
Usually, we have three equations to solve three variables. However, we will manage with just two here because we know that p and q are non-negative integers.
If 3q >/= 0, then 500 - 5.9r >/= 0.
Using this, r = 84.75.
Also, if 3p >/= 0, then 2.9r - 200 > 0. This implies that r >/= 68.97.
Now, the number of black balls must be an even dollar amount or we will land up with a fraction. Considering the expressions, you know that there can be just two integers that can satisfy the condition while lying in between 68.97 and 84.75.
If we take r as 80 and solve the equations (the last two equations), we will get p = 10.67 and q = 9.33. But p and q must be integer and not fraction. Thus you can cancel out 80.
If we take r as 70, we will get p = 1 and b = 29.
Therefore following are the number of balls that we must buy:
1 green ball = $6
29 yellow balls = $87
70 black balls = $7