All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Just Math > Calculus
Weird function challenge (Posted on 2006-08-15) Difficulty: 4 of 5
Find a function f:R->R (R the set of real numbers), such that

1. f has a discontinuity in every rational number, but is continous everywhere else, and
2. f is monotonic: x<y → f(x)<f(y)

Note: Textbooks frequently present examples of functions that meet only the first condition; requiring monotonicity makes for a slightly more challenging problem.

  Submitted by JLo    
Rating: 4.3000 (10 votes)
Solution: (Hide)
First solution (my original idea):
As is generally known, the set of all rational numbers Q is countable, so say Q={r1, r2,...}. Now define f as follows:

f(x) = sum 2-i, where we sum over all i such that ri<x

Obviously f is monotonic. It also has a jump discontinuity 2-i at every rational number ri. To see that it is continuous at every irrational number a, we have to find for every d>0 an e>0 such that from |x-a| < e follows |f(x)-f(a)|<d for all x. Let's do this:

First choose k such that sum 2-i (summing over all i with i>k) is smaller than delta. Now choose epsilon small enough, such that no rational number rj with j<=k is in the epsilon interval around a. Now |f(x)-f(a)| = sum 2-i (sum going over i such that a<=ri<x) < sum 2-i (sum going over i such that i>k) < d

Obviously the same approach works not only for the rational numbers, but for any countable infinite set of numbers. One can even prescribe arbitray jumps - we have chosen jumps 2-i - just as long as their sum converges in order to end up with something well-defined. Another choice of jumps that would work is e.g. the set of numbers p-2 with primes p.

Finally note that f(x) can be written as the infinite weighted sum of functions fr, where f(x)=0 for x<r and f(x)=1 otherwise: f(x) = sum 2-i fri, i.e. the desired function can be obtained by merely adding up the simplest monotonic functions one can think of.
Second solution (See Ken's and Steve's postings):
Ken found a wonderful monotonic mapping from ]0,1] which is discontinous in exactly the rationals by using egyptian fractions . I like this solution better than the one above, because it does not rely on a rather arbitrary counting of the rational numbers; it is somewhat more natural, except maybe for the fact that one has to pick an arbitrary base for the positional number system (binary, decimal,...). Stitching this solution up to cover the domain of all real numbers is a simple exercise. ************************************************
Can we have more than "only" a countable set of discontinuities?
It is a known fact that no monotonic function can have jumps on a non-countable set of numbers. The summation of a non-countable number of jumps would immediately make the whole thing infinite, so to speak... Not that this is a rigorous proof, but the correct proof follows this idea. It is not too tough if you want to give it a try.

By the way, the "w-function" that is mentioned in the postings is nothing but the inverse of the famous Cantor Function . (OK, maybe only kind-of-inverse...) I found it would be a useful example to study because it provides a first example of a function which solves the problem on a dense subset of all real numbers, namely the set of all numbers with finite binary representation.

Comments: ( You must be logged in to post comments.)
  Subject Author Date
re: FunctionSteve Herman2015-12-21 20:21:01
re: FunctionSteve Herman2015-12-21 20:21:01
SolutionFunctionMath Man2015-12-21 19:52:59
Nice work all, especially KenSteve Herman2006-08-27 17:57:19
Yet another solutionvswitchs2006-08-25 18:06:37
re(2): Nice solution!!! Now, you Want to try thisJLo2006-08-25 11:31:07
re: Nice solution!!! Now, you Want to try thisKen Haley2006-08-25 01:02:30
re: Nice solution!!! Now, you Want to try thisSteve Herman2006-08-24 23:00:08
Nice solution!!! Now, you Want to try thisJLo2006-08-24 18:00:36
re(2): Possible solution?Ken Haley2006-08-23 23:17:55
re: Possible solution?Steve Herman2006-08-22 10:22:27
Some ThoughtsPossible solution?Ken Haley2006-08-22 00:44:13
re(4): Oops... Maybe another hint?Ken Haley2006-08-22 00:22:12
re(3): Oops... Maybe another hint?Steve Herman2006-08-21 12:50:07
re(5): Oops... Oops myself...Ken Haley2006-08-20 23:54:30
re(4): Oops... Oops myself...JLo2006-08-20 14:18:06
re(3): Oops... Maybe another hint?Ken Haley2006-08-20 11:53:26
Hints/Tipsre(2): Oops... Maybe another hint?JLo2006-08-20 10:42:45
re(2): Oops...Ken Haley2006-08-20 09:15:10
re: Oops...Steve Herman2006-08-20 08:44:19
Oops...Ken Haley2006-08-20 00:39:50
re: Needless to say this is very confusingSteve Herman2006-08-19 18:34:11
QuestionNeedless to say this is very confusingCharlie2006-08-19 16:44:09
re(3): Bigger hint (and proposed problem redefinition)Steve Herman2006-08-19 12:35:47
re(2): Bigger hint (and proposed problem redefinition)Ken Haley2006-08-19 10:04:18
re: Bigger hint (and proposed problem redefinition)Steve Herman2006-08-19 08:24:30
Hints/TipsBigger hintJLo2006-08-18 18:36:17
re(3): Uncle! (1st condition satisfied)Bractals2006-08-18 11:25:20
re(2): Uncle! (1st condition satisfied)Steve Herman2006-08-18 10:32:52
Hints/Tipsre: Uncle! Don't give up yet!JLo2006-08-16 17:34:05
re: Uncle!Bractals2006-08-16 11:42:33
Uncle!Steve Herman2006-08-16 09:10:37
Awe and quibblesSteve Herman2006-08-15 10:02:07
Please log in:
Remember me:
Sign up! | Forgot password

Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (4)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Copyright © 2002 - 2019 by Animus Pactum Consulting. All rights reserved. Privacy Information