Monday, July 13, 2009

Dumb Stuff I Didn't Know, Volume I of Many

I was reading something the other day (context largely unimportant) and found myself completely unable to understand an argument that was being made. On further inspection, I was able to ascertain that the author had felt that the following was so obvious as not to merit any mention: that diagonalizable matrices commute if and only if they are simultaneously diagonalizable, i.e. if there is some basis which is an orthogonal basis of eigenvectors for both matrices.

Trying to prove this fact once you know what you're looking for isn't too hard -- playing around with formulas will show you quickly that if two linear maps commute then they must fix each others' eigenspaces; then just diagonalize the restriction of S to each of T's eigenspaces and stick the resulting mini-bases together.

We can do a little better here: Suppose that we have some commutative collection C of endomorphisms of a finite-dimensional complex vector space V; then they all share some eigenvector.
Proof: We know that C fixes V. Let W be a subspace of V of minimal positive order which is fixed by C. We claim that each vector in W is an eigenvector of each element of C. Suppose not; then there is some counterexample Mw≠λw. M fixes W though, so the restriction of M to W is a complex linear map in its own right; in particular, it has to have some eigenvector in W, say Mx=μx. Let's have Wμ denote the μ-eigenspace of M restricted to W. Then the previous two sentences in effect say that that 0 <>μ <>μ is fixed by C -- take any w in Wμ and any N in C and notice that M(Nw) = (MN)w = (NM)w = N(μw) = μ(Nw), i.e. Nw is a μ-eigenvector of M, and since N, being after all from C, fixes W, it's an element of Wμ. But wait! Before we said that W was as small as you could get and still be fixed by C, but we've just shown that Wμis both fixed by C and smaller than W. This can't be, so our assumption must have been wrong -- W must consist exclusively of eigenvectors for every element of C.
Quick question: how many different eigenvalues can be associated with the subspace W in this proof, for any given transformation? For all of them?

Less quick question: What happens when we pass to infinitely many dimensions?

Wednesday, July 01, 2009

Rings

Every time I read something that pertains to any kind of ring, there's always a necessary section at the beginning stipulating that such-and-such a ring has an identity, that the mappings under consideration must preserve that identity, and so forth. Can someone fill me in as to whether there's some area of study in which people use rings without 1 so extensively that it makes up for the extreme annoyance of dealing with such requirements everywhere else? As far as I can tell, rings without 1 occur basically as often as these things called "monoids" or "groupoids" -- more than never, but certainly not often enough to merit such a basic name, or take up space in textbooks and brains. Can someone set me straight here?

Tuesday, June 30, 2009

A Generalization of the Mean

First, some background:

Remember that the mean or expected value of a random variable is defined as the integral of that variable with respect to the associated probability measure. This works out great in some cases, e.g. when we're flipping coins, or rolling dice, or in general when we're thinking about random variables with finite variance. Of course, it's defined for a wider class of random variables -- not everything with a mean has a standard deviation -- but there are certainly random variables out there with no mean.

A famous example of a divergent mean is the St. Petersburg game, which goes something like this: I'll let you flip a coin and pay you for how many heads you can get in a row. If you get heads up the first time, but tails after that, I'll give you a dollar. Two heads in a row, $2. For n heads in general, n > 0, the payout will be $2n-1. Rather than giving you 50 cents for failing so spectacularly as to hit tails on your first try, let's say you just get nothing.

The probability of getting exactly n heads in a row is, of course, 1/2n, so the expected value is

(1/2)($1) + (1/4)($2) + (1/8)($4) + (1/16)($8) + ... = $.50 + $.50 + $.50 + ...

Uh oh. If we keep adding on $.50 forever, the right-hand side is going to infinity! Clearly, you should be willing to pay me any amount of money in order to play this game, since your measly $10k pales in comparison to the promised infinite reward. Any takers?

We're not done here, though; first, let's change up the game a little. We'll leave things the same if you flip 1 head, or three consecutively, or five, and so on, but let's say if you flip an even number of heads, you have to pay me. What was that expectation again?

(1/2)($1) - (1/4)($2) + (1/8)($4) - (1/16)($8) + ... = $.50 - $.50 + $.50 - $.50 + ...

Oh, dear. Depending on how we arrange that series, it can diverge up or down. You can see from here, if you didn't sleep through your calculus classes, that we can even produce a conditionally convergent expectation that can be rearranged to anything!

Okay, I've gotten away from myself here, but, long story short, means are weird. (I seem to be in an Italic mood today for some reason...) That said, consider the following, which has been bouncing around in my head for a year or better. I finally asked someone whether it was true and quickly received the following proof:
Let X1, X2, ... XN be i.i.d. random variables, and let YN = [ X1 + X2 + ... + XN ] / N. Put f(N) = Median(YN). If μ = Mean(Xi), i.e. if that mean exists, then as N → ∞ we have f(N) → μ.

Proof (thanks to Robert Israel): The Weak Law of Large Numbers states that, for ɛ>0, Pr{|YN - μ| < ɛ} → 1 as N → ∞. For N sufficiently large, then, Pr{|YN - μ| < ɛ} > 1/2, or in other words, more than half of the distribution for YN lies within the interval (μ - ɛ, μ + ɛ). In particular, at least half lies within (-∞, μ + ɛ), so there is no way that the median f(N) can exceed μ + ɛ; symmetrically, f(N) > μ - ɛ. Combining both sides, we see that |f(N) - μ| < ɛ, which is to say that f(N) → μ as N → ∞.
Note that this limit can converge in circumstances where there is no mean -- for instance, it clearly always gives the axis of symmetry for a symmetric distribution, and there exist symmetric distributions which have no mean, e.g. the Cauchy distributions. So in broad terms this is a generalization of the concept of the mean.

I'm really no expert on statistics or probability, so I don't really know how far the applications go or whether this is an elementary exercise in graduate textbooks in the field. I just thought it was interesting, and I'll probably poke around with it in the days to come.

Visualizing Groups of Symmetries

After realizing that I had some (now) bizarre misconceptions about the groups of symmetries of various graphs, I decided to write a small program to let me visualize the effects of a given permutation on a graph embedded in two or three dimensions:
Here we see a regular dodecahedron. (These don't look great as static images, I know, but the program allows you to rotate the figures which makes them a lot easier to discern.) Suppose we were to twist two of the opposite pentagonal faces; then we'd get something that looks a little like this:In case you couldn't tell from the shape, the background has turned light yellow to indicate that this permutation is not in fact an automorphism of the dodecahedron. This is a platform independent Java application, and I'll post a download as soon as my web hosting comes back up. If anyone would like to look over my Java code and tidy it up, and/or make it into a workable applet, that'd be great; I really don't know Java and this took me way longer to write than it should have.

Relevant math question: If we let S6 act on the vertices of the icosahedron, how many different graphs (up to isomorphism) do we get?

Update: now available for download. Extract the archive into a directory, then either double-click on the .jar file or use the provided shell script or batch file depending on platform. The graphs/ directory contains some different graphs you can load; if you peek at one of the files in a text editor it should be pretty clear how to make your own. Enter permutations in cycle notation, e.g. (1 2)(3 4), and beware the following caveats:
  • The vertices are numbered 0,1,...n-1 rather than 1,2,...n
  • You don't have to reduce your permutations, so you can enter e.g. (1 2)(1 3)(3 4 5) or somesuch. Be aware, though, that the program composites permutations backwards, so you'll have to flip things right to left with respect to normal mathematical notation.
I've had some annoying classpath issues on my computer so I'd be glad to hear whether this works on other people's computers or not.

Thursday, November 13, 2008

Help on an unusual LaTeX error

I ran into a somewhat unusual LaTeX error earlier today, for which I was unable to Google any relevant information, so I thought I'd put a quick description up here for the next person who runs into this and goes searching for help online. If you didn't get here by searching for help with this problem, you probably won't be interested in the rest of the article.



The relevant section of the error message reads:


! LaTeX Error: Missing \begin{document}.

...

1.1

\ d o c u m e n t c l a s s { a r t i c l e }

The problem turned out to be that I was that my LaTeX installation was expecting an ASCII input file, whereas I was feeding it something encoded with Unicode. I fixed this by opening the file in wordpad, using the "Save as..." option, and changing the dropdown box from Unicode text to regular text.

Apparently there are techniques for getting your LaTeX installation to handle Unicode input, but I'm not really sure how it's done. In the mean time, I guess I'll be writing all my math papers in English, rather than Japanese, Persian, or Tengwar.

Friday, November 07, 2008

Circle

So I was trying out this Processing programming environment, which is basically a framework that lets you do rapid prototyping of visualization-type programs in Java, when one of their examples reminded me of a couple of things:

  1. Florentine Renaissance painter Giotto di Bondone, who, when asked by an emissary of the Pope for a demonstration of his work, dipped a brush in red paint and in one stroke created a perfect circle.
  2. The popular assertion that 2 Chronicles 4:2 contradicts any claims of Judeo-Christian divine infallibility by providing Jews with one of the worst ancient approximations of π. (The passage, if you're not familiar, states that King Solomon had a pot made which was 10 cubits in diameter and 30 in circumference; a cubit is about half a meter.)

The applet I produced, then, should have something for everybody. You can try your hand at matching Giotto's remarkable achievement, confirm the difficulties of producing a perfectly round circular object of a large size, investigate the properties of other convex shapes, or use the applet as a medium for art.





Since A = π r^2 and C = 2 π r, given a circle-like shape we can measure the area and circumference and then calculate π = C^2/4A. Here the circumference and area are calculated by dividing the circle into wedges and using s = r θ and A = 1/2 r^2 θ for an arc and circular wedge, respectively. (We can't just divide the circumference by the diameter as the shape, being imperfect, will have different diameters at different angles.)

A circle has minimal area for a given circumference, and diameter is directly proportional to circumference, so estimates of π calculated by dividing a circumference by a diameter will be too low; similarly, calculating π by the method above will give overestimates. If you can get your circle to give π < 3.3 consistently, you're a better artist than I am.

What would you expect if you drew a square instead of a circle? Work it out on paper, then try it out and check your answer. No peeking! If you want source code, it's available over at

http://www.geocities.com/dan131m/circlesketch/



Wednesday, August 06, 2008

What I'm Working On

I'll have a bigger, more "friendly" writeup here in a while, but here's what I'm working on for now:

We have n i.i.d. geometric random variables with parameter q, but we do not know n or q. Instead, for some (known) k < n, we are given the largest k of these values. Our challenge is to estimate n and q based on this information.

I think this is a reasonable first model for a situation where we are trying to separate "talent" from "persistance" or "luck" -- i.e., though I'm terrible at basketball, I can make an arbitrarily long series of free throws if I just go and keep throwing balls at the basket over and over and over again. If all you can see are my "high scores," can you tell how good I am?

For fixed k, it's not too hard to go after this kind of problem with spreadsheets and so forth, but I'm hoping that I might be able to get some more interesting mathematical results. At this point I'm having a hard time deciding on what sort of approach to use. One is to consider the set N x [0,1] and consider the marginal probability that N samples of a Geometric(q) distribution would have generated such a set of results; the other is to try to consider the relation between the sample and population variance.

This is just a bit of a toy problem and I haven't really had too much time to work on it while I've been looking for jobs and so forth, but I think it has the potential to be somewhat interesting -- particularly in the case k = 5, which will let you rag on your friends for their performance on WiiPlay.

Sunday, August 03, 2008

Stupid Computer Tricks

I haven't put any content up here in a while, so I thought I'd show off how needlessly addicted to Excel you become when you're working in finance by implementing the Mandelbrot set in Excel. For this spreadsheet, I changed the size of the cells to 2x2, put a formula in each cell to calculate how many iterations of Z -> Z^2 + C that each point C survives, and then used conditional formatting to fill the whole thing in. A slight modification to the sheet would make it approximate the area of the Mandelbrot set, although not to anywhere near the accuracy you can achieve by looking at things mathematically.


It might be a fun exercise to add zooming capability -- all you'd have to add are a couple of cells to replace the currently-hardcoded values in the formulas. Of course, it does calculate relatively slowly at the moment.

Speaking of finance and spreadsheets, I'm looking for a job at the moment. I have some experience with finance, a Series 7 license, and I think I'm pretty good at Excel.