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

 Weird function challenge (Posted on 2006-08-15)
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.

 See The Solution Submitted by JLo Rating: 4.3000 (10 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
 re: Possible solution? | Comment 23 of 33 |
(In reply to Possible solution? by Ken Haley)

Ken:

Wow!  I think you've got it!  You are one deep thinker!

The function you describe is strictly monotonic on [0,1] (if we define its value at 0 to be zero) .  Assuming that the greedy algorithm always terminates for rationals, then I agree that it is continuous for all irrationals and discontinuous for all rationals.  (It has a different left and right limit for rationals).

(Incidentally, I think that you can just interpret this as a base 2 number, if you like.  Base 3 is no longer needed.  Interpreting it as base 10 makes it even easier for me.)

So you have done it, except for 0 and numbers outside 0,1.
If you apply your function to the decimal part of x, and add in the sign(x) plus the whole number part of x, then you are done.
For instance, let your function be ww(x).
Then WW(0) = 0
WW(0.25) = 1+ ww(0.25)
WW(1)  =   2
WW(1.25) = 2 + ww(.25)
WW(-.25) = -1 + ww(.75)
At least, that's one way to fix it up.

Fantastic work, I think!

Now, I wonder whether JLo agrees, and what his solution is.

 Posted by Steve Herman on 2006-08-22 10:22:27

 Search: Search body:
Forums (0)