# Measuring the amount of liquid in a container without a measuring tool [closed]

The Problem

Let's say you are asked to measure the amount of liquid in a container, but you are not allowed to use any direct measuring tool (such as a balance, ruler, or anything of the sort). You are however given an infinite number of equal containers to accomplish this task.

Note that you are not obliged to use the containers.

What is the most efficient solution/algorithm for this task, be it mathematical/chemical/mechanical/etc? Answers will be judged by efficiency and creativity.

An infinite amount of extra liquid is available.

The initial container might be of same size than the ones you can use, if that is a necessary parameter in your solution.

The volume of the containers given to you is known. It can be called x.

Solution scoring

The solution's worthiness will be primarily based on these two factors:

• Creativity of the solution (solutions that require outside thinking are welcome)
• Efficiency (how many tools are necessary, how long does it take, etc...)
• Can you clarify what would make a solution "efficient"? Are you measuring by time, number of containers, accuracy, etc.? Commented May 12, 2015 at 12:27
• Is extra liquid available?
– Bob
Commented May 12, 2015 at 12:28
• I'm assuming all the containers are the same size as the initial one Commented May 12, 2015 at 12:31
• This problem looks cool, but it will never survive the onslaught unless it is bounded really well!
– JLee
Commented May 12, 2015 at 12:31
• pour out the liquid. amount in container = 0
– Ewan
Commented May 12, 2015 at 15:35

I assume that no direct measurement may be made of the mystery flask, but that measurements may be made of liquid poured into the test flask.

1. Using your eyeball, partially fill a flask with a little less fluid than the mystery flask. Use a carefully measured amount.

2. Blow a controlled flow of air over both flasks to make them hum. (Hire a floutist if you must.)

3. Add known increments of fluid to the test flask. This will cause the pitch of the sound to change.

4. As the two flasks become almost identically full, the frequencies of the humming from both flasks will converge, causing a beat phenomena.

5. When the beat phenomena ceases, the frequencies are the same and the two flasks are equally full. (The human ear can detect very fine differences in frequency. This can be quite accurate.)

6. The original amount of fluid you put into the test flask plus the increments added equals your measurement of the amount of fluid in the second flask.

Make sure that all fluid is the same temperature.

• Awesome answer using the beat phenomena of adjacent frequencies. Your answer is no. 1 candidate for the moment :) Commented May 13, 2015 at 7:22
• Thanks! I guess that freshman course in Wave Mechanics is finally proving good for something! Commented May 13, 2015 at 12:03
• How are you going to measure: "known increments of fluid to the test flask"? With some other (small) test flask? Then, just fill "n" small test flasks (or "n" times a small test flask). Multiply n by the "small" amount and give that as the require answer. :(
– user12496
Commented May 16, 2015 at 0:49
• How would you have a "carefully measured amount" for the second flask or add "known increments" to it if you're not allowed to use any direct measuring device? Commented May 29, 2015 at 16:54
• I assumed that we were not permitted to use a direct measuring device on the test container, and did not. My direct measurement involved the fluid in the second container. Adding measured fluid does not require that I measured the fluid, just that I acquired measured fluid. Commented May 29, 2015 at 18:57

Assumptions:

• it is possible to "duplicate" a container by pouring liquid into an empty container until it has exactly as much liquid as the original.
• it is possible to "average" two containers by pouring liquid from the fuller one into the emptier one until they are even.

If we have these capabilities, we can perform a binary search.

1. Take a full container and label it "upper bound".
2. Take an empty container and label it "lower bound".
3. Duplicate "upper bound" and "lower bound", and average the two into a container labeled "median".
4. If the liquid in "median" is satisfactorily similar in volume to the container you're trying to measure, stop. Otherwise, continue with step 5.
5. Choose one of the containers: "lower bound" if "median" has less liquid than the container you're trying to measure, "upper bound" otherwise. Discard the liquid in the chosen container, and replace it with the liquid from "median".

At every point during this algorithm, the volume of the "upper bound" and "lower bound" and "median" containers are known exactly. When you stop, the initial container's volume is approximately equal to the "median" container's volume.

The definition of "satisfactorily similar" varies and is up to the experimenter. It could be "when I can no longer distinguish by eye the difference between the two containers" or "when I have spent an hour performing this algorithm" or "when my electron microscope verifies that the containers have exactly the same number of atoms".

Efficiency:

• For a reasonable amount of liquid (say, a cubic foot), takes about 11 iterations for sub-milliliter level precision, 90 iterations for atomic precision. For unreasonable amounts, it follows a logarithmic curve: 2 cubic feet takes 12 iterations, 4 cubic feet takes 13 iterations, 2^N cubic feet takes 11 + N iterations.
• Requires no more than five containers: the three labeled containers, plus two for duplication purposes.
• Uses approximately M*N*2 extra liquid, where M is the number of iterations performed, and N is the actual volume of the initial container.

Creativity:

• None. Binary search is a common approximation technique, and is as old as dirt.
• You do not need to discard the liquid in the wrong boundary container at each step. You can save it in an extra container and use it to fill the median bucket afterwards. I think that you need only N*4 extra liquid this way. However, you might need two extra buckets (maybe one is sufficient). Commented May 13, 2015 at 12:51

Step 1:

Fill as many of the containers as possible to the top from the initial vessel- this gives us a volume of x containers

Step 2:

Pour the remaining liquid into another container - all the liquid should now be out of the initial vessel.

Step 3:

Take one full container(a), the part-full container(b), and a number of empty containers(c).
Pour liquid from the full container (a) into an empty container (c) until c contains the same level of liquid as b.
Repeat with more empty containers until a is empty.

Step 4:

If necessary, repeat step 3, this time dividing the liquid in b so that it matches the level in c.
Continue this iteration until you reach a step where all of the containers taken at the start of a step contain the same amount of liquid.
Divide one of the a beakers to match the level of this final step - that gives you the denominator of the fraction of a beaker held in b.
Divide one of the b beakers (there should be at least one left from the first iteration) to match the same level. That should give you the numerator

Example:

e.g. if b contains 3/8 of a full container:

-A full cylinder (a) will fill 2 cylinders to 3/8 (b), and a third to 2/8 (c)

-b will fill 1 cylinder to 2/8, and another to 1/8 (d)

-c will fill 2 cylinders to 1/8

-a will fill 8 cylinders to the same level as d

-b will fill 3 cylinders to the same level as d

This tells us that we have 3/8 of a container's volume in b. We also (from step 1) have a number of completely filled containers. As the volume of these containers is known, that should give us the initial volume of the liquid

I'll work on making that explanation more coherent later. It does require that all the containers are the same shape as well as volume, though. It also requires that you can perfectly judge by eye whether the level of liquid in two containers is equal.

EDIT: If the initial volume is less than one of the measuring containers, then you'll have to start by completely filling an empty container with some of the infinite liquid

• "Pour liquid from the full container (a) into an empty container (c) until c contains the same level of liquid as b." How you will decide c has same level as b.? Commented May 12, 2015 at 13:11
• Via the highly scientific principle of holding them next to each other and hoping that it looks alright. This was before I saw that an infinite amount of extra liquid was available. That might change things. Commented May 12, 2015 at 13:19
• Or, simply compare both in a balance scale (as precise as needed). Or, is weighting "not allowed".
– user12496
Commented May 16, 2015 at 0:58

Dump the liquid out onto the floor. Your container now holds 0 liquid.

• Awesome answer, and nice "spoiler" tag :) +1 Commented May 13, 2015 at 7:17

The initial container is of same size as the ones I can use. This is a necessary parameter in my solution.

The volume of the containers given to me is known by someone. I am calling it x.

If the initial container is full, x is the solution. XD

• Nice :) Short and 100% accurate. Commented May 13, 2015 at 7:19

Given: unlimited containers, each of volume $x$; volume $v$ of liquid; unlimited additional liquid. In this answer, $x$ is unconstrained - it can be smaller, equal to, or even bigger than $v$.

Assumptions: you can accurately and repeatedly draw out volume $v$ of liquid from the additional supply; you will accept an answer of $v \pm \epsilon$ for some predetermined error margin $\epsilon$. If $v$ is not a rational number, then $\epsilon$ must be non-zero but can otherwise be as small as you like.

You can get an acceptable value of $v$ by repeating the following two steps until the error margin is satisfied. In the analysis that follows, let $c$ be the total number of containers used after $n$ iterations. Note that the last container used may be only partially filled.

1. Draw out $v$ of liquid from the additional supply.
2. Fill as many containers as possible from the liquid drawn in step 1, including topping up the partially filled container from the previous iteration.

Error bound

Without making any assumptions about being able to measure partly filled containers, all we can say after $n$ iterations is that the volume is between $c-1$ and $c$ full containers.

We have $(c-1)x < nv \leq cx$, that is, $$v \in (\frac{(c-1)x}{n}, \frac{cx}{n}] \tag{1}\label{1}$$ with the interval open at the bottom and closed at the top. Let $2\epsilon_n$ be the range of the interval, so $2\epsilon_n = \frac{x}{n}$. Rewrite $\eqref{1}$ to get the following. $$v = \frac{(c-0.5)x}{n} \pm \epsilon_n \tag{2}\label{2}$$

Volume calculation

At any iteration, if the last container used is full, $v$ is equal to the upper bound in $\eqref{1}$, so $v = \frac{cx}{n}$ and you're done.

Otherwise, the error is acceptable when $\epsilon_n \leq \epsilon$. Since $\epsilon_n$ decreases as the iteration count $n$ increases, the process is guaranteed to terminate with an answer of $v \approx \frac{(c-0.5)x}{n}$ from $\eqref{2}$.

Efficiency

The number of containers used is given by $nv \leq cx$ from the upper bound to $\eqref{1}$, so we will need at most $c = \lceil \frac{nv}{x} \rceil$ containers, with $n$ determined as follows.

The error will be within acceptable limits when $\epsilon_n \leq \epsilon$, so the number of iterations will be at most $n = \lceil \frac{x}{2\epsilon} \rceil$.

• Nice formalzation of the idea. I like the error value involved in the calculation. +1 Commented May 12, 2015 at 14:47
• Ooops, sorry. I posted a similar solution, well, based on the same concept, before reading yours. I didn't want the existing answers to affect my thinking. I believe such answer is still useful, but I can be easily convinced of the contrary.
– user12496
Commented May 16, 2015 at 20:27

Let me de-generalize the problem a little to give me a place to start. You are handed a one-litre container that is partially full and asked to determine, to an arbitrary accuracy, just how full it is (how much it contains.) You have a tap and a bunch of other identical one litre containers. It's not necessary for the containers to have any degree of symmetry as long as they are the same. The containers need to be translucent so you can see the level of the water in them.

(If the original container is not translucent, pour the water from the original container into one of the translucent ones before you begin. If the original container is larger than the one-litre containers, carefully fill one litre containers from it, keeping count, until you have an amount less than one litre in the last one, and use this process to establish that volume, then add the number of full litres you got as well.)

You fill one container and grab an empty one, then carefully pour from the full to the empty until the level in the one you're filling matches the level in the one you're pouring from. You now have 0.5 in each container. Compare to the reference container to see if x, the volume you're looking for, is more or less than 0.5. By eye you could probably have declared the volume to the nearest half, so this is presumably not super useful, but so be it.

Next, fill one container and then pour it carefully between 3 containers and compare to the reference volume. You now know whether x is between 0 and one-third, or one-third and one half, or one half and two thirds, or two-thirds and one.

Split one of the half full containers between two other empty containers so that you have quarters. (If pouring is becoming too much of a challenge when you get to fine accuracy, use a dropper or dip something in one container and let the drops fall into the other for the final balancing of levels between containers.) If x is more than 0.5, add a quarter to a half to get 0.75. Now you can narrow down the possible ranges of x to 0-0.25, 0.25-0.33, 0.33-0.5, 0.5-0.66, 0.66-0.75, and 0.75-1. If this is accurate enough, stop. If it is not, construct a 1/8th container by splitting a quarter, and add that eighth to whatever represents the bottom of the range you're considering. Say you know it's between 0.75 and 1 - add an eighth to that making 7/8ths or 0.875 and you'll know whether x is 0.75 to 0.875 or 0.875 to 1. If you only need to be accurate to one decimal place you can announce "0.8" or "0.9" and be correct.

If you need more accuracy, make sixteenths. And so on. At some point your ability to put two cylinders together and declare their volumes the same will put a natural limit on what you're doing. Also, the drops that cling to the sides when you pour from container to container will become relevant. Therefore this technique cannot produce arbitrary accuracy. I can overcome that by declaring I was actually using 100-litre containers (and some imaginary lifting help to let me pour among them) thus effectively dividing those effects by 100.

First disassemble some containers to produce cordage or (mass-less) rope;

construct two (frictionless) A-frames from more containers

fill one known volume container with liquid

attach to one end of the rope

attach the unknown volume to the other end

suspend the known volume container from the A-frame passing the rope over the other A-frame with the unknown container at the base

holding the rope between the a frame and a distance r* from the unknown container spin the unknown container horizontally around yourself. vary the velocity V** until the centripetal force exactly balances the weight of the known volume container.

Solve F = mg = M v^2/r to find the proportional mass of the unknown container and hence volume in x

*using your own height as an accurate measure

**count your heartbeats, like jason bourne

• I love this solution for its creativity +1 Commented May 13, 2015 at 7:12
1. fill all your liquid into containers until you get x full containers one which is not filled up to the top.
2. discard the full containers and note the number of filled conainers.
3. For a decimal scale fill 10 containers as high as the not fully filled one.

repeat the steps, for each repetition you get one digit of decimal precision, though it is much similliar to the binary search

I will assume that the containers are made of such material (e.g plastic), that I can make holes in them. All containers are of equal dimensions.

## 1) Make a water clock

Let's assume that we don't have any time keeping device. We take one container and make a small hole (using a pin) at the bottom (container T). The hole could be made such that we can count the falling droplets or in other words the droplets are sufficiently separated such that it can be counted with a naked eye. This will be our clock and the time will be the number of drops counted.

## 2) Make a liquid source at constant rate

This is assuming that the source of liquid is not already from some tap or any other constant rate liquid source. If this is the case then we can simply make one source which drops the liquid at constant rate by making a slightly bigger hole than the previous case as shown in the figure (container S).

## 3) Observe the timing

First place an empty container at C below S as shown in the figure and count the number of drops it takes to fill that container. Let $t_f$ be the time (no of drops) it takes to fill the empty container. Similarly let $t_p$ be the time it takes to fill the partially filled container with the unknown volume of liquid.

## 4) Calculate the unknown volume

The volume is directly proportional to the time it takes to fill the container. So, if $x$ is the volume of the container, then the unknown volume $v$ is given by

$$v = x\left(\frac{t_f-t_p}{t_f}\right)$$

• For point 1: the drop speed depends on the volume of liquid (pressure) left in the container, hence it is inaccurate. But your volume calculation by time is pretty cool. +1 Commented May 13, 2015 at 7:15
• Thanks. But I can maintain a constant pressure by keeping the container always full by pouring the liquid from top. Commented May 13, 2015 at 7:29

You are however given an infinite number of equal containers to accomplish this task.

Let's label these infinite containers C[1], C[2], C[3], ...

Pour some amount of liquid from the initial container into C[1]. The amount is not critical.

Set i = 1.

While true, pour the entire contents of container C[i] into container C[i+1] and increment i.

After this, the initial amount of liquid in the initial container is guaranteed to have been 1L at the outset.

The key to making this solution efficient, at least in terms of pouring operations, is realizing that the pouring step inside the while loop can be optimized away, leaving only the single pouring step at the outset. But don't optimize the whole loop away, or the final bit won't hold!

• Where do you get th 1L constant? Commented May 13, 2015 at 7:17
• @Pickle The joke is that you can never reach "after" an infinite loop, so it is mathematically valid to put any assertion there. Commented May 13, 2015 at 7:24

Assumptions:

• The problem is set in an Earth-like environment
• All containers are upright and have constant cross-section along their height
• The test liquid is in thermodynamical equilibrium with the surrounding atmosphere
• The liquid supply delivers liquid at the same temperature as the test liquid
• It is possible to fill a container to a fraction of $1/2^{n\text{th}}$ for any $n\in \mathbb{N}$ as per Kevin's assumptions

Idea:

Set yourself a limit of how accurate your measurement should be in units of $x$ and call the acceptable error $\varepsilon$.

Find the smallest $n\in\mathbb{N}$, such that $\varepsilon > 1/2^n$.

Pour the test liquid into a container and fill another container up to a fraction of $1/2^n$.

Wait until the liquid in one of the containers has fully evaporated.

If it is the one with $1/2^n$ filling status, refill it immediately, set aside an empty container as token, and wait again.

Otherwise, if it is the container with the test liquid, count the number of token containers. The test liquid had the volume of that number divided by $2^n$, multiplied with $x$.

I'll take advantage of a non-stated rule :-)

Which measuring unit should be used to state the result?

So, just:

Define a new measuring unit as the amount of liquid in the container. Done. The container has 1 container unit.

And then:

Let the scientists debate for years on how to reliably compare that unit to other measuring units.

Easy, (almost) no time at all. :)

• It appears as this answer does not seem so funny (as it was intended to be) to some people.
– user12496
Commented May 16, 2015 at 20:11
• So: vote this comment if you want this (funny) answer erased. :-)
– user12496
Commented May 16, 2015 at 20:12
• I actually like this answer :) Commented May 18, 2015 at 7:52
• @Pickle Thanks, your comment is appreciated. :)
– user12496
Commented May 18, 2015 at 8:02

Using only the items provided:

1. Take the container whose content is to be measured. Carefully crush it until it is full.

2. Choose a natural number $N$. Completely fill $N$ uncrushed containers using the crushed one, and note the number of times you had to pour as $P$.

Since we are not allowed measuring tools, we must define our own unit. With

1 $cu$ = The amount of liquid in one full unmodified container

then

The liquid to be measured is $\frac NP cu$, with a deviation of $\frac{0.5 \pm 0.5}{P} cu$.

• What do you mean by "crush? As I understand the meaning of the word, you would destroy the container, which would in turn not be able to hold any liquid :-( Commented May 18, 2015 at 10:01

Let me hack into the problem :-)

If it is valid to make an small hole in a container and place a feather there. You will have an excellent drop forming device.

Then:

Just count the drops.

Clearly:

An automatic electronic device to count drops would be an excellent help.

Ok. This one will meet all the intended rules. Lets call the volume in the container to be measured 𝝼 and the volume in each of the (many) measuring flasks 𝛘. I'll assume:

1. That there is a way (precise enough) to tell when a flask is exactly full (like the way a bottle reduces it's diameter when the liquid reach the neck).
2. There is a way to "reproduce" (i.e. copy) the amount of liquid in 𝝼. A balance scale used to compare (not measure) the amount of liquid will be a great help (if allowed).

Armed with those two assumptions perform this procedure:

1.- Reproduce 𝝼 in one or several 𝛘 containers (keep track of how many times this reproduction is performed as the number i).
2.- Fill (as exactly as possible) as many 𝛘 flasks as possible from 𝝼 (keep track of the count of flasks used as j).
3.- If the last 𝛘 flask filled from 𝝼 is exactly full: end.
4.- If the last 𝛘 flask is not full use it as the first one to fill on returning to step 1.

Consider this fact:

When i containers have "exactly" filled j flasks you have performed
some kind of l.c.m. of both 𝝼 and 𝛘. And then i*𝝼 == j*𝛘.

At the end, do the math:

𝝼 == (j/i)*𝛘 (as exactly as the error in filling flasks allow).

Assumption: I can make markings in the container(not using measuring materials).

Procedure

1. First fill all the containers you can. Then you will be left with a container which is not completely filled.

2. Then after that we make a mark in the container Z at the water level.

3. After that fill the container Z up to that mark.

4. Now try filling the other container's with the liquid of container Z.

5. Repeat 3 & 4 until you get a n'th container completely full.

So if the n'th containers get full by filling it up to m times then. And Initially we have k full containers. Then the volume will be $$k + n/m$$

For example:

Lets say that we have 5.7x of the liquid. We will know the 5 part but not the decimal part. So we will fill the container with the liquid with the 0.7th part and make a mark there. And now safely put that liquid in another container. We will then fill the container upto that mark and start filling the other empty containers we have. Then firstly we will have 0.7th of the first container filled. Then we will have 1.4th, 2.1th and so on to 7th, which we can tell by seeing as it will be completely full. And we would have required to fill the containers 10 times. So it will be 7x/10 times = 0.7x.

Used the fact that any decimal number when added it to itself many times will finally produce a natural number.

• Can you clarify the last sentences? Commented May 13, 2015 at 7:18
• thinnk. that you get to add 0.75 times the container of the liquid. Then you will add it to the other container. Then you will have 0.75 time container. And again add one more 0.75 containers, which way you will get 1 container full but you will have residue. Nw fill the residue in a new container. And when we have repeated till 4th time. We will have 3 containers full. So it will be 3/4 i.e 0.75 Commented May 13, 2015 at 8:48