Thread: Why do 9+4 work? Why does it give you 6?

1. Why do 9+4 work? Why does it give you 6?

The question is:

How can you bring up from a river, exactly 6 quarts of water, when you have only two containers, a four-quart pail and a nine-quart pail, to measure with. I understand how to get the answer to this but my question is why do 9 quart and 4 quart pails work? Why does it give you 6 quarts when you solve this question?

2. Using the right combination $2\times 9 - 3\times 4$ works. But what are you really asking?

Do you want to know some combinations that don't work? Or you you looking for a generalisation?

3. Thank you for your time. Yes I am looking for a generalization if you have any thoughts.

4. this is like one of those "puzzle" problems. I assume all you have is one each 9qt and 4qt container.

fill 4qt ... dump into 9qt

fill 4qt again ... dump into 9 qt

fill 4qt again ... top off 9qt. this leaves 3 qts in the 4 qt container.

empty the 9qt ... pour the 3 qts into the 9qt from the 4qt container.

fill 4qt ... pour into 9qt. now have 3+4 = 7 qts in the 9qt container.

fill 4qt ... top off 9qt container. leaves 2 qts in the 4qt container.

empty 9qt ... pour the 2qts into the 9qt container.

fill the 4qt ... pour all 4 qts into the 9qt. 2 + 4 = 6 qts in the 9 qt container.

5. Originally Posted by loutja35
The question is:

How can you bring up from a river, exactly 6 quarts of water, when you have only two containers, a four-quart pail and a nine-quart pail, to measure with. I understand how to get the answer to this but my question is why do 9 quart and 4 quart pails work? Why does it give you 6 quarts when you solve this question?
One generalisation going along w/ skeeter's reply is: If you have two pails, one that holds x quarts where x is a positive integer, and one that holds kx + 1 quarts for k a positive integer, you will be able to measure n quarts for any n in {0, ... , (k+1)x + 1}.

6. This is wonderful. Thank you very much. This is what I was trying to understand.

7. Here's a generalization: Suppose you have two pails, one that can hold exactly $a$ quarts of water and another that can hold exactly $b$ quarts of water.
Furthermore, $a$ and $b$ are relatively prime and $a. In this case, you can measure out any integer number of quarts $0\leq n\leq b$ of water, in the $b$-quarts pail.

The way to do this parctically is described by the procedure skeeter gave.

8. Originally Posted by melese
Here's a generalization: Suppose you have two pails, one that can hold exactly $a$ quarts of water and another that can hold exactly $b$ quarts of water.
Furthermore, $a$ and $b$ are relatively prime and $a. In this case, you can measure out any integer number of quarts $0\leq n\leq b$ of water, in the $b$-quarts pail.

The way to do this parctically is described by the procedure skeeter gave.
I wanted to say this, but made a silly error mentally checking {9,5} and thought it somehow failed! Adding and subtracting single digit numbers can be challenging... especially late at night.

9. Hello, loutja35!

I too am puzzled by your question.
But I'll give it a try . . .

How can you measure 6 quarts of water, when you have only two containers:
a 4-quart pail and a 9-quart pail to measure with?

My question is: why do 9 quart and 4 quart pails work?
Why does it give you 6 quarts when you solve this question?

Answer: because a 4-quart pail and a 9-quart pail can be used
. . . . . . to produce any integer quantity from 1 quart to 9 quarts.

Let $A$ = 9-quart pail.
Let $B$ = 4-quart pail.

Fill $\,A.$
Code:
      *   *
|:::|
|:::|
|:::|   *   *
|:9:|   |   |     We have 9 quarts.
|:::|   |   |
|:::|   |   |
|:::|   |   |
*---*   *---*
A       B

Pour $\,A$ into $\,B.$
Code:
      *   *
|   |
|   |
|:::|   *   *
|:::|   |:::|     We have 5 quarts.
|:5:|   |:::|
|:::|   |:4:|
|:::|   |:::|
*---*   *---*
A       B

Empty $\,A.$
Code:
      *   *
|   |
|   |
|   |   *   *
|   |   |:::|
|   |   |:::|     We have 4 quarts.
|   |   |:4:|
|   |   |:::|
*---*   *---*
A       B

Pour $\,B$ into $A.$
Code:
      *   *
|   |
|   |
|   |   *   *
|:::|   |   |
|:::|   |   |
|:4:|   |   |
|:::|   |   |
*---*   *---*
A       B

Fill $\,B.$
Code:
      *   *
|   |
|   |
|   |   *   *
|:::|   |:::|
|:::|   |:::|
|:4:|   |:4:|
|:::|   |:::|
*---*   *---*
A       B

Pour $\,B$ into $A.$
Code:
      *   *
|   |
|:::|
|:::|
|:::|   *   *
|:8:|   |   |     We have 8 quarts.
|:::|   |   |
|:::|   |   |
*---*   *---*
A       B

Fill $\,B.$
Code:
      *   *
|   |
|:::|
|:::|   *   *
|:8:|   |:::|
|:::|   |:::|
|:::|   |:4:|
|:::|   |:::|
*---*   *---*
A       B

Pour $\,B$ into $A.$
Code:
      *   *
|:::|
|:::|
|:::|   *   *
|:9:|   |   |
|:::|   |:::|    We have 3 quarts.
|:::|   |:3:|
|:::|   |:::|
*---*   *---*
A       B

Empty $\,A.$
Code:
      *   *
|   |
|   |
|   |   *   *
|   |   |   |
|   |   |:::|
|   |   |:3:|
|   |   |:::|
*---*   *---*
A       B

Pour $\,B$ into $A.$
Code:
      *   *
|   |
|   |
|   |   *   *
|   |   |   |
|:::|   |   |
|:3:|   |   |
|:::|   |   |
*---*   *---*
A       B

Fill $\,B.$
Code:
      *   *
|   |
|   |
|   |   *   *
|   |   |:::|
|:::|   |:::|
|:3:|   |:4:|
|:::|   |:::|
*---*   *---*
A       B

Pour $\,B$ into $A.$
Code:
      *   *
|   |
|   |
|:::|   *   *
|:::|   |   |
|:7:|   |   |     We have 7 quarts.
|:::|   |   |
|:::|   |   |
*---*   *---*
A       B

Fill $\,B.$
Code:
      *   *
|   |
|   |
|:::|   *   *
|:::|   |:::|
|:7:|   |:::|
|:::|   |:4:|
|:::|   |:::|
*---*   *---*
A       B

Pour $\,B$ into $A.$
Code:
      *   *
|:::|
|:::|
|:::|   *   *
|:9:|   |   |
|:::|   |   |     We have 2 quarts.
|:::|   |:::|
|:::|   |:2:|
*---*   *---*
A       B

Empty $\,A.$
Code:
      *   *
|   |
|   |
|   |   *   *
|   |   |   |
|   |   |   |
|   |   |:::|
|   |   |:2:|
*---*   *---*
A       B

Pour $\,B$ into $A.$
Code:
      *   *
|   |
|   |
|   |   *   *
|   |   |   |
|   |   |   |
|:::|   |   |
|:2:|   |   |
*---*   *---*
A       B

Fill $\,B.$
Code:
      *   *
|   |
|   |
|   |   *   *
|   |   |:::|
|   |   |:::|
|:::|   |:4:|
|:2:|   |:::|
*---*   *---*
A       B

Pour $\,B$ into $A.$
Code:
      *   *
|   |
|   |
|:::|   *   *
|:::|   |   |
|:6:|   |   |     We have 6 quarts.
|:::|   |   |
|:::|   |   |
*---*   *---*
A       B

Fill $\,B.$
Code:
      *   *
|   |
|   |
|:::|   *   *
|:::|   |:::|
|:6:|   |:::|
|:::|   |:4:|
|:::|   |:::|
*---*   *---*
A       B

Pour $\,B$ into $A.$
Code:
      *   *
|:::|
|:::|
|:::|   *   *
|:9:|   |   |     We have 1 quart.
|:::|   |   |
|:::|   |   |
|:::|   |:1:|
*---*   *---*
A       B

We have devised a procedure to get 1, 2, 3, 4, 5, 6, 7, and 8 quarts.
. . The problem is completely solved.

10. Could you actually further explain your reasoning and how you decided on kx+1. What exactly does this stand for? Also how did you come up with (o,....,(k+1)x+1). How does this specifically work? Could you show me an exampe of this. As always, thank you very much!

11. Originally Posted by loutja35
Could you actually further explain your reasoning and how you decided on kx+1. What exactly does this stand for? Also how did you come up with (o,....,(k+1)x+1). How does this specifically work? Could you show me an exampe of this. As always, thank you very much!
For {9,4} note that at the beginning you fill the 4 quart pail to the top, so there are 4 quarts in it.

After topping the 9 quart pail off, you are left with 3 quarts in the 4 quart pail.

After topping the 9 quart pail off again, you are left with 2 quarts in the 4 quart pail.

After topping the 9 quart pail off again, you are left with 1 quart in the 4 quart pail.

This allows you to get any number of quarts in the 9 quart pail up to 9 quarts. (Think about why.)

Note that if the large pail has capacity of any number in the set {5,9,13,17,21,...} the effect is the same; we can get any number of quarts up to the capacity of the pail. (Think about why.)

Furthermore the same thing happens whenever the small pail is x and the larger pail is a (positive) multiple of x plus 1. (Think about why.)

Furthermore there is no need for the number of quarts left in the small pail to be the sequence x, x-1, ... , 1. As long as every number in {1, 2, ... , x} can be obtained in the small pail, any number up to capacity of large pail can be gotten in large pail. This is true if and only if gcd(x, y) = 1 where y is the capacity of larger pail.