Fluid dynamical chant

I have been invited to give a talk on fluid dynamics at Queens’ Mathematical Society this term. Details are yet to be decided, but the talk will be an introduction to fluids and a focus on boundary layers, including the mathematical notion of a singular limit.

While writing the talk, I thought it might be nice to have a little fun with it.

fluids-chant

The flow of a | fluid is | governèd
By the interact-si | -on of | four main | forces:
Viscosity * gravity * inert-si- | -a and | pressure.
Depending on the context | one may | dominate an- | -other.

In fast flows | or large | lengthscales
Inert-si- | -a is | domin- | -ant
These include many im- | -portant | contexts
Such as household plumbing * oil pipelines * submar- | -ines : and the | upper | atmosphere.

Unfortunately * the | limit of | Reynolds number
Going to infinity | is a | singular | limit.
The behaviour of an in- | -viscid | fluid
Is quite different from | that of | one with low vis- | -cosity.

A problem for the Sorting Hat

My secondary school, CRGS, admits (or used to admit–I’m not sure now) 100 people each year (technically, 96+4). They are to be split into h = 4 houses, such that the houses have equal numbers and siblings are in the same house as each other. What happens if they have a year of fifty pairs of twins, or twenty-five sets of quadruplets?

(I believe there’s also a condition on how the four houses should be distributed evenly across the forms, but for simplicity let us ignore it.)

More serious question: Let us call an intake unresolvable if the two conditions cannot be satisfied. For a given probability distribution of twins, triplets, etc., consider the probability P(n) that an intake of hn people will be unresolvable. What values of n are local minima of P(n)?

Fractal awfulness

The mathematical justification for the adage ‘never read the comments’ is the notion of ‘fractal awfulness’. This says that there exist arbitrarily petty people that have misguided or bigoted views about decreasingly small communities, and that their inflammatory language and style are all self-similar to each other.

It would be interesting to look for a scaling law between ‘number of people who have/identify as X’ and ‘number of people who have a negative view of people who have/identify as X’.

A spectral solver for Schrödinger’s equation

Here is a MATLAB program for solving the 1D time-dependent Schrödinger equation:
http://jftsang.com/code/schrodinger_spectral.m

You can specify a potential function and an initial condition, and the solver calculates the wavefunction at future times. Hopefully this will be useful for getting some intuition as to how solutions to Schrödinger’s equation behave.

Details

The solver uses a spectral method which performs the time-integration exactly. Errors come from the spatial discretisation. The calculation is done in a periodic domain, so edge effects may affect your solution, especially in scattering problems.

Postprocessing

Fourier-transforming the solution in space tells you about the relative strengths of different wavenumber components of the solution, and therefore about the momentum distribution at each time.

Fourier-transforming in time tells you about the different frequency components in the solution, which you can use to identify energy eigenstates. Note that you might have to calculate the solution for a long time before you have enough periods for the Fourier transform to be precise enough.

Not-so-continuum mechanics: A talk for the LMS

I will be speaking at the London Mathematical Society’s Graduate Students’ Meeting tomorrow morning, on Not-so-continuum mechanics: Mathematical modelling of granular flows. It’s meant to be a gentle introduction to granular phenomena, and I will introduce a basic version of the μ(I) rheology, a fairly (but not universally!) successful description of granular flow. Here’s a practice version of the talk.

The talks are meant to be aimed at `a general mathematical audience’. My talk assumes no mathematical knowledge beyond A-level Mechanics. I’m having some trouble understanding some abstracts for the other talks, and I’m not sure if my talk is just better-aimed at a general audience, or if theirs are, and there are just huge gaps in my mathematical training (which there are: I’ve never done any algebra beyond basic group theory, or any number theory or combinatorics).

Genesis, academia version

In the beginning, God created the universe. On the first day, God said: ‘Let there be light.’ And there was light. And God saw the light, that it was good.

On the second day, God made the firmament to divide the waters which were under the firmament from the waters which were above the firmament.

On the third day, God created the dry land, and the trees, flowers and grass, and saw that it was good.

On the fourth day, God created the sun, the moon and the stars, and introduced the seasons.

Whilst doing so, the Head of Department (on whose right hand sits God) asked him to review a number of funding proposals, which meant he didn’t have time to make more stars to fill up the vast void of space.

On the fourth evening, God noticed a bug with the light code that meant that the speed of the light from distant stars depended on the season. So he stayed up late fixing that.

On the fifth day, God unexpectedly had to give a lecture because his colleague went to a conference without telling anybody.

On the sixth day, God was creating Man, and was trawling through pages and pages of Matlab documentation when a system administrator decided it was time for a server reboot. The code for telepathy has been lost.

On the seventh day, God finally had some time to catch up with a huge number of emails. Undergraduates will understand why human supplications seldom receive a response.

Counting semiprimes

The prime-counting function \pi(n) returns the number of prime numbers less than or equal to n. The prime number theorem gives the asymptotic behaviour \pi(n)\sim n/\log n.

We shall call a number semiprime if it is the product of two primes. Let \omega(n) denote the semiprime-counting function. What is the asymptotic behaviour of \omega(n)? I claim that

\omega(n) \sim \frac{n}{\log n} \log\left( \frac{\log n}{\log 2} \right)

Edit (17 September 2016) Based on experiments in Mathematica, the above seems to be a lower bound, while an upper bound is given by

\omega(n) \sim \frac{n \log \log n}{\log n}

I obtain these by the following heuristic, probabilistic argument. The probability that a random integer chosen between 1 and n is \pi(n)/n \sim 1/\log n; loosely, this means that the probability of a randomly chosen large number n is approximately 1/\log n. Similarly, \omega(n) / n is the probability that a randomly-chosen m < n is semiprime.

An exact formula for \omega(n) is

\omega(n) = \sum_{x=2}^{n/2} \sum_{y=2}^{n/x} 1(xy \text{ is prime}) = \frac{1}{2} \sum_{x=2}^{n/2} \sum_{y=2}^{n/x} 1(x \text{ is prime}) 1(y \text{ is prime}).

The sum over y is trivially \pi(n/x) \sim (n/x)/(\log n - \log x). Hence

\omega(n) \sim \sum_{x=2}^{n/2} 1(x \text{ is prime}) \frac{n}{x (\log n - \log x)}.

We split the sum at x = \sqrt n into two parts, and assume that the first part is dominated by the second. In the second part, x is large and we invoke 1(x \text{ is prime}) \sim 1/\log x and approximate the sum as an integral, to get

\omega(n) \sim \int_{\sqrt n}^{n/2} \frac{n}{x \log x (\log n - \log x)} dx.

Evaluating the integral and keeping only the highest-order terms, we get the desired formula.

The semiprime-counting function can be implemented in Mathematica by

SemiprimeQ[n_] := SemiprimeQ[n] = Module[{f},
    f = FactorInteger[n];
    (
     ((Length[f] == 2) && (Total[Last /@ f] == 2))
        || ((Length[f] == 1) && f[[1]][[2]] == 2) )
    ];

w[n_] := w[n] = Length[Select[Range[n], SemiprimeQ]]

(where we memoise the results to speed things up). The following code produces a graph showing the validity of these approximation:

W1[n_] := n/Log[n] Log[Log[n]];
W2[n_] := n/Log[n] Log[Log[n]/Log[2]];
nn = 150000; nj = 500;
Show[
 ListPlot[Table[{n, w[n]/W1[n]}, {n, 1, nn, nj}],
   PlotStyle -> Red],
 ListPlot[Table[{n, w[n]/W2[n]}, {n, 1, nn, nj}],
   PlotStyle -> Green]
 ]

Speed dating and graph theory

Suppose you are organising a speed dating event. You are given a graph G = (S,P). The event consists of a number of rounds; in the ith round of the event, you must pick a subset P_i\in P such that no s\in S appears in two elements of P_i, and P_i\cap P_j = \varnothing for all j < i. (That is, no person may be in two dates at the same time, and the same date may not occur in two rounds.) The event lasts for R rounds, finishing when \cup_{1\leq i\leq R} P_i = P. (That is, when all possible dates have occurred). The ‘idle time’ is defined as T = \sum_{1\leq i\leq R} \sum_{s\in S} 1(s \not\in p \forall p\in P_i).

For example, consider an event for M straight men and N straight women. Then G is the complete bipartite graph K_{M,N}, and a simple solution is to have all the men seated around the inside of a ring-shaped table, all the women around the outside, and to have one set rotate around after each round while the other set stays still. In this case, R = \max(M,N) and T = R |M-N|.

How can you choose the P_i to minimise T?