Bubbles Bad; Ripples Good

… Data aequatione quotcunque fluentes quantitates involvente fluxiones invenire et vice versa …

Category: Disseminating mathematics

Heat ball

There are very few things I find unsatisfactory in L.C. Evans’ wonderful textbook on Partial Differential Equations; one of them is the illustration (on p.53 of the second edition) of the “heat ball”.

The heat ball is a region with respect to which an analogue of the mean value property of solutions to Laplace’s equation can be expressed, now for solutions of the heat equation. In the case of the Laplace’s equation, the regions are round balls. In the case of the heat equation, the regions are somewhat more complicated. They are defined by the expression

\displaystyle E(x,t;r) := \left\{ (y,s)\in \mathbb{R}^{n+1}~|~s \leq t, \Phi(x-y, t-s) \geq \frac{1}{r^n} \right\}

where \Phi is the fundamental solution of the heat equation

\displaystyle \Phi(x,t) := \frac{1}{(4\pi t)^{n/2}} e^{- \frac{|x|^2}{4t}}.

In the expressions above, the constant n is the number of spatial dimensions; r is the analogue of the radius of the ball, and in E(x,t;r), the point (x,r) is the center. Below is a better visualization of the heat balls: the curves shown are the boundaries \partial E(0,5;r) in dimension n = 1, for radii between 0.75 and 4 in steps of 0.25 (in particular all the red curves have integer radii). In higher dimensions the shape is generally the same, though they appear more “squashed” in the t direction.

1-dimensional heat balls centered at (0,5) for various radii. (Made using Desmos)

Abusing JabRef to manage snipplets of TeX

I use JabRef as my reference manager. In this post, however, I will discuss how we can abuse it to do some other things.

The problem

Let’s start with a concrete example: I keep a “lab notebook”. It is where I document all my miscellaneous thoughts and computations that come up during my research. Some of those are immediately useful and are collected into papers for publication. Some of those are not, and I prefer to keep them for future reference. These computations range over many different subjects. Now and then, I want to share with a collaborator or a student some subset of these notes. So I want a way to quickly search (by keywords/abstract) for relevant notes, and that compile them into one large LaTeX document.

Another concrete example: I am starting to collect a bunch of examples and exercises in analysis for use in my various classes. Again, I want to have them organized for easy search and retrieval, especially to make into exercise sheets.

The JabRef solution

The “correct” way to do this is probably with a database (or a document store), with each document tagged with a list of keywords. But that requires a bit more programming than I want to worry about at the moment.

JabRef, as it turns out, is sort of a metadata database: by defining a customized entry type you can use the BibTeX syntax as a proxy for JSON-style data. So for my lab notebook example, I define a custom type lnbentry in JabRef with

  • Required fields: year, month, day, title, file
  • Optional fields: keywords, abstract

I store each lab notebook entry as an individual TeX file, whose file system address is stored in the file field. The remaining metadata fields’ contents are self-evident.

(Technical note: in my case I actually store the metadata in the TeX file and have a script to parse the TeX files and update the bib database accordingly.)

For generating output, we can use JabRef’s convenient export filter support. In the simplest case we can create a custom export layout with the main layout file containing the single line

\\input{\file}

with appropriate begin and end incantations to make the output a fully-formed TeX file. Then one can simply select the entries to be exported, click on “Export”, and generate the appropriate TeX file on the fly.

(Technical note: JabRef can also be run without a GUI. So one can use this to perform searches through the database on the command line.)

Riemann-, Generalized-Riemann-, and Darboux-Stieltjes integrals

(The following is somewhat rough and may have typos.)

Let us begin by setting the notations and recalling what happens without the Stieltjes part.

Defn (Partition)
Let I be a closed interval. A partition P is a finite collection of closed subintervals \{I_\alpha\} such that

  1. P is finite;
  2. P covers I, i.e. \cup P = I;
  3. P is pairwise almost disjoint, i.e. for I_\alpha, I_\beta distinct elements of P, their intersection contains at most one point.

We write \mathscr{P} for the set of all partitions of I.

Defn (Refinement)
Fix I a closed interval, and P, Q two partitions. We say that P refines Q or that P \preceq Q if for every I_\alpha\in P there exists J_\beta \in Q such that I_\alpha \subseteq J_\beta.

Defn (Selection)
Given I a closed interval and P a partition, a selection \sigma: P \to I is a mapping that satisfies \sigma(I_\alpha) \in I_\alpha.

Defn (Size)
Given I a closed interval and P a partition, the size of P is defined as |P| = \sup_{I_\alpha \in P} |I_\alpha|, where |I_\alpha| is the length of the closed interval I_\alpha.

Remark In the above we have defined two different preorders on the set \mathscr{P} of all partitions. One is induced by the size: we say that P \leq Q if |P| \leq |Q|. The other is given by the refinement P\preceq Q. Note that neither are partial orders. (But that the preorder given by refinement can be made into a partial order if we disallow zero-length degenerate closed intervals.) Note also that if P\preceq Q we must have P \leq Q.

Now we can define the notions of integrability.

Defn (Integrability)
Let I be a closed, bounded interval and f:I \to \mathbb{R} be a bounded function. We say that f is integrable with integral s in the sense of

  • Riemann if for every \epsilon > 0 there exists P_0\in \mathcal{P} such that for every P \leq P_0 and every selection \sigma:P \to I we have
    \displaystyle \left| \sum_{I' \in P} f(\sigma(I')) |I'| - s \right| < \epsilon

  • Generalised-Riemann if for every \epsilon > 0 there exists P_0 \in \mathcal{P} such that for every P \preceq P_0 and every selection \sigma: P\to I we have
    \displaystyle \left| \sum_{I' \in P} f(\sigma(I')) |I'| - s \right| < \epsilon

  • Darboux if
    \displaystyle \inf_{P\in\mathscr{P}} \sum_{I' \in P} (\sup_{I'} f )|I'| = \sup_{P\in\mathscr{P}} \sum_{I' \in P} (\inf_{I'} f )|I'| = s

From the definition it is clear that “Riemann integrable” implies “Generalised-Riemann integrable”. Furthermore, we have clearly that for a fixed P
\displaystyle \sum_{I' \in P} (\inf_{I'} f) |I'| \leq \sum_{I' \in P} f(\sigma(I')) |I'| \leq \sum_{I' \in P} (\sup_{I'} f) |I'|
and that if P \preceq Q we have
\displaystyle \sum_{I' \in Q} (\inf_{I'} f) |I'| \leq \sum_{I' \in P} (\inf_{I'} f) |I'| \leq \sum_{I' \in P} (\sup_{I'} f) |I'| \leq \sum_{I' \in Q} (\inf_{I'} f) |I'|
so “Darboux integrable” also implies “Generalised-Riemann integrable”. A little bit more work shows that “Generalised-Riemann integrable” also implies “Darboux integrable” (if the suprema and infima are obtained on the intervals I', this would follow immediately; using the boundedness of the intervals we can find \sigma such that the Riemann sum approximates the upper or lower Darboux sums arbitrarily well.

The interesting part is the following
Theorem
Darboux integrable functions are Riemann integrable. Thus all three notions are equivalent.

Proof. Let P, Q be partitions. Let |P| \leq \inf_{I'\in Q, |I'| \neq 0} |I'|, and let m be the number of non-degenerate subintervals in Q. We have the following estimate
\displaystyle   \sum_{I'\in Q} (\inf_{I'} f) |I'| - (m-1) |P| (\sup_I 2|f|) \leq \sum_{J'\in P} f(\sigma(J')) |J'| \leq \sum_{I'\in Q} (\sup_{I'} f) |I'| + (m-1) |P| (\sup_I 2|f|)
The estimate follows by noting that “most” of the J'\in P will be proper subsets of I'\in Q, and there can be at most m-1 of the J' that straddles between two different non-degenerate sub-intervals of Q. To prove the theorem it suffices to choose first a Q such that the upper and lower Darboux sums well-approximates the integral. Then we can conclude for all P with |P| sufficiently small the Riemann sum is almost controlled by the Q-Darboux sums. Q.E.D.

Now that we have recalled the case of the usual integrability. Let us consider the case of the Stieltjes integrals: instead of integrating against \mathrm{d}x, we integrate against \mathrm{d}\rho, where \rho is roughly speaking a “cumulative distribution function”: we assume that \rho:I \to \mathbb{R} is a bounded monotonically increasing function.

The definition of the integrals are largely the same, except that at every step we replace the width of the interval |I'| by the diameter of \rho(I'), i.e. \sup_{I'} \rho - \inf_{I'} \rho. The arguments above immediately also imply that

  • “Riemann-Stieltjes integrable” implies “Generalised-Riemann-Stieltjes integrable”
  • “Darboux-Stieltjes integrable” implies “Generalised-Riemann-Stieltjes integrable”
  • “Generalised-Riemann-Stieltjes integrable” implies “Darboux-Stientjes integrable”

However, Darboux-Stieltjes integrable functions need not be Riemann-Stieltjes integrable. The possibility of failure can be seen in the proof of the theorem above, where we used the fact that |P| is allow to be made arbitrarily small. The same estimate, in the case of the Stieltjes version of the integrals, has |P| replaced by \sup_{J'\in P} (\sup_{J'} \rho - \inf_{J'} \rho), which for arbitrary partitions need to shrink to zero. To have a concrete illustration, we give the following:

Example
Let I = [0,1]. Let \rho(x) = 0 if x < \frac12 and 1 otherwise. Let f(x) = 0 if x \leq \frac12 and 1 otherwise. Let Q_0 be the partition \{ [0,\frac12], [\frac12,1]\}. We have that
\displaystyle \sum_{I'\in Q_0} (\sup_{I'} f) (\sup_{I'} \rho - \inf_{I'} \rho) = 0 \cdot (1 - 0) + 1\cdot (1 - 1) = 0
while
\displaystyle \sum_{I'\in Q_0} (\inf_{I'} f) (\sup_{I'} \rho - \inf_{I'} \rho) = 0 \cdot (1-0) + 0 \cdot(1-1) = 0
so we have that in particular the pair (f,\rho) is Darboux-Stieltjes integrable with integral 0. However, let k be any odd integer, consider the partition P_k of [0,1] into k equal portions. Depending on the choice of the selection \sigma, we see that the sum can take the values
\displaystyle \sum_{I'\in P_k} f(\sigma(I')) (\sup_{I'} \rho - \inf_{I'}\rho) = f(\sigma([\frac12 - \frac1{2k},\frac12 + \frac1{2k}])) (1 - 0) \in \{0,1\}
which shows that the Riemann-Stieltjes condition can never be satisfied.

The example above where both f and \rho are discontinuous at the same point is essentially sharp. A easy modification of the previous theorem shows that
Prop
If at least one of f,\rho is continuous, then Darboux-Stieltjes integrability is equivalent to Riemann-Stieltjes integrability.

Remark The nonexistence of Riemann-Stieltjes integral when f and g has shared discontinuity points is similar in spirit to the idea in distribution theory where whether the product of two distributions is well-defined (as a distribution) depends on their wave-front sets.

Decay of Waves IV: Numerical Interlude

I offer two videos. In both videos the same colour scheme is used: we have four waves in red, green, blue, and magenta. The four represent the amplitudes of spherically symmetric free waves on four different types of spatial geometries: 1 dimension flat space, 2 dimensional flat space, 3 dimensional flat space, and a 3 dimensional asymptotically flat manifold with “trapping” (has closed geodesics). Can you tell which is which? (Answer below the fold.)

Read the rest of this entry »

What’s wrong with tests

What is mathematical literacy?

There is a wonderful mathematics joke, usually told about Von Neumann, but sometimes with other mathematicians swapped in, it features the following math problem

A train is traveling west at 70 miles per hour, and a train is traveling east at 80 miles an hour. They started 300 miles apart. A fly decided to challenge itself and, at 100 miles per hour, flew from the west-bound train train to the other, and then back, and then forward, and then back, until the two trains passed each other. (An exercise path that is somewhat akin to what we call “suicides” in high school swim practice.) Question: what is the total distance traveled by the fly?

There are two ways to do this problem.

  1. The brute-force way. The fly and the east-bound train are moving toward each other at 180mph. Starting at 300 miles apart they would meet after 300/180 = 100/60 hours = 100 minutes, during which the fly would have traveled 500/3 miles, and the west bound train 350/3 miles. After the fly turned around, it will be 50 miles (= 500/3 – 350/3) from the west-bound train and they head toward each other at 170 miles per hour, so they would meet after 5/17 hours, during which the fly traveled 500/17 miles and the east-bound train 400/17. Now 100/17 miles apart the fly and the east-bound train head toward each other at 180mph and…

    This eventually leads to an infinite series which one can potentially sum geometrically and arrive at a final answer. Or,

  2. The “smart” way. The two trains move toward each other at 150 miles per hour. It takes 2 hours until they meet. The fly, traveling at 100mph, much have traveled a total of 200 miles during the trip.

The “joke” is usually told with some joker, say dear old Feynman, posing this mathematical problem to some more serious-minded mathematician, often renown for his computational abilities (say Von Neumann). The mathematician would reply instantly 200 miles. The joker would be disappointed and complain that the mathematician had heard this question before and somehow knew “the trick”, upon which the mathematician replies: “What trick? It wasn’t that hard to sum the series.”

I just came back from teaching an exercise course (in Princeton language, a precept), and the official answer to one of the exercises reminded me of the above problem. Here is the question:

You are given a biased coin which lands on tails with probability p. You flip the coin until you get heads, and record the number of tosses. (a) What is the probability that the number of tosses is exactly n? (b) What is the probability that the number of tosses is greater than or equal to n?

Part (a) is standard: for n total tosses, the nth toss is heads and the rest are tails. So the probability is p^{n-1}(1-p), representing n-1 successive tails followed by a single heads.

The official answer to part (b) is this: The probability of number of tosses is at least n is the sum

\displaystyle \sum_{k = n}^\infty P( X = k ) = \sum_{k = n}^{\infty} p^{k-1}(1-p)

which after summing the geometric series we arrive at p^{n-1}.

Here’s what I thought after seeing the question: for at least n total tosses, the first n-1 must be all tails. After which the tosses don’t matter: either one eventually ends up with heads at some finite time, in which case it is counted as some finite k = N event, or one never hits heads, in which cases the probability is vanishingly small. So the probability is exactly the probability of getting exactly n-1 tails in a row, which is p^{n-1}.

Just like the fly problem, one of the solutions brute forces the answer, the other try to “reason” away the computational bits until one is left with a simple computation which can be done quickly in one’s head.

Which of these is mathematical literacy? Read the rest of this entry »

What is a function anyway?

I tried to teach differential geometry to a biophysicist friend yesterday (at his request; he doesn’t really need to know it, but he wanted to know how certain formulae commonly used in their literature came about). Rather surprisingly I hit an early snag. Hence the title of this entry.

Part of the problem was, as usual, my own folly. Since he is more interested in vector fields and tensor fields, I thought I can take a short cut and introduce notions more with a sheafy flavour. (At the end of the day, tangent and cotangent spaces are defined (rather circularly) as dual of each other, and each with a partial, hand-wavy description.) I certainly didn’t expect having to spend a large amount of time explaining the concept of the function.
Read the rest of this entry »

Why learn maths?

There is a quite well-known joke that goes something like this: a mathematician, a physicist, and an engineer are each handed a little red rubber ball, and are told to find out its volume. The mathematician takes a caliper and measures the diameter of the ball, and uses the formula V = \frac{1}{6}\pi d^3. The physicist applies Archimedes’ principle: he submerges the ball in oil, and measures the displacement. The engineer goes back to his lab, walks over to the bookshelf, and opens this gigantic leather-bound volume to the Table of Little-red-rubber-balls.

To continue my earlier rant, it appears that I am not the only one to think that modern mathematics education is misguided. It took Underwood Dudley (warning: a subscription to the AMS Notices is required to access the PDF file) 8 pages to get to it, but in the end, he comes to the same conclusion as I did, albeit from a different starting point. The joke above is meant to illustrate Professor Dudley’s main argument, that despite grandiose claims by the National Academy of Science or the National Research Council, a mathematics education does not provide a practical skill set that is necessary for most jobs. (I will come back to the emphasis on the word “practical” in a bit.) With many examples, Dudley’s essay illustrates a common fallacy, that mathematics is important to learn because frequently in life (especially at work) one will encounter situations which calls for computations beyond basic arithmetic.

Perhaps I should make the distinction clear here: I am not claiming that mathematics education is useless. I am just observing that fact of life that most people, going about their everyday lives, will very infrequently, if ever, encounter a situation that requires the finer understanding of mathematics beyond the middle school level (US; elementary school for East Asia). And therefore we, as scientists/mathematicians/educators/parents, should not oversell the learning of mathematics as something crucial to one’s future, and bully the kids into studying it. Or, in other words, while I think that familiarity, nay, fluency, with mathematical concepts is a requirement for a well-educated man, I do not consider erudition to be a requirement to lead a productive life in society.

The mathematical curriculum (and by extension the physical sciences and history and all other of the more academic classes in American schools) should not invent reasons to convince the students that mathematics is used in all facets of life, and hence important. The knowledge of how to change a flat tire is likely to be much more practical for the average Joe over his lifetime, than the knowledge of how to solve the quadratic equation. (Most of what you need to know to succeed in life, you learn in kindergarten anyway.) That people come to question what goes into the general education based on potential on-the-job utility is completely misguided. A general education for the populace should not be equated with vocational training. A general education should train the students in the ability to reason, to think soundly, to approach problems logically. A flexible mind that is open to new ideas and is capable of solving problems is an asset applicable to any job. By narrow-mindedly restricting one’s attention to the immediate and direct applications of classroom subjects, one runs the risk of missing the grander picture in which the whole is more than just the sum of its parts.

Healthy skepticism

Besicovitch once said that “A mathematician’s reputation rests on the number of bad proofs he has given.” Of course, originating from someone educated in the Russian school, the word “bad” in the quote should probably be taken to mean “inelegant”. However, lack of beauty is certainly not the only possible deficiency in the quality of a published result. Cases abound where a proof is bad not in the aesthetics, but in something more fundamental. Read the rest of this entry »