Showing posts with label L2 norm. Show all posts
Showing posts with label L2 norm. Show all posts

Thursday, April 28, 2016

Variance Solids: Volumes and $\mathscr{L}^2$, Part 2


Last time, we talked about how the classical $\mathscr{L}^2$ norm of a (one-variable) function could be visualized as a solid consisting of squares. Of course, there's another formula that is defined by almost the same formula, with an extra factor of $\pi$: the solid of revolution of the function about the $x$-axis: \[
V = \int_a^b \pi f(x)^2\,dx
\]
It looks pretty cool, although not quite as cool as twisted square cross-sections.

I wanted to mention another common application of $\mathscr{L}^2$ norms that probably is more familiar than any other: the statistical concept of variance. For functions $f$ defined on a continuous domain, we can define an average value:\[
\overline{f} = \frac1{b-a}\int_a^b f(x)\,dx.
\] which basically is the height of a rectangle over the same domain $[a,b]$ that has the same area as the area under $f$. For example, for \[
f(x) = \sin \left( x \right)\sin \left( t \right)+\frac{1}{3}\sin \left( 5x \right)\sin \left( 5t \right)+\frac{1}{3}\sin \left( 10x \right)\sin \left( 10t \right)+\frac{1}{5}\sin \left( 15x \right)\sin \left( 15t \right)
\]
(choosing $t=3.030303$), it looks like:


(the blue line in the middle is the mean value). The variance $\sigma^2$ is then a measure of how far $f$ is from its mean:\[ \sigma^2 = \frac{1}{b-a}\int_a^b (f(x) - \overline{f})^2\,dx. \] This of course can be visualized exactly as last time, namely, make a bunch of square cross sections about the line $y=\overline{f}$, and possibly do funny things to such squares, such as rotate it. But ... for kicks, let's add a factor of $\pi(b-a)$:\[ \pi(b-a)\sigma^2 = \int_a^b\pi (f(x) - \overline{f})^2\,dx, \] which is precisely the same quantity as the solid obtained by revolving $f(x)$ around its mean $y=\overline{f}$. The resulting solid is the title picture.

Sunday, April 24, 2016

Volumes of Solids and (squared) $\mathscr{L}^2$ Norms

The volume of this solid is the squared $\mathscr{L}^2$ distance between $y=x^2$ and $y=x^3$ on the interval $[0,\frac{3}{2}]$.

The good ol' $\mathscr{L}^2$ norm has an outsized importance in many applications of math, principally, because Hilbert spaces (spaces with inner product) are useful for, well, just about anything. Much of a fan of Hilbert spaces I might have been for much of my recent life, it is only when teaching how to find the volume of solids (and a little help from Math Homie William) when it hit me what the best visualization for them is, at least for functions defined on $\mathbb{R}$. (For the longest time, I just said "It's sort of like the area between two curves, but, you know, squared, and stuff.") But we learn in integration theory that we can base a solid by putting squares (or semidisks or triangles, or whatever) in a perpendicular, 3rd dimension, over the area between curves; the volume of the solid is \[
V=\int_a^b A(x) \, dx
\] where $A(x)$ is the area of the cross section. But of course there's an obvious candidate: if you choose squares to have side length being the height of your function $f(x)$, then $A(x)$ is just $f(x)^2$. Thus,\[
V = \int_a^b f(x)^2 dx.
\] But that's none other than the squared $\mathscr{L}^2$ norm of $f$! Similarly, for the volume of a solid consisting of squares between two curves $f(x)$ and $g(x)$, this is just \[
V=\int_a^b (f(x) - g(x))^2dx,
\] the (squared) $\mathscr{L}^2$ distance between the two functions. Now if we treat each of these squares like a deck of cards, and rotate them, it shouldn't change the volume. So we apply this to the functions $f(x)=x^2$ and $g(x)=x^3$ on $[0,\frac{3}{2}]$:



Now making vertical segments between the curve, and making a square with that side length pop half out of the plane, and half into the plane, gives us a nice solid. Rotating it gives the picture at the top.