Given two blank rulers, measure any length

Say, you are given ruler $A$ of length $72.84 \text{ cm}$ and ruler $B$ of length $86.63\text{ cm}$. Neither of them have any marking/gradation of any sort on them. They are blank, except for their total length written on them.

Using only A and B, can you measure a length of $31.23\text{ cm}$?

Also, is it possible to generalize this concept further?

That is to say:

Given any two blank rulers, measure any given length.


Solution 1:

Yes. It is Possible

Here's a useful fact: If $a$ and $b$ are integers with $\gcd(a,b) = d$, then there exist integers $x$ and $y$ such that $ax + by =d$. In fact, one can compute exactly what $x$ and $y$ are by the extended Euclidean algorithm.

In this case, we have $$ 3539 \times 8663 - 4209 \times 7284 = 1$$

Or, $$ 3539 \times 86.63 - 4209 \times 72.84 = 0.01 $$

So, in theory, you could measure $0.01$ cm by marking off $3539 \times 86.63$ cm along a line, and then marking off $4209 \times 72.84$ cm along the same line; the difference in the markings will be $0.01$ cm.

Of course, now that you can measure $0.01$ cm, you can measure any multiple thereof.

For your generalization, given two blank rulers, you can measure any length that is a multiple of the gcd of their lengths. (Make sure you choose units where the lengths of the rulers are integers. Here, we chose 0.01 cm)


Edit: As noted by Silverfish in the comments, the interesting fact I mention above is Bézout's identity

Solution 2:

This all boils down to (using 0.01 cm as the unit) as

Does $\gcd(7284,8663)$ divide 3123?

The answer is yes: the gcd turns out to be 1. The generalisation is obvious: two blank rulers of lengths $a$ and $b$ units ($a,b$ are natural numbers) can measure any length that is a multiple of $\gcd(a,b)$ units.