Wikipedia:Reference desk/Archives/Mathematics/2014 March 23

= March 23 =

Odd function, possible to define cleanly?
In thinking about Monotonic functions, I was wondering if it was possible to get a function that wasn't monotonicly increasing or decreasing in any subinterval. In other works, for this function f, that for all a and b in the domain in f, that there exists a c, such that f(c) is either greater than both f(a) and f(b) *or* f(c) is less than both f(a) and f(b). Also, can this function be continuous?Naraht (talk) 22:52, 23 March 2014 (UTC)
 * The constant function f(x)=0 is not monotonically increasing or decreasing, and in fact is not strictly increasing or decreasing at all. However, I don't think a function you describe (with those inequalities) can be continuous because every continuous function must obey the intermediate value theorem, which would preclude your property from holding on at least some finite interval. Another way to look at it (if f is differentiable) is that the derivative must be zero at every point where f is not monotonically increasing or decreasing, and the constant function is the only function with that property for all x. As said before, the constant function is not strictly increasing or decreasing anywhere.--Jasper Deng (talk) 00:48, 24 March 2014 (UTC)
 * OK, that makes sense. Does this give us any information on how to construct a function which is discontinuous?Naraht (talk) 01:50, 24 March 2014 (UTC)
 * The "in other words" bit is incorrect: being non-monotonic is not the same as that for every interval, some value of the function in the interval falls outside the range of its endpoints, only that every interval contains both increases and decreases. Ignoring that, real functions clearly exist for which there exists no interval on which it is monotonic.  Example: The indicator function that selects rational numbers.  The second question is tricker: does a continuous version of such a function exist?  Yes, but I expect it to inherently be a fractal function.  An example would be to take the function y=x over the domain $[0,1]$, divide the domain into thirds, and replace the line with three lines in a zig-zag of lines going from (0,0) to (1/3,3/2) to (2/3,1/3) to (1,1).  Recursively replace every segment with a scaled version. This will be non-monotonic on every subinterval while being continuous, but will have subintervals for which the endpoints are both the minimum and maximum for the interval. —Quondum 02:13, 24 March 2014 (UTC)
 * Such continuous functions do exist, and are widely used. The classic example is the Wiener process. The study of such processes is of great importance in finance, physics and engineering. I should note that Quondum is correct in his comments on your "in other words...". It's not obvious to me that the type of function you require will always be fractal if it is to be continuous: I suspect that it is possible to construct a function that matches your criteria that is almost everywhere not self-similar, though I don't have a definition of such a function available - it would require some careful fiddling around to construct. Finally, it should be obvious that a function meeting your criteria can't be everywhere differentiable (follows instantly from your definition). RomanSpa (talk) 16:31, 24 March 2014 (UTC)
 * My use of the term fractal does need to be interpreted widely; statistical self-similarity must be included. Nevertheless, is probably better to ignore my mention of fractal due to my use thereof being ill-defined. —Quondum 18:46, 25 March 2014 (UTC)
 * The Weierstrass function is an example of continuous a function that is not monotonic on any interval. I guess you can prove using a Baire category argument that "most" continuous functions are nowhere monotonic. —Kusma (t·c) 20:59, 24 March 2014 (UTC)


 * The construction of the Blancmange curve is interesting, in that it's almost designed to fit the OP's request. The pictures give a pretty good sense of how it works, even if one doesn't want to wade through all the series descriptions. Also, Pathological_(mathematics) may be of interest, along the lines of Kuma's last sentence. SemanticMantis (talk) 21:18, 24 March 2014 (UTC) EDIT: Sorry, I was speaking from memory. I am now not sure if the Blancmange curve is nowhere monotone... SemanticMantis (talk) 21:26, 24 March 2014 (UTC)
 * The Weierstrass function is almost *exactly* what I was looking for, except, it only has that characteristic in finite ranges (say 0-2), but "stretching" that out shouldn't be that difficult.Naraht (talk) 14:36, 25 March 2014 (UTC)
 * Huh? It seems to fit your requirement that it be continuous and nonmonotonic on every subinterval of the entire domain.  That it is a periodic function does not change this.  —Quondum 18:46, 25 March 2014 (UTC)
 * Hmm. you are right on that one. I think however if it was *stretched* you would end up with a function where for every pair of values a & b, there would exist c1 and c2 such that f(c1) > f(a) and f(c1) > f(b) and f(c2) < f(a) and f(c2) < f(b) which is more strongly wierd in that regard.Naraht (talk) 10:27, 26 March 2014 (UTC)
 * I dont think you can build this. Im thinking that the set of maxes in a Weiner process looks like a cantor set.  So give me your function, I take an arbitrary point in the interior of the domain.  Take a small neighberhood around this point and find a st f(a) is the max of the function in that neighberhood.  Do the same for the min, and call it b, f(b) is min.  Despite the fact that the function is nowhere monotonic, you cant find the c that you want.  Sorry for the language, Im tired and I have not done this type of math in a loong time. Hope Im not wrong... Brusegadi (talk) 04:37, 28 March 2014 (UTC)
 * I agree with Brusegadi on this, no continuous function exists that has this "strongly weird" property, continuous or otherwise, if you require it either to be bounded or to be merely defined on any continuous portion of the real domain . —Quondum 05:09, 28 March 2014 (UTC)
 * This feels rather weird, but I'm becoming convinced that almost-nowhere-continuous functions defined on every real number exist that fit the bill for both these requirements: (a) nowhere-monotonic, (b) "strongly weird" in the sense that the function takes on values on any interval that are both greater and smaller than the function's value on any point in the interval (or if you prefer, than its value any point, or indeed, than any real number). This is because it is possible to have a function that has no maximum or minimum value, whether the function's value is bounded or not. —Quondum 16:40, 28 March 2014 (UTC)
 * For any rational r, there are unique integers a, b such that b > 0, r = a / b, and gcd(a,b) = 1.  (For r = 0 agree to choose (a,b)=(0,1).)  Call this the canonical rational form.
 * Modify the rational indicator function as:
 * $$f(x) :=

\begin{cases} ( -1 )^b ( b ) &\text{if } x \in \mathbb{Q}, \\ 0 &\text{if } x \notin \mathbb{Q}. \end{cases} $$ where x = a / b in canonical rational form.
 * This function is "strongly weird", but it is also unbounded on every interval of non-zero width. Tweak this to:
 * $$g(x) :=

\begin{cases} ( -1 )^b ( 1 - 1 / b ) &\text{if } x \in \mathbb{Q}, \\ 0 &\text{if } x \notin \mathbb{Q}. \end{cases} $$ where x = a / b in canonical rational form.
 * This function is "strongly weird" and bounded, though continuous nowhere.
 * Finally, sin(x) ⋅ g(x) is "strongly weird", bounded, and continuous almost nowhere.
 * Is this the sort of function you were thinking of, ? -- ToE 02:30, 1 April 2014 (UTC)
 * It seems like you archived the thread shortly after ToE added the above. A buggy bot?
 * Yes, these are examples of what I had in mind. As you can see from my strikeout above, it took me a little while to figure that out.
 * You may be interested in a specific construction, though as I indicated, it doesn't seem that you can have a "strongly weird" continuous function, though it sounded like you might have been after one. —Quondum 03:46, 1 April 2014 (UTC)
 * g(x) looks very interesting. I'm not sure why multiplying it by sin(x) gives a function which is actually continuous any point though.Naraht (talk) 10:10, 2 April 2014 (UTC)
 * At the points where sin(x) is zero, the resulting function is continuous: at those points and only those points . I expect it was precisely to illustrate this that it was given. From the definition of a continuous function, you'll see why. At these points, the function has a limit, and its value here is equal to this limit. —Quondum 03:41, 3 April 2014 (UTC)
 * Yes. Also, I just discovered the related Thomae's function. -- ToE 04:07, 3 April 2014 (UTC)
 * Neat, nearly what you proposed. And oops, my claim of continuous only there is nonsense, looking at what you linked to. My brain is clearly in "sloppy thinking mode". —Quondum 04:56, 3 April 2014 (UTC)
 * No, you were right (or I don't follow you). Thomae's function is f(x)=1/q for rational x=p/q in lowest terms, f(x)=0 for irrational x.  It is continuous only at all irrationals (very neat idea) because for a small enough neighborhood about an irrational, all the rationals will have a large enough denominator.  It is not "strongly weird" (or even half-"strongly weird").  To achieve that, my function had to tend away from zero for rational with larger denominators, so it takes the bounded form (what I originally called g(x)) multiplied by a function which vanishes at point in order to bring about points of continuity. -- ToE 06:26, 3 April 2014 (UTC)

These put the 'fun' in 'functions'. I see now why multiplying by sin brings a local continuity. Naraht (talk) 14:13, 3 April 2014 (UTC)
 * Yes, these explorations can be quite an eye-opener; one has to keep alert, because the unexpected pounces on you all the time.
 * ToE, your function shares a lot of similarity with Thomae's function, and in particular, its being zero at irrational x. I had simply failed to keep than in mind, which makes my reasoning (which I did not share) nonsense, even if the conclusion might be valid. I've become lazy: I use high-level arguments and sometimes fail to check the lower-level detail adequately. You quite cleverly turned the function around, and on rethinking it, I think you're right that your g(x) is everywhere discontinuous, even though as with Thomae's function, your f(x) appears to be continuous at every irrational x. But by now I'm being cautious about making brash claims about properties of functions... —Quondum 18:59, 3 April 2014 (UTC)