Kevin B. answered 03/26/24
Experienced high school tutor specializing in CS and Math
When dealing with problems regarding things coming in and things coming out, I like to consider what's known as the "net" quantity. We know how much water is coming in, and we know how much water is coming out, so the question to really answer here is "how much is the water actually changing by".
Here's the math
water_in + water_out = water_net
We know that the rate of filling, multiplied by time, gives us the total volume of water that has been dumped into the tank, so:
water_change * time = total_water_in_the_tank
We can represent "total_water_in_the_tank" as a percentage of the tank being filled, so:
water_change * time = percentage_of_water_in_tank.
And then using the fact that it takes 6 minutes to fill this tank, and 8 minutes to empty this tank. We can compute substitute 1 for percentage_until_filled (1 is the numerical representation of 100%). and then solve for water_in like so:
water_in * 6 = 1
water_in = 1/6
Since water_out represent the "negative" change in the total_water in our tank, we put a negative for 1 which give us:
water_out * 8 = -1
water_out = -(1/8)
Then, our net change would be
1/6 + (-1/8) = 1/6 - 1/8
8/48 - 6/48 = 2/48 = 1/24
The last step is to compute the time it takes to fill a tank, so
water_change * time = 1
1/24 * time = 1
time = 24 minutes
It'll take 24 minutes to fill this tank!