Valentine’s day is upon us, and this is a great opportunity to finally write about a problem that has greatly disturbed me for many years. I’m sure you have all experienced this problem before – and it is certainly an annoying one.

It’s a fine evening, and you and your eternal love have decided to take a romantic walk outside in the cool night air. Hugged together and enjoying each other’s presence, an immense sense of satisfaction overcomes you. Could there be anything better in life? Certainly. Because there is one issue which keeps you from blessed comfort – you are walking out of sync. When your partner lifts his/her foot, you have just stepped down. When you step forward, he/she has just retracted the leg. So instead of walking in pace, the fact that you are hugged together makes you look like a pair of limping, waddling ducks. Hurray for romance.

You may have started together, but somewhere along the way, synchronization was lost. You are both quite sure that if only you stepped at the same time just once, everything would be alright, and you would be able to coordinate your pace from there on. Of course, it requires dexterous footwork in order to synchronize while in mid-walk, and it also looks ridiculous from the outside, so switching your legs or doing any footwork while striding is out of the question. No, you are going to have to wait until your footsteps naturally fall at the same time in order to synchronize.

If the time between each step were of integer size, and you started together at the same time (same split), then it would be quite easy. If your partner’s step time is , and your step time is , then after steps at most you would make a simultaneous step.

But what if you didn’t start out at the same time? Or worse yet, knowing how crazily and illogically love makes youngsters act, what if the both your and your partner’s step size is irrational? Is it even guaranteed that your footsteps will ever meet, or are you doomed to an entire night’s worth of out-of-sync walking?

Unfortunately for you, meeting your footsteps precisely with irrational step size is generally impossible. If your partner’s step size is , and your step size is , both of which are irrational, and is also irrational, then there is no such pair of numbers m,n such that .

However, it turns out that if you are not searching for maximum precision, a compromise can be made, and there exist numbers n,m such that for any as small as you choose. So if you can synchronize your steps if they match only by a number as small as , you will be able to correct your pace. Neat!

Thus, even if both you and your lover are irrationally in love, assuming you are willing to tolerate a bit of imperfection with each other, you can keep walking in harmony, and enjoy your romantic journey.

For the mathematically inclined amongst us, here is the proof of the above statement. It is not my original research; this is a known problem, which I have first encountered in high school, although in another, less love-stricken form. The proof is taken from the site TopologyAtlas.

We want to show that for every two positive irrational numbers, , there exists two positive integers m,n, so that . Without loss of generality, we can assume that our partner’s step size is 1, and therefore our own step size is . This is still an irrational number, so we will rename it back to . We restate the above as:

cannot be an integer, so it has a fractional part. Setting m to the whole part of , we only need to prove that there always exists an n so that the fractional part is smaller than .

The proof is as follows:

Let m,n be two different integers, and an irrational number. The term frac(x) means “the fractional part of x”, and will be denoted by .

We note that . Why must this be? If , lets see what happens when we subtract from .

The left side of this equation would be an integer, since the fractional parts are the same. However, the right part is irrational, since is irrational and m-n is not. This is a contradiction, and hence the fractional parts are not the same.

This means that the set contains infinitely many members – one for each integer.

Since , we can divide the region [0,1] into segments of length . If is not an integer, that’s alright – the last segment will be a little smaller than . All the points in the set D are contained within the region [0,1], and each falls into one of the segments. Since there is a finite number of segments, but an infinite number of points in D, by the pigeonhole principle we get that there is at least one segment, which has at least two points that fall into it. Since the length of each segment is , the distance between these two points is smaller than . Mathematically, we can always find two integers, m,n, such that:

Lets arbitrarily choose that m > n.

Now, what is the fractional part of a number, {x}? It is the number itself, minus its whole part.

(The floor function, , gives the largest integer which is not larger than x).

Lets put that in the equation above:

.

Since m > n, then m-n > 0, and also . We can therefore give these two some convenient names. Lets define the integers:

This reduces us to:

Hurray! We have now solved what we wanted to solve in the first place – compare this equation with the one we used to formulate our problem. We have satisfied the walking needs of your and your lover.

For the even more mathematically inclined amongst us, we will now continue with the proof of a stronger statement, about the density of irrational multiples.

The above statement – proving that there always exist p,q, so that , is part of a larger proof, of a stronger statement. The stronger statement is that the fractional part of is dense in the region [0,1]. “Dense”, in this case, means that for any number x in the region [0,1], there exists an m so that . In plain English, it means that for any number x we choose in [0,1], we can find an m so that the fractional part of is as close to x as we like.

So lets continue from where we left on. We assume that , so we can open the absolute value without worrying too much. We also note two things:

First, since , and q is integer and is smaller than 1, it means that is smaller than .

Second, a word about the fraction function. If , then . To see why this is, look at the left hand term, and remember that has a fractional part and an integer part. We multiply both of them by k. The integer part doesn’t matter to us, since we are inside the frac function. The fractional part, which is will not be rounded off when we multiply it by k, unless it is larger than than .

Let us mark by N the largest integer such that . We can now construct a series in the following manner:

Since , the distance between each one of these is the same, and is equal to .

Lets divide the region [0,1] into N+1 segments. The first N segments will each be of the size , starting from 0. The last segment will be what remains, which is from to 1.

Now we will prove the density. Take any number x in [0,1]. If this number is inside any of the first N segments, then we are done, because the length of each segment is , and we have seen earlier that it is smaller than .

What if x is in the last segment? A little basic algebra will help. We have said that N is the largest number such that . This inherently means that . Multiplying both sides by N, we get:

Subtracting both terms from 1 (note the reversal):

In English – the distance between and 1 is smaller than . But that distance is exactly the length of the last segment. Since it is smaller than , is it also smaller than , which in turn, is smaller than , and we are done.