# How much red sand and how much blue sand?

This is a puzzle I remember arguing with my sister about when we were little...
(Not quite as loud (or as public!) as the Monty Hall argument we had.)

You have two large beakers of the same size.
Beaker A is half filled with blue sand.
Beaker B is half filled with red sand.

• You take a cup of blue sand from Beaker A and pour it into Beaker B.
• You mix up the contents of Beaker B until the colour is consistent.
• You take a cup of the contents of Beaker B and pour it into A.
• You mix up the contents of Beaker A until the colour is consistent.

Which is there now more of:

• Blue sand in Beaker B or
• Red sand in Beaker A?
• It is more interesting when you do not mix... Jul 1 '14 at 21:29
• Would like to see this posted on Mathematics StackExchange for a mathematical proof/answer to the question. Jul 2 '14 at 0:11
• @klm123 If I didn't say whether they are mixed or not, I think someone would have asked. When someone realises the solution, they will also see the difference between mixing and not mixing. (I think?)
– Ali
Jul 2 '14 at 11:29
• Now repeat the problem, but with beakers of Red and Blue pills that Morpheus gave you :-) Jul 2 '14 at 15:06

They are the same.

The solution is general:
1. Beakers can have different size.
2. You can either mix or not mix.
3. You can repeat the procedure N times.

You have the same amount of sand in each beaker at the beginning and at the end.
Therefore if Beaker A lacks X litres of blue sand then it has X litres of red sand instead. This means Beaker B lacks this X litres of red sand, they are replaced by X litres of blue sand, which we started our thinking from.

Here's a mathematical proof, as requested by Michael Lai above.

There is $x$ amount of blue sand in beaker A and $x$ amount of red sand in beaker B. You take $y$ amount of blue sand from beaker A ($y \leq x$) and pour it into beaker B and mix it up. Now beaker A has $x-y$ blue sand in it and beaker B has $x$ red sand in it and $y$ blue sand in it, all mixed up.

Therefore, beaker B is $\frac x{x+y}$% red sand and $\frac y{x+y}$% blue sand.

You now take $y$ sand from beaker B. Because of the percentages above, this sand will contain: $$y*\frac x{x+y}$$ red sand and: $$y*\frac y{x+y}$$ blue sand.

When we add that to beaker A, it now has: $$y*\frac x{x+y}$$ red sand while beaker B has: $$y-y*\frac y{x+y}$$ blue sand. This second formula simplifies to: $$y*(1-\frac y{x+y})$$ $$y*(\frac {x+y}{x+y}-\frac y{x+y})$$ $$y*(\frac {x+y-y}{x+y}$$ $$y*(\frac x{x+y})$$

This is the same as the amount above for the amount of red sand in beaker A.

No Mixing

For the general, no mixing proof, let's take what klm123 says above and apply formal mathematical language to it.

We have a total of $x$ blue sand and $x$ red sand. After an unlimited amount of exchanges (with or without mixing), if the two beakers have the same amount of sand in them they have both returned to $x$ sand.

Beaker A has $a_R$ red sand and $a_B$ blue sand. $a_R + a_B = x$. Similarly, Beaker B has $b_R$ red sand and $b_B$ blue sand. $b_R + b_B = x$

From the first equation above we can get $a_R = x-a_B$

Since the total amount of each color sand has not changed, we also know that $a_R + b_R = x$ and $a_B + b_B = x$. From the first of these two we get $a_R = x-b_R$.

Since $a_R = x-a_B = x-b_R$ then $a_B$ must equal $b_R$

Of course there's the philosophical question that if we mix the two sands together we no longer have red and blue sand but rather some type of purple sand, but that's silly.

• I don't understand why you need first part if second part (No mixing) completely includes it. Jul 2 '14 at 6:16
• You don't for this particular scenario, but it's sometimes informative to work out the specific scenarios as they can provide insight into other specific scenarios. For instance, if you decided to only put some of the sand back from Beaker B into beaker A and wanted to generate a conclusion comparing the amounts of sand, you would need to use the first approach. Jul 2 '14 at 7:40
• @Duncan The original substance was water and squash, but I thought I should go for sand because the grains would stay their original colour! Maybe blue and red marbles would have been even better? :)
– Ali
Jul 2 '14 at 11:20

Initially, let V be the volume of a beaker occupied by sand, and let B refer to blue sand and R to red sand. The situation is like this:

                  ┌───────────────┬────────────────┬───────────────┐
│    Beaker 1   │     Outside    │    Beaker 2   │
┌─────────────────┼───────────────┼────────────────┼───────────────┤
│ Occupied volume │       V       │        0       │       V       │
│ Mass blue sand  │       Mb      │        0       │       0       │
│ Mass red sand   │       0       │        0       │       Mr      │
└─────────────────┴───────────────┴────────────────┴───────────────┘


Taking 1 cup of volume Vc from beaker 1

                  ┌───────────────┬────────────────┬───────────────┐
│    Beaker 1   │     Outside    │    Beaker 2   │
┌─────────────────┼───────────────┼────────────────┼───────────────┤
│ Occupied volume │      V-Vc     │        Vc      │       V       │
│ Mass blue sand  │   Mb(V-Vc)/V  │     Mb*Vc/V    │       0       │
│ Mass red sand   │       0       │        0       │       Mr      │
└─────────────────┴───────────────┴────────────────┴───────────────┘


Pouring the cup to beaker 2 and mixing, assuming additive volumes,

                  ┌───────────────┬────────────────┬───────────────┐
│    Beaker 1   │     Outside    │    Beaker 2   │
┌─────────────────┼───────────────┼────────────────┼───────────────┤
│ Occupied volume │      V-Vc     │        0       │      V+Vc     │
│ Mass blue sand  │   Mb(V-Vc)/V  │        0       │    Mb*Vc/V    │
│ Mass red sand   │       0       │        0       │       Mr      │
└─────────────────┴───────────────┴────────────────┴───────────────┘


Taking 1 cup of volume Vc from beaker 2

                  ┌───────────────┬────────────────┬───────────────┐
│    Beaker 1   │     Outside    │    Beaker 2   │
┌─────────────────┼───────────────┼────────────────┼───────────────┤
│ Occupied volume │      V-Vc     │       Vc       │       V       │
│ Mass blue sand  │   Mb(V-Vc)/V  │ Mb*Vc²/V(V+Vc) │  Mb*Vc/(V+Vc) │
│ Mass red sand   │       0       │  Mr*Vc/(V+Vc)  │  Mr*V/(V+Vc)  │
└─────────────────┴───────────────┴────────────────┴───────────────┘


Pouring the cup to beaker 1 and mixing, again with additive volumes,

                  ┌───────────────┬────────────────┬───────────────┐
│    Beaker 1   │     Outside    │    Beaker 2   │
┌─────────────────┼───────────────┼────────────────┼───────────────┤
│ Occupied volume │       V       │        0       │       V       │
│ Mass blue sand  │  Mb*V/(V+Vc)  │        0       │  Mb*Vc/(V+Vc) │
│ Mass red sand   │  Mr*Vc/(V+Vc) │        0       │  Mr*V/(V+Vc)  │
└─────────────────┴───────────────┴────────────────┴───────────────┘


This time the math was a bit more difficult to do mentally. This is the mass of blue sand in beaker 1:

$M_b \frac{V-V_c}{V} + M_b \frac{V_c^2}{V(V+V_c)} = M_b \frac{V^2-V_c^2}{V(V+V_c)} + M_b \frac{V_c^2}{V(V+V_c)} = M_b \frac{V^2}{V(V+V_c)} = M_b \frac{V}{V+V_c}$

Beaker 1 ends up having $M_r \frac{V_c}{V+V_c}$ mass of red sand.
Beaker 2 ends up having $M_b \frac{V_c}{V+V_c}$ mass of blue sand.
So it depends.

• If blue sand is more dense than red sand, i.e. $M_b > M_r$,

Then beaker 1 has less mass of red sand than beaker 2 has of blue sand.

• If blue sand is as dense as red sand, i.e. $M_b = M_r$,

Then beaker 1 has the same mass of red sand than beaker 2 has of blue sand.

• If blue sand is less dense than red sand, i.e. $M_b < M_r$,

Then beaker 1 has more mass of red sand than beaker 2 has of blue sand.

Other answer say the amount of sand is the same because they suppose the densities are the same, or because they compare volumes instead of masses.

We have an amount of red sand $R$ and an amount of blue sand $U$. $R$ does not have to be equal to $U$.
We pour our sand in two beakers, so that beaker A contains all the red sand and beaker B contains all the blue sand. This means we have a volume $A$ in beaker A equal to the volume of red sand $R$, and volume $B$ in beaker B equal to the volume of blue sand $U$. \begin{align} A & = R \tag{1} \\ B & = U \tag{2} \end{align}

First we move an amount of red sand $r_1 \le R$ from beaker A to beaker B. The (now changed) volumes of the beakers are: \begin{align} A^\prime & = R - r_1\\ B^\prime & = U +r_1 \end{align}

Then we move an amount of sand back from beaker B to beaker A restoring them to their original volumes. The moved sand may include some blue sand $u \le U$ and some red sand $r_2 \le r_1$. \begin{align} A & = R - r_1 + u + r_2 \\ B & = U + r_1 - u - r_2 \end{align}

If we define the total amount of red sand displaced, $r$, as $r = r_1 - r_2$ (the amount of red sand moved initially minus the amount of red sand moved back on the second move), we see that: \begin{align} A & = R - r + u \\ B & = U + r - u \end{align}

But now we remember $(1)$ and $(2)$. \begin{align} R & = R - r + u \\ U & = U + r - u \\ & \implies \\ r & = u \end{align}

So we see that, as long as we restore both to their original volumes, the amount of red sand in beaker B is the same as the amount of blue sand in beaker A.

A simple scenario to show that you can have equal parts of blue and red sand in both beaker:

• If the cup size is the same the the beaker size then you are essentially combining equal parts of blue and red sand (by taking everything from one beaker and putting it into the other) and then splitting them apart equally (by taking half of the evenly mixed sand in one beaker and putting it back in the other beaker).

To show that this holds regardless of the beaker and cup size (unless the cup volume is bigger than a beaker):

Example: Beaker A and B can hold 18 units of volume, and cup C holds 1 unit of volume, so a half full beaker will hold 9 units of volume.

• Beaker A (9 units of blue sand), Beaker B (9 units of red sand)
• Beaker A (9 units of blue sand + 1 unit of red sand), Beaker B (8 units of red sand)
• Beaker A ((9 units of blue sand - 0.9 units of blue sand) + (1 unit of red sand - 0.1 unit of red sand), Beaker B (8 units of red sand + 0.1 units of red sand + 0.9 units of blue sand)
• Beaker A (8.1 units of blue sand, 0.9 units of red sand), Beaker B (8.1 units of red sand, 0.9 units of blue sand)
• As long as the quantity ending in each beaker is the same as the starting quantity, you wind up with the same amount of red sand in the blue beaker as blue sand in the red beaker. The argument doesn't depend on the beaker size, just the equality of start and end volumes. Jul 2 '14 at 0:51
• Sorry, you are correct. When you write it down on paper instead of working in your head it is a little bit more clear. Jul 2 '14 at 1:07