Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Here's an excerpt from Spivak's Calculus, 4th Edition, page 96:

If we consider the function

$$ f(x)= \left\{ \matrix{0, x \text{ irrational} \\ 1, x \text{ rational}} \right. $$ then, no matter what $a$ is, $f$ does not approach an number $l$ near $a$. In fact, we cannot make $|f(x)-l|<\frac{1}{4}$ no matter how close we bring $x$ to $a$, because in any interval around $a$ there are number $x$ with $f(x)=0$, and also numbers $x$ with $f(x)=1$, so that we would need $|0-l| < \frac{1}{4}$ and also $|1-l| < \frac{1}{4}$.

How do I show that there is no condition that can meet the inequality $|0-l| < \frac{1}{4}$ and also $|1-l| < \frac{1}{4}$ ?

Thank you in advance for any help provided.

share|cite|improve this question
Think about it. The first says, $\ell$ is less than $1/4$ away from zero. The other says, $\ell$ is less than $1/4$ away from one. How can they both be true? – Gerry Myerson Jul 21 '13 at 9:01
up vote 3 down vote accepted

I’ll give you several approaches; all have their uses, though in this case the first seems much the simplest.

For any real numbers $a$ and $b$, $|a-b|$ is the distance between $a$ and $b$. If $|0-\ell|<\frac14$, then the distance between $\ell$ and $0$ is less than $\frac14$. Similarly, if $|1-\ell|<\frac14$, then the distance between $\ell$ and $1$ is less than $\frac14$. If I had such an $\ell$, $0$ and $1$ would be less than $\frac14+\frac14=\frac12$ units apart!

You can think of this in terms of open intervals: if the distance from $0$ to $\ell$ is less than $\frac14$, then $\ell\in\left(-\frac14,\frac14\right)$, and if the distance from $1$ to $\ell$ is also less than $\frac14$, then $\ell\in\left(\frac34,\frac54\right)$. Since these two intervals have empty intersection, this is impossible.

Alternatively, you can use the triangle inequality directly:


which is clearly absurd.

Finally, you can simply translate the absolute value inequalities into pairs of ordinary inequalities: $|a-b|<r$ says exactly the same thing as $-r<a-b<r$, so your hypotheses are that $$-\frac14<0-\ell<\frac14\quad\text{and}\quad-\frac14<1-\ell<\frac14\;.$$ Solve each for $\ell$:


which again is clearly impossible.

share|cite|improve this answer

Use triangular inequality. Suppose we could find such $l$, then $$1=|0-1|\le |0-l|+|l-1|<1/4+1/4=1/2,$$ which is impossible.

share|cite|improve this answer

When dealing with equations including absolute values, it's often convenient to rewrite them as equations without absolute values.

In your case, $$|0-l| < \frac{1}{4}$$ gives: $$-\frac{1}{4} < l < \frac{1}{4}$$

And $$|1-l| < \frac{1}{4}$$ gives: $$\frac{3}{4} < l < \frac{5}{4}$$

And now it's easy to spot the contradiction.

It's easy to sometimes overlook cases when rewriting absolute valued equations, but it's good practice.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.