78 points · by gballan · 12y ago · 43 comments
Anyway, I played the output of that script through some filters, and this sounds nice:
play -c 2 weierstrass.wav gain -12 loudness chorus 0.5 0.9 50 0.4 0.25 2 -t 60 0.32 0.4 2.3 -t 40 0.3 0.3 1.3 -s reverb gain 12
This will sound quite interesting, but it's a really bad approximation of the Weierstrass function! http://www.wolframalpha.com/input/?i=sin%28x%29+%2B+0.9*sin%...
This is why images get blurry when resized up! For some reason better algorithms never seem to become popular.
To me, the canonical example of a continuous but nowhere differentiable function is: any Brownian motion sample path.
Which, like the Weierstrass function, illustrates that functions that look simple may be so weird that our standard intuition does not apply.
Almost any. Although they have probability zero of actually occurring, a Brownian motion can generate a continuous path.
Nitpicky, but this is a comment thread about math.
What you meant to say is that on a set of measure zero, the paths can have points where continuity is not satisfied. But you did not say that.
In any case, the version of Brownian motion I studied was the version that excludes this null set. ;-)
Take the typical random walk construction as the limit of a piecewise continuous curve. I.e., 50% chance of being y=x, 50% chance of being y=-x on [0,1], then subdivide. With zero probability, the walk can converge to a straight line x=t, which is certainly differentiable.
It's early in the morning and I had no caffeine.
>The function has detail at every level, so zooming in on a piece of the curve does not show it getting progressively closer and closer to a straight line. Rather between any two points no matter how close, the function will not be monotone.
[1] http://en.wikipedia.org/wiki/Dirichlet_function [2] http://en.wikipedia.org/wiki/Thomae%27s_function
John McCarthy (yes, the inventor of Lisp) has a simpler to analyze construction of a Weierstrass-like function from a triangle wave:
http://www-formal.stanford.edu/jmc/weierstrass/weierstrass.h...
Here's the big picture. When you analyze variations in f at the kth scale by setting |dx| = 2^(-2^k), the only term that really contributes is the kth term, 2^(-k) g(2^(2^k) x), since the higher terms completely vanish and the lower terms are insignificant by comparison. Thus a difference quotient df/dx at the kth scale is very nearly the derivative of 2^(-k) g(2^(2^k) x), which is just +/- 2^(-k) 2^(2^k). This has unbounded magnitude as k increases (the exponential term 2^k outgrows the linear term -k). For a differentiable function the rate of variation should settle down at finer scales. Instead of settling down at finer scales, McCarthy's function actually gets progressively more jagged.
If you want to grok the details, step 3 in his proof may be too terse. When bounding max(n < k) |dg(2^(2^n) x)|, he uses that the greatest variation in g occurs when x and x+dx are on the same line segment. The max slope of any g(2^(2^n) x) for n < k occurs when n = k-1 and is +/- 2^(2^(k-1)). Hence
max(n < k) |dg(2^(2^n) x)| <= 2^(2^(k-1)) |dx| = 2^(2^(k-1)) 2^(-2^k).they nowhere "differentiable" in classic, smooth sense - ie. no tangent affine bundle of _whole_ dimension exist, ie. nowhere a tangent line (less tangent plane, etc...) exists. That isn't surprising of course and obviously calls for extended notion of differentiability - like a tangent "bundle" of non-whole, fractal dimension. One can even imagine a Taylor/power series using such differentiability...
Personally I think the cool thing about these(and also fractals, which display this as iterations go to infinity) is that they have infinite lengths in a finite(though obviously infinitely subdividable) span.
See here for more: http://freespace.virgin.net/hugo.elias/models/m_perlin.htm
f(x) = sum[n = 0 to infinity]((1/2)^n sin((1/20)^n pi x))
It converges because each successive term is bounded by [-1/2, +1/2]. But if you integrate it you get: f(x) = sum[n = 0 to infinity](10^n / pi cos((1/20)^n pi x))
(Well... you get that if you play fast and loose about swapping the order of the integral and the sum)Which diverges because the input to the cosine function limits to 0 as n -> infinity, so the cos limits to 1, and we get 10+100+1000+10000...
But if you integrate from two points and delay doing the limit until after then you get
F(x1, x2)
= sum[n = 0 to infinity](10^n / pi (cos((1/20)^n pi x2) - cos((1/20)^n pi x1)))
= sum[n = 0 to infinity](10^n / pi (2*sin(pi/2 (1/20)^n (x1-x2))*sin(pi/2 (1/20)^n (x1+x2)))
Which, for large n, acts like: ~= sum[n = 0 to infinity](10^n / pi (2*(pi/2 (1/20)^n (x1-x2))*(pi/2 (1/20)^n (x1+x2)))
= sum[n = 0 to infinity]((1/40)^n pi/2 *(x1-x2)(x1+x2))
Which converges.Apologies for any math mistakes. This was all off the cuff. I wouldn't be surprised if some of the more general integration or summation strategies can also handle this case.
You can only do that with a definite integral (under conditions).
Using your reasoning, even a function like exp(x) would not integrate, because the terms in the integral of its series expansion would all go to zero as n -> infinity.
Another way to think about this is that each term in the indefinite integral you wrote has an arbitrary constant of integration, which can depend on n, that you did not include. This constant precludes you from actually finding the limit.
What we want is differentiable everywhere but where the derivative is not Riemann integrable!!!!!! Everyone should have one of those, just to carry around.
We might keep in mind that a function is Riemann integrable iff it is continuous everywhere except on a set of measure 0. So, we want the points where the function is not continuous to be of positive measure!
Much more than you ever wanted to know about continuity, differentiability, and the Riemann integral!