De Rham cohomology

September 3, 2009

I want to give an elementary example of what de Rham cohomology is about (my own conception of it is not far from this–I don’t have any non-trivial understanding of other things with the word “(co)homology” involved, only some vague ideas like that Stokes’ theorem says that integration exhibits the exterior derivative on differential forms and the boundary operator on manifolds as adjoint, so there should be some dual theory about submanifolds / singular chains / whatever). The example here will just be in terms of vector fields on a plane, so no knowledge of differential forms or manifolds is necessary. Knowing a bit of vector calculus will be helpful, but hopefully not required to get something out of this.

In our example, the idea is to look at what sort of vector fields can live on some two dimensional space to deduce topological information about the space. The relevant properties of vector fields are ones learned in a typical vector calculus class: specifically, the curl of a vector field, and whether or not a vector field is conservative. First of all let’s recall what these are.

The curl of a vector field V is (for our purpose) a function from R² to R which does as the name suggests: the curl of V at a point P is a measure of how much the vector field is rotating about the point P, and in what direction. Imagine that the vector field is describing some sort of force like gravity, or the flow of water, and suppose we place a little circle at P. If the vector field is rotating around P clockwise, it takes some positive amount of work to traverse the circle counterclockwise against the flow of the vector field; if the field is rotating counterclockwise, it does the work for us, and so the amount of work necessary is negative. Of course as the circle gets smaller, so too does the amount of work necessary to traverse it, no matter how much the field is rotating: thus, it’s better to consider the amount of work needed per unit of length. This, then, is the definition of curl: take the amount of work needed to traverse a small circle at P divided by the circumference of the circle, and let the size of the circle go to 0.

For example, for the vector field V = (y, -x), the curl is positive at 0:

curl

curl

In fact this vector field has positive curl everywhere. It takes positive work to go counterclockwise around, say, the circle on the lower right, since the vector field is smaller closer to the origin where it helps us along the circle, and bigger further away where we have to work against it (maybe a better way to imagine curl is as a measure of how much a tiny weather vane at a point will spin due to the vector field). For the record, this vector field V has curl 2 at every point.

Let’s look at a vector field with zero curl. This vector field is defined on R² without the origin; let’s call this space M write W for the vector field. W is given by the formula (-y/\sqrt{x^2+y^2}, x/\sqrt{x^2+y^2}):

derham2

Surely it is outrageous that this vector field W has no curl, it is curling all over the place! But at every point of M, there’s no curl because all of the vectors have length 1, so a weather vane isn’t going to go anywhere, and we can’t put a weather vane at the origin since M is missing the origin!

This vector field provides the first idea of what this example is about. Here we have a vector field which by any decent standards looks like it ought to have nonzero curl, but it fails to, because the space on which it is defined is missing the place where it is trying to curl about! The existence of a vector field like this is giving us topological information about M, namely that it has some kind of hole.

It’s also important that this example does not work on all of R² (we don’t want to be told that R² has a hole in it), because W cannot be defined at the origin in a continuous way: the only choice for a vector there is the zero vector (otherwise which direction would it point in), but this doesn’t work since all of the vectors in the field have length 1. Compare to the first vector field, where the lengths of the vectors decrease to zero in a nice continuous way as you head to the origin. (And certainly we need continuous vector fields to learn anything about the topology of our spaces!)

So this is the first half of the story, getting the idea of looking for vector fields that “should” have nonzero curl but don’t; the second half is deciding how to tell what we mean by “should” here. A vector field is conservative if the amount of work to go from a point P to a point Q along some path does not depend on the path, only on P and Q. A gravitational field, for example, is conservative. Notice that in particular, a conservative vector field has zero curl, because it takes zero work to go around any circle: starting at P and ending up at P via a circle must take the same amount of work as just sitting at P for a while.

Notice also that the vector field W is not conservative: it takes positive work to go counterclockwise in a circle around the origin. This is what we mean by vector fields which “should” have nonzero curl but don’t: vector fields that have zero curl but are not conservative. For an open subset U of R² (like R² with the origin removed), write \Omega_0(U) for the set of conservative vector fields defined on U, and \Omega_1(U) for the set of vector fields with zero curl defined on U (actually these need to all be smooth vector fields, i.e. infinitely differentiable ones). These are both vector spaces over R.

The first de Rham cohomology group of U, which we will write H^1(U), is then the quotient vector space \Omega_1(U)/\Omega_2(U). It turns out that when U is R² with the origin removed, H^1(U) has dimension 1; the vector field W we considered earlier (or rather its equivalence class) is a nontrivial element. This is in accordance with the idea that H^1(U) is telling us about holes in U. For another example, if U is R² with two points removed, then H^1(U) has dimension 2. As we would hope, H^1(\mathbb{R}^2) has dimension 0, a restatement of the fact that every vector field with zero curl defined on all of R² is conservative.

This pretty much concludes the example. As the terminology suggests, there are higher de Rham groups (one for every nonnegative integer), which might be thought of as detecting higher-dimensional holes. We can also talk about the de Rham cohomology of any smooth manifold: the dimensions of the de Rham cohomology groups of the 2-sphere are 1, 0, 1, 0, 0, 0, … The dimension of the 0th de Rham group is the number of connected components of the manifold, and the remaining numbers fit the idea that the 2-sphere has one “two-dimensional hole”, and no holes of other dimensions.

It is important, and easy to believe, that de Rham cohomology is a diffeomorphism invariant: two diffeomorphic smooth manifolds have the same de Rham cohomology. In fact it’s a homeomorphism invariant, but even better, it’s a homotopy invariant: if one manifold can be continuously deformed into another, the two manifolds have the same de Rham cohomology. For example, R² with the origin removed is homotopic to a circle, via the homotopy that stretches everything inside the unit circle up to it, and everything outside the unit circle down to it, so the circle also has first de Rham cohomology group of dimension 1 (as it should). Thus, the de Rham cohomology can be used as a tool to decide whether two manifolds are diffeomorphic / homeomorphic / homotopy invariant.

Symmetries in the plane 4

August 23, 2009

Okay this is the final and MOST EXCITING post of this series. So far we’ve shown that the symmetry group G of a compact convex plane figure K is a compact subgroup of GL(2,R), so long as K isn’t a line segment. The last step is to show that any compact subgroup of GL(2,R) is conjugate to a subgroup of O(2). In fact this is true of GL(n,R) in general, and the proof is the same.

So, suppose G is a compact subgroup of GL(n,R). The example of an ellipse sheds some light on how to proceed. A non-circular ellipse is only fixed by finitely many members of O(n), but this is because we’re using the wrong coordinates! If we scale our coordinates along one axis of the ellipse, we get a new inner product \langle \, , \, \rangle, and any matrix A with \langle Av, Aw \rangle = \langle v, w \rangle will fix the ellipse.

We’re already given the group G, so we want to reverse this process: find an inner product \langle \, , \, \rangle such that \langle Av, Aw \rangle = \langle v, w \rangle for all A in G. Then we can figure out what coordinates this inner product comes from, and hence what subgroup of O(n) is conjugate to G.

As is often the case when trying to construct an object which respects some collection of symmetries, we do it by averaging over those symmetries. Write v \cdot w for the usual Euclidean dot product (in fact any inner product on \mathbb{R}^n will do here). Define a new inner product \langle v, w \rangle = \int_G (gv \cdot gw)\,dg, either thinking of this integral as over G as a compact subset of \mathbb{R}^{2n}, or by choosing a volume form on the Lie group G. If A is in G, the change of variables formula immediately gives \langle Av, Aw \rangle = \langle v, w \rangle (using that |\det(A)| = 1 since A preserves the volume of G, or because G is compact).

The rest is linear algebra. By looking at what \langle \, , \, \rangle does to standard basis vectors, we find a matrix B such that \langle v, w \rangle = v^t B w; since B arises from an inner product, it is symmetric and positive-definite. We want to use B to find M invertible such that M^{-1}AM is orthogonal when A is G, i.e. A^tM^t M A = M^t M. But we know that v^t A^t B A w = v^t B w for all v,w, so any M with M^t M = B will do.

The spectral theorem says that B is orthogonally diagonalizable: there is U orthogonal such that UBU^{-1} = D is diagonal; since B is positive definite, the diagonal entries of D are all positive, and so D has a square root \sqrt{D}, gotten by taking the square root of the entries of D. Then M = U^{-1} \sqrt{D} U is symmetric since U is orthogonal, and M^2 = M^t M = B.

So, H = M^{-1} GM is a subgroup of O(n). At this point let’s go back to the plane. Since H is infinite and compact, it cannot have dimension 0 as a Lie group. O(2) has dimension 1, so G has dimension 1, and therefore must be a union of connected components of O(2) since it is an embedded submanifold. The connected components of O(2) are SO(2) and the set of reflections, and so the possibilities for H are O(2) and SO(2).

Notice that M^{-1} GM is exactly the symmetry group of M^{-1} K. Take v in M^{-1} K with maximal norm. Then the image of v under every rotation about the origin is in M^{-1} K, so M^{-1} K contains a circle about the origin. By convexity, M^{-1} K contains the disk of radius |v|. But the maximality of |v| then forces M^{-1} K to be exactly the disk S of radius |v| about the origin.

Thus, K = MS. Does this make K an ellipse? This is a nice geometric application of diagonalizability. Remember that M = U\sqrt{D}U^{-1} where U is orthogonal and \sqrt{D} is diagonal. Orthogonal matrices fix S, and \sqrt{D}S is evidently an ellipse; the disk S gets scaled along each axis by the corresponding diagonal entry of \sqrt{D}. Therefore M is the image of an ellipse under U, and U is an isometry, so K is indeed an ellipse. Awesome!

Symmetries in the plane 3

August 14, 2009

Given a compact convex set K in the plane that is not a line segment, let G be the group of symmetries in AGL(2,R) fixing K; we saw previously that choosing the centroid of K at the origin forces G to actually be a subgroup of GL(2,R). Let’s see that G is compact. GL(2,R) has the topology gotten by thinking of it as a subset of \mathbb{R}^4 with the usual Euclidean distance, so we want to check that G is closed and bounded.

Closed is easy: if A_1, A_2, \ldots is a sequence in G converging to A in GL(2,R), then for any p in K, A_n p converges to Ap by continuity. Since K is closed, Ap lies in K, so AK \subset K. Applying the same argument to A^{-1} gets AK = K, so A is in G.

To show that G is bounded, we’ll show that if it’s not, then there are points p in K such that Ap gets arbitrarily large for A in G. This would be outrageous since K is compact and AK = K. More precisely: if K is not a line segment, then by convexity it contains a basis v, w of \mathbb{R}^2. The claim is that given R > 0, there is M such that |A| > M implies |Av| or |Aw| > R; here |A| is just the Euclidean norm thinking of A as a member of \mathbb{R}^4. Taking R to be such that K is contained in a ball of radius R about the origin then forces |A| \leq M for all A in G.

First let’s check this in the special case where the basis v, w is e_1 = (1,0), e_2 = (0,1). Then Ae_1, Ae_2 are just the columns of A, so |A| = \sqrt{|Ae_1|^2 + |Ae_2|^2}. Thus, if |A| > \sqrt{2}R, then either |Ae_1| or |Ae_2| must be bigger than R.

For the general case, let B be the matrix with columns v, w, so that Be_1 = v, Be_2 = w. By the above, if |AB| > \sqrt{2}R, then one of |ABe_1| = |Av| or |ABe_2| = |Aw| is bigger than R. But |AB||B^{-1}| \geq |A|, so taking |A| > \sqrt{2}R|B^{-1}| forces |Av| or |Aw| > R.

Symmetries in the plane 2

August 14, 2009
Let’s get started answering the question from the last post. Following the outline there, the first step is to show that if K is a compact set in the plane and T(K) = K where T is in AGL(2,R), then T is linear. Since everything in AGL(2,R) is a translation of a linear map, it’s enough to show that T(0) = 0.
It’s easy to see why a translation can’t fix K: given a vector v, there is a unique point x of K furthest from the origin in the direction of v (thanks to compactness). Then x + v is in K + v and is even further from the origin in the direction of v, so K + v can’t be K. But it’s less obvious that we can’t, say, scale and rotate and reflect K somehow to get a translation of K.
The argument we’ll give is similar in spirit to the one above, in that it’s based on looking at a special point. Namely, we’ll show that if T(K) = K, then the centroid of K must be fixed by T. It’s no loss of generality to assume that the centroid of K is at the origin, so this gives T(0) = 0, what we wanted.

Let’s get started answering the question from the last post. Following the outline there, the first step is to show that if K is a compact set in the plane and T(K) = K where T is in AGL(2,R), then we can assume T is linear. Since everything in AGL(2,R) is a translation of a linear map, it’s enough to show that T(0) = 0.

It’s easy to see why a translation can’t fix K: given a vector v, there is a unique point x of K furthest from the origin in the direction of v (thanks to compactness). Then x + v is in K + v and is even further from the origin in the direction of v, so K + v can’t be K. But it’s less obvious that we can’t, say, scale and rotate and reflect K somehow to get a translation of K.

The argument we’ll give is similar in spirit to the one above, in that it’s based on looking at a special point. Namely, we’ll show that if T(K) = K, then the centroid of K must be fixed by T. It’s no loss of generality to assume that the centroid of K is at the origin, so this gives T(0) = 0, what we wanted.

Write \mu(K) for the area (e.g. Lebesgue measure) of K. Let \pi_1, \pi_2 : \mathbb{R}^2 \to \mathbb{R} be the maps \pi_1(x,y) = x and \pi_2(x,y) = y. The centroid of K is the point (\overline{x}, \overline{y}) = \frac{1}{\mu(K)}(\int_K \pi_1, \int_K \pi_2). There’s one problem here: what if \mu(K) = 0? Wikipedia suggests the definition “the intersection of all straight lines that divide X into two parts of equal moment about the line”, which seems like kind of a pain to work with. Luckily we’re talking about convex sets here. If K is convex and isn’t a line segment (we don’t care about those anyway), then it has positive measure: given three non-collinear points in K, the solid triangle with those vertices must lie in K, and that has positive measure.

So, suppose T(K) = K for some T in AGL(2,\mathbb{R}), and write T = v + A, where A is linear. Because T(K)  has area |\det(A)|\mu(K), we must have |\det(A)| = 1. Writing A as a matrix makes it easy to see that T(\overline{x}, \overline{y}) = v + \frac{1}{\mu(K)}(\int_K \pi_1 \circ A, \int_K \pi_2 \circ A). Using the change of variables formula and the relation A(K) = K – v, the right side is v + \frac{1}{\mu(K)}(\int_{K-v} \pi_1, \int_{K-v} \pi_2). Changing variables again gives v + \frac{1}{\mu(K)}\left[(\int_K \pi_1, \int_K \pi_2) - \mu(K)v\right] , and this is exactly (\overline{x}, \overline{y}).

This means that the symmetry group of K in AGL(2,R) actually lies in GL(2,R). Great news! The next step is to show it’s compact; I don’t know the compact subgroups of AGL(2,R), but I do know (enough about) the compact subgroups of GL(2,R).

Symmetries in the plane

August 12, 2009

Someone in freenode #math asked the following (paraphrased) question: if a compact convex subset of the plane has infinitely many symmetries (in other words, if it’s fixed by infinitely many members of AGL(2,R)), is it an ellipse? Here AGL(2,R) is the affine linear group on R^2, i.e. invertible linear transformations of R^2 plus translations. Saying “symmetries” seems a little misleading, since we’re allowing things other than isometries (rigid motions of the plane); for example, an ellipse is fixed by infinitely many members of AGL(2,R) since we can scale it along one axis to get a circle, rotate the circle however we like, and unscale to get the original ellipse.

This is slightly weird, and ideally we’d rather just think about isometries. The solution that I’ll give over a few posts is based on trying to do that. There might be an easier solution, but I think the one I have is nice for going through some cool ideas.

The answer to the question is “no”, incidentally, with counterexamples provided by line segments: the line segment [-1,1] \times \{0\} is fixed by any linear map with matrix \left(\begin{array}{cc} 1 & 0\\ 0 & c\end{array}\right) for c \neq 0. What we’ll show is that these are the only counterexamples: any compact convex set K fixed by infinitely many members of AGL(2,R) is a line segment or an ellipse.

Here’s an outline of the argument, which will be broken up over several posts:

1) If K is fixed by A in AGL(2,R) , then A is linear, so we only need to think about GL(2,R)

2) The group of symmetries of K in GL(2,R) is compact if K is not a line segment

3) Every compact subgroup of GL(2,R) is conjugate to a subgroup of O(2), so up to a change of coordinates, we’re only thinking about rotations and reflections

4) The compact infinite subgroups of O(2) are O(2) and SO(2) (just rotations, and rotations and reflections)

5) Any compact convex set fixed by a conjugate of SO(2) is an ellipse

First I want to talk a little bit about isometries of \mathbb{R}^n: functionsT : \mathbb{R}^n \to \mathbb{R}^n such that |Tx - Ty| = |x-y| for all x, y. This is all completely standard, but it’s good to know. We don’t demand any nice properties to start with, although many follow from the definition. Suppose T is an isometry of \mathbb{R}^n with T(0) = 0; then T is linear. I won’t prove this in detail since it’s kind of fussy, but it should seem reasonable: for example, T(cx)  is distance |cx| from 0 and distance |(c-1)x| from T(x), and T(x) is distance |x| from 0. This, plus being careful about the sign of c, will force T(cx) = cT(x).

Thus, every isometry is a linear isometry followed by a translation. We can write |Tx - Ty|^2 = \langle Tx, Ty \rangle, so the condition that T is an isometry is equivalent to the condition that \langle Tx, Ty \rangle = \langle x, y \rangle, i.e. that T preserves the angles between vectors. Since \langle Tx, Ty \rangle = \langle x, T^t Ty \rangle, and this must equal \langle x, y \rangle for all x, T being an isometry means that T^t T is the identity map. That is, if we think in terms of matrices (with respect to the standard basis), the group of linear isometries of \mathbb{R}^n is exactly the orthogonal group O(n) = \{A \in GL(n,\mathbb{R}) : A^t A = I\}.

Every orthogonal matrix has determinant 1 or -1, since if T is orthogonal then 1 = \det(I) = \det(T^t T) = \det(T)^2, and it’s helpful to distinguish these: the matrices in O(n) of determinant 1 form a subgroup, SO(n). At this point let’s restrict to the plane. It’s just a matter of algebra to check that every member of SO(2) looks like \left(\begin{array}{cc} a & b\\ -b & a \end{array}\right) where a^2 + b^2 = 1. The latter condition means we can write this more suggestively as \left(\begin{array}{cc} \cos(\theta) & \sin(\theta)\\ -\sin(\theta) & \cos(\theta)\end{array}\right). This linear map sends (1,0) to (\cos(\theta), \sin(\theta)) and (0,1) to (-\sin(\theta), \cos(\theta)): it’s exactly the counterclockwise rotation by \theta.

What about members of O(2) that have determinant -1? A similar analysis shows that they look like \left(\begin{array}{cc} \cos(\theta) & \sin(\theta)\\ \sin(\theta) & -\cos(\theta) \end{array}\right). One can check that this matrix fixes (\cos(\theta/2), \sin(\theta/2)) and sends the perpendicular vector (-\sin(\theta/2), \cos(\theta/2)) to its negative. That is, everything in O(2) not in SO(2) is a reflection across a line through the origin.

Isometries of course also include translations, and these together with O(2) give us rotations and reflections through every point. So there are no real surprises here, since we probably figured the isometries of the plane were just translations, rotations, and reflections, but at least it’s nice to see that linear algebra works.

Anyway talking about this isometry stuff was pretty unnecessary for the question at hand, so I will get back to that in the next post.

Dyck paths continued

March 23, 2009

In the previous post, we saw how to count Dyck paths using André’s reflection trick. Here’s a more specific question: On average, how many moves right does an (n,n)-Dyck path begin with? For example, using the notation from last time, there are 5 (3,3)-Dyck paths (words): RURURU, RURRUU, RRURUU, RRUURU, RRRUUU. On average, then, a (3,3)-Dyck path begins with (1\cdot 2 + 2\cdot 2 + 3\cdot 1)/5 = 9/5 = 1.8 moves right. The answer for general n turns out to be a little bit surprising, I think.

To figure this out, we need to count how many (n,n)-Dyck words begin with k R’s, for each k = 1, …, n (when I say “begins with k R’s”, I mean “begins with exactly k R’s”). Say this number is R(n,k). Then the average number of moves right an (n,n)-Dyck path begins with is A(n) = D(n,n)^{-1} \sum_{k=1}^n k R(n,k). Directly counting the number of Dyck words beginning with a specified number of R’s is a little tricky. The obvious thing to do is forget the R’s and hope that what’s left is something nice that we can count. Of course we do always get an (n-k, n)-bad word, since the result always starts with U, but we can’t get all (n-k, n)-bad words like this, or even all of them that start with U: in the example with n = 3, k = 2, removing the initial R’s from RRURUU and RRUURU gives us URUU and UURU, but UUUR is nowhere to be found, since RRUUUR isn’t a Dyck word.

Here’s an easier task: count the number of Dyck words with end with exactly k U’s. This is easier because removing all those U’s still leaves a Dyck word (an (n,n-k)-Dyck word), and conversely adding k U’s to the end of an (n,n-k)-Dyck word gives an (n,n)-Dyck word. The punchline is that counting Dyck words beginning with k R’s is the same as counting Dyck words ending with k U’s.

Specifically, suppose S is an (n,n)-Dyck word. Let ψ(S) be the string gotten from S by reversing S and interchanging R’s and U’s, e.g. ψ(RRUURU) = RURRUU. We’d like to see that ψ(S) is again a Dyck word. If not, there’s some p such that up to the pth position of ψ(S), there are j R’s and j+1 U’s, for some j. But that means that after the (n-p)th position of S, there are j+1 R’s and j U’s, and so up to the (n-p)th position of S, there are n-j-1 R’s and n-j U’s; this contradicts S being a Dyck word.

So, ψ takes the set of (n,n)-Dyck words to itself, and is a one-to-one correspondence because ψ(ψ(S)) = S. Better yet, ψ takes the set of (n,n)-Dyck words beginning with k R’s onto the set of (n,n)-Dyck words ending with k U’s, and the number of these is D(n-1, n-k). This is easy to see: if we take an (n,n)-Dyck word ending in k U’s, and remove all the final U’s as well as R which must come immediately before them, we get an (n-1, n-k)-Dyck word, and conversely if we add R and then k U’s to the end of an (n-1, n-k)-Dyck word, we get an (n,n)-Dyck word (and this procedure is clearly a one-to-one correspondence). Therefore

R(n,k) = D(n-1,n-k) = \frac{k}{n} {2n-k-1 \choose n-1}.

So the answer to our question is that on average, an (n,n)-Dyck word starts with exactly

A(n) = \frac{1}{n D(n,n)} \sum_{k=1}^n k^2 {2n-k-1 \choose n-1}        (1)

moves right. This is a pretty gross answer, so let’s try to clean it up. A nice way to do this is with generating functions. Notice that if f(x) = \sum_{r=1}^{\infty} a_r x^r and g(x) = \sum_{r=1}^{\infty} b_r x^r, then

f(x)g(x) = \sum_{r=1}^{\infty} \left(\sum_{k=1}^r a_k b_{r-k}\right) x^r       (2)

(this is just the usual multiplying two polynomials and collecting terms, but with formal power series). The x^n coefficient of f(x)g(x), namely \sum_{k=1}^n a_k b_{n-k}, looks kind of like the sum \sum_{k=1}^n k^2 {2n-k-1 \choose n-1} = nD(n,n)A(n) from (1). And indeed, if we set

f(x) = \sum_{r=1}^{\infty} r^2 x^r

g(x) = \sum_{r=1}^{\infty} {n+r-1 \choose n-1},

we see that (2) says exactly that the x^n coefficient of f(x)g(x) is the sum \sum_{k=1}^n k^2 {2n-k-1 \choose n-1} from (1).

This is useful because we can write down closed-form expressions for and g, and hence their product, and then directly compute the x^n coefficient of f(x)g(x). Specifically, differentiating the power series of 1/(1-x) and multiplying by x, twice, shows that

f(x) = \frac{x + x^2}{(1-x)^3},

and since {n+r-1 \choose n-1} = (-1)^r {-n \choose r}, the binomial theorem gives g(x) = (1-x)^{-n}. Now nD(n,n)A(n) is the x^n coefficient of f(x)g(x) = (x + x^2)(1-x)^{-n-3}, and we can use the binomial theorem to see that this coefficient is {2n+1 \choose n+2} + {2n \choose n+2}. Thus, using the formula for D(n,n) we found before,

A(n) = \frac{n+1}{n}{2n \choose n}^{-1} \left[{2n+1 \choose n+2} + {2n \choose n+2}\right].

In fact, if we write out all these binomial coefficients in terms of factorials, lots of stuff cancels, and we end up with A(n) = 3n/(n+2).

I think this is weird. Specifically, that A(n) actually has a limit as n \to \infty: for large n, an (n,n)-Dyck path begins with about 3 moves right. Too much shouldn’t be read into it, though; there are always going to be more Dyck paths that start with 1 R (or 2 R’s) than that start with 3, it’s just that the average happens to be about 3 for large n. It’s worth noting that the fraction of Dyck paths starting with k R’s also has a nonzero limit for each k, e.g. for k = 1 and k = 2 it’s 1/4, and for k = 3 it’s 3/16.

Dyck paths

March 22, 2009

A few years ago I did a little project for a combinatorics class about Dyck paths (or Dyck words). Nothing very exciting, but it’s a little bit fun. Start with a grid with m columns and n rows, and draw the diagonal starting in the lower left. An (m,n)-Dyck path is a path in the grid starting at the lower left and ending at the upper right which never crosses the diagonal: 

dyck5

As the first example shows, Dyck paths can touch the  diagonal (as indeed they must at the start), but cannot cross it. Note that there are no (m,n)-Dyck paths if m < n, since we’re forced to cross the diagonal eventually. Drawing paths quickly gets inconvenient, so we make the following definition: an (m,n)-Dyck word is a string S of m R’s and n U’s with the property that each initial substring of S has at least as many R’s in it as U’s. Dyck words correspond to Dyck paths, and vice versa, in an obvious way: R represents a move right on the grid, and U a move up. The requirement that no initial substring of S contains more U’s than R’s is exactly the requirement that the corresponding Dyck path never crosses the diagonal. In the picture above, the string of R’s and U’s corresponding to each path is given above the path.

The first thing to do is count the number of  (m,n)-Dyck paths (words), call it D(m,n). One way to proceed is to find a recurrence relation for D(m,n), but that would probably be tedious. A better way is to use “André’s reflection method”, a well-known trick for calculating D(m,n). If S is a string of m R’s and n U’s, call S an (m,n)-word, and if S isn’t a Dyck word, call S a bad word, or more precisely an (m,n)-bad word. It’s easy to count the total number of (m,n)-words, so counting the (m,n)-bad words is just as good as counting the (m,n)-Dyck words.

If S is a bad word, let cross(S) be the least number such that the initial substring of S of length cross(S) contains exactly one more U than R. For example, cross(RRUUURRU) = 5 and cross(URU) = 1. In terms of paths, the path corresponding to S crosses the diagonal on the cross(S)th move. Now define S*, the reflection of S, as follows: the first cross(S) letters of S* are the same as those of S, and the remaining letters are the same except that we switch R’s and U’s. For example, (RRUUURRU)* = RRUUUUUR and (URUU)* = RURR. Note that we don’t change the cross(S)th letter. Thinking of paths, to get the path for S*, we take the path for S*, look at the part of it after it first crosses the diagonal, and flip that across the diagonal which is one unit above the main diagonal (marked in orange):

dyck_reflect

What does this get us? Well, reflection is one-to-one: if S* = P* then S = P. This comes from the fact that (S*)* = S; clearly cross(S*) = cross(S), and then going from S to S* to (S*)* is just switching the R’s and U’s in S after a certain position, then switching them again after the same position. Thus if S* = P*, then S = (S*)* = (P*)* = P. So reflection is a one-to-one correspondence between (m,n)-bad words and something, and if the something turns out to be easy to count, we’re in good shape.

As the picture above indicates, if S is an (m,n)-bad word, S* need not be (in fact will not be). Let k be the number of R’s in S up to position cross(S). Then there must be k+1 U’s in S up to position cross(S), by definition of cross(S). The same holds for S*, since the first cross(S) letters of S* are the same as S*. After the position cross(S) in S, there are m-k R’s and n-k-1 U’s, and so after the position cross(S) in S*, there are n-k-1 R’s and m-k U’s. Adding these together, we get that S* contains k + (n-k-1) = n-1 R’s and (k+1) + (m-k) = m+1 U’s. That is, if S is an (m,n)-bad word, then S* is an (n-1, m+1)-bad word.

This count of R’s and U’s works exactly the same in reverse to show that if S is an (n-1, m+1)-bad word, then S* is an (m,n)-bad word. Therefore reflection is a one-to-one correspondence between (m,n)-bad words and (n-1, m+1)-bad words. But this is great news! We’re trying to count (m,n)-Dyck words, so we only care about the situation when m \geq n (otherwise there aren’t any). But then n-1 < m+1, which means that every (n-1, m+1)-word is a bad word.

In sum, the number of (m,n)-bad words is the same as the number of (n-1,m+1)-words (better yet, we have an explicit one-to-one correspondence). It’s easy to count all the (n-1,m+1)-words: there are {m+n \choose n-1} ways to choose which positions the R’s go in for such a word, and then the positions of the U’s is completely determined, so the number of (n-1,m+1)-words is {m+n \choose n-1}, and therefore this is also the number of (m,n)-bad words. Similarly, the total number of (m,n)-words is {m+n \choose m}, and so the number of (m,n)-Dyck words (paths) is the difference of these numbers,

D(m,n) = {m+n \choose m} - {m+n \choose n-1} = \frac{m-n+1}{m+1} {m+n \choose m}

(this equality follows easily from writing out the binomial coefficients in terms of factorials and fooling around for a second).

The especially interesting case is when m = n. The numbers D(n,n) = \frac{1}{n+1} {2n \choose n}, which start (going from n = 1): 1, 2, 5, 14, 42, …, are called the Catalan numbers, and are deservedly famous, since they count everything. D(n,n) is, for example, the number of strings of 2n brackets which are paired correctly, so that D(3,3) = 5 corresponds to the strings [[[]]], [[][]], [[]][], [][[]], [][][]. Or, D(n,n) is the number of ways to cut a regular (n+2)-gon into triangles by joining the vertices with lines. And so on. Wikipedia has more.

All of this is quite well-known. When I did this little project back in the day, I also looked at counting the number of (n,n)-Dyck path which begin with a specified number of moves right (since they can’t by moving), and used that to compute the average number of initial moves right for an (n,n)-Dyck path, so I’ll say something about that later (p.s. it will turn out to be close to 3, at least if n is large enough).

trivia

March 10, 2009

This is pretty embarrassing but I actually spent the time to prove this thing that someone excitedly showed me. Start with any positive integer, say a_n a_{n-1} \cdots a_1 a_0 in base 10. Replace it with a_n a_n a_n + \cdots + a_1 a_1 a_1 + a_0 a_0 a_0. Eventually you’ll get to 2997.

For example,

6197506 \to 666 + 111 + 999 + 777 + 555 + 000 + 666 = 3774

\to 333 + 777 + 777 + 444 = 2331

\to 222 + 333 + 333 + 111 = 999

\to 999 + 999 + 999 = 2997.

Amazing! Truly this proves that 9 is the most mysterious number.

Anyway I wasted like 20 minutes on this so I think other people deserve to waste a few minutes on reading it. Given a positive integer n, let f(n) denote the result of the rule applied to n. What we’ll do is show that after a few steps, f(n) is a multiple of 999, and that if n is big enough, then f(n) < n, so that eventually the rule must lead to some small multiples of 999 that can be checked by hand.

Notice that if we write d(n) for the sum of the digits of n, then f(n) is just 111d(n). The most notable properties of the digit sum function d(n) are that if 3 divides n, then 3 divides d(n), and that if 9 divides n, then 9 divides d(n). These are easily proved by writing n = a_0 + 10a_1 + \cdots + 10^k a_k in base 10; since 10 \equiv 1 \pmod{3} and \pmod{9}, we get that

n \equiv a_0 + a_1 + \cdots + a_k = d(n) \pmod{3} and \pmod{9}.

In particular n = 0 \pmod{3} (resp. 9) iff d(n) = 0 \pmod{3} (resp. 9).

Now, 3 divides 111, so 3 always divides f(n) = 111d(n). Thus, by the previous sentence, 3 divides d(f(n)), and so 9 divides f(f(n)) = 111d(f(n)). Similarly, this means that 9 divides d(f(f(n))), so 999 divides f(f(f(n))) = 111d(f(f(n))). So, after at most 3 applications of the rule, we get a multiple of 999.

Because of this, we might as well assume that we started out with n being a multiple of 999. The next step is to see that f(n) is eventually smaller than n. Make the easy estimate

d(n) \leq 9\text{(number of digits of n)} \leq 9(\log_{10}(n) + 1).

Set L(n) = 999(\log_{10}(n) + 1), so that f(n) \leq L(n). One can solve L(n) = n numerically and find that L(4665) < 4665. It’s pretty clear thinking of graphs that L(n) < n will then hold for n \geq 4665, and we can be more precise by looking at derivatives: L'(n) = 999/(n\log 10) is decreasing, and L'(4665) \approx .093 < 1. Thus L'(n) < 1 for n \geq 4665, and together with L(4665) < 4665 this means L(n) < n for n \geq 4665.

That is, if we keep applying the rule to a number bigger than 4665, eventually we get to a number less than 4665. But we already saw that we only have to care about what happens to multiples of 999, and now this means we only have to care about what happens to multiples of 999 that are less than 4665. There are only 4 of those: 999, 1998, 2997, 3996, and by hand we see that applying the rule to each just once gives 2997.

I will see you at the Fields medal ceremony.

here are some roman coins that I have

March 2, 2009

I don’t know where they came from but I have them. Maybe they’re fake? This one is from the reign of Constantine I:

const

The SMANTE on the back is a mint mark: SM for Sacra Moneta, ANT for Antioch where it was minted, and apparently E for indicating it was made in the Eth (“5th”) workshop. Here’s another one:

flav

I’m sorry that this one sucks more. It was harder to identify than the Constantine one since fewer letters are visible, but I’m pretty sure it’s from the usurper Flavius Magnus Magnentius, who according to Wikipedia was around in the power gap after Constantine I’s death or something, and is listed in the category “Suicide by sharp instrument”. Anyway he looks kind of mad when I put him next to the Constantine coin.

[By the way if you are amazed at the pictures which appear to show both sides of a coin simultaneously: they do not, they are actually two pictures put together.]

hello

March 2, 2009

hello


Follow

Get every new post delivered to your Inbox.