I’m happy to say that I recently uploaded a paper to the arXiv under the title “A conformal Skorokhod embedding” (https://arxiv.org/abs/1905.00852). In this post, I’d like to explain what the Skorokhod embedding problem is, how I came across it, some previously known solutions, and my own tiny contribution. But really, all of this is just a sorry excuse to post some pretty images which come up along the way. I’ll try to write a fairly self-contained exposition, leaving the sketch of the technical details to the very end.

**Brownian motion and the Skorokhod embedding**

Our main player in all of this is Brownian motion. Named after Robert Brown, it is the probabilistic community’s industry-approved gold-standard for diffusions, Markov chains, and random walks. Basically, a Brownian motion path is the position of a particle as a function of time , where at each moment the particle’s direction and speed is random and uncorrelated with whatever direction and speed it had before.

If the particle is travelling in one dimension, its path as a function of time might look like this:

In two dimensions, the path might look like this (now it is more difficult to draw the time axis, so different times are represented by color, with blue at the beginning and purple at the end):

One mathematical way of describing Brownian motion is as follows. Suppose that a particle starts at position and performs the following simple random walk: Once every second, it jumps 1 unit to the left with probability 0.5, and 1 unit to the right with probability 0.5. Now consider a second particle, which randomly jumps *twice* per second, but each time it makes a jump of size . We can can similarly imagine a series of particles, with the -th particle jumping left or right times per second, and each jump is of size . As , the path we see converges to a Brownian motion (sort of).

This random-walk description can also be done in two or three or any number of dimensions. A very nice property of mutli-dimensional Brownian motion is that it is just composed of a bunch of individual, independent one-dimensional Brownian motions – one for each direction.

Mathematicians take quite a fancy to Brownian motion, and for many reasons: Because it is simple (so far as stochastic processes go), because it appears almost everywhere, and because it is the natural scaling limit of random walks, to name a few. But mostly, they like it because they can prove things about it, and the mathematical literature is filled with questions (and sometimes, even answers) about how many times Brownian motions hit a point, or how two such motions intersect each other, or how to integrate, solve differential equations, and make coffee using Brownian motion.

Skorokhod, being a mathematician, was no exception. He was interested in the following question. Suppose you wanted to flip a coin, that is, randomly get either Heads (which we denote by the number “1”) or Tails (which we denote by the number “-1”). You reach into your pocket searching for a coin, but are both amazed and abashed to discover that you only have a Brownian motion on you. Could you somehow simulate a coin flip using ?

The answer is: Yes! Here is Skorokhod’s way of doing it: Since Brownian motion is symmetric, meaning it has equal probability of being at either or at time , we can wait until , that is, until the motion “hits” either or . By symmetry, there is a 50% chance of getting either result!

Doing something like the above is called **stopping** the Brownian motion, and the time at which we stop it is called a **stopping time**. Note that this is a *random* time, which actually depends on the randomness imbued in the Brownian motion: For one particular run it may be that has magnitude quite quickly, and for other runs it may be that takes a long while to get there.

Skorokhod was interested in a generalization: Suppose that instead of just flipping a coin, you wanted to simulate some other, general, probability distribution. Can you simulate a continuous distribution, such as a Gaussian distribution? How about a discrete one, like a geometric distribution? Or what about nasty, everywhere-non-differentiable yet non-atomic distributions, demons from beyond the depth of Hell for which humankind has no name? (I’m looking at you, Mr. Every-Rational-Number-Has-Positive-Weight-Distribution)

The answer is: Yes! (with one small caveat on the variance) And you can do it by using stopping times, too:

**Theorem:** Let be a probability distribution with zero mean and finite variance. Then, given Brownian motion , there exists a (random) stopping time so that distributes like .

This theorem is often called Skorokhod’s embedding theorem (which to me always sounded like a Dungeons and Dragons spell), probably because it embeds some other distribution inside Brownian motion.

Over the years there have been many proofs and generalizations of this theorem. Below are my two favorites (which you can (but shouldn’t) skip if you accidentally just want to see my solution (gosh, I’m blushing!))

**Two cool solutions**

#### **First cool solution**

The first cool solution is by Dubins. We already know when to stop Brownian motion when we want to get the Bernoulli distribution, i.e when we want to get with probability and with probability : You just run the Brownian motion until . But what would you do if you wanted (say) to get a distribution which attains the values , each with probability ? Well, Dubins has an answer for you!

Dubins says this: First, run the Brownian motion until , and mark the time you stopped as . By the same reasoning as the coin flip, we will have that is with probability , and with probability . Now run the Brownian motion again, from wherever it is that you stopped it, and notice this: If at time it started at position , then and surround it just like and surround , and we already know how to solve that problem: Just run the motion again until it hits either or , and denote the time it took by . Similarly, if at time the motion was at , then stop it once it gets to either or .

Actually, since and , we can phrase our Skorokhod stopping time as follows: First, let the Brownian motion run until it hits either or . After it does this (and only after it does this), run it again until it hits one of the numbers . So the overall stopping time is the sum of two individual stopping times: .

This argument generalizes quite naturally to almost any probability distribution. Here I’ll show a continuous example. The following image is the density function of some distribution (a continuous histogram of the distribution, if you will):

The distribution can be divided into two parts: The positive numbers, and the negatives. We can compute the normalized mean of each part, that is, compute and . Overlaid on the density function, they lie somewhere like this:

So as a first step, run the Brownian motion until it hits one of the pink lines. For the sake of this example, let’s suppose that you hit the positive side.

Having done that, we now restrict ourselves, and say: Wherever else the Brownian motion will go, we will never return to the negative number range. The negative numbers are dead to us! (because we will make sure to always stop before we reach them). The remaining probability mass can be normalized, giving us a new distribution:

We can repeat this process again. If we hit the left barrier this time,

then we are left with the following:

Repeat at leisure. You can leave it to Dubins to prove that this process converges, and the final stopping time will be equal to infinitely many, shorter and shorter stopping times,

You can read Dubins’ original paper here.

#### Second cool solution

The second cool solution is by Root. Root also generalizes the Bernoulli solution, but in a different way. He basically says the following: Let’s look at the graph . Since we stop the Brownian motion the moment its magnitude becomes , we can think that the two infinite lines and form a “barrier” to the Brownian motion:

The stopping time is then just first time that the Brownian motion hits the barrier lines. Root then had the idea that perhaps every distribution can be obtained by looking at the first time that the graph of the Brownian motion hits some (perhaps very contorted) barrier.

And he was right! I won’t go into the details, but the gist of Root’s argument is this. First he showed that such barriers exist for every atomic distribution, that is, every distribution which is supported on a finite number of numbers:

Once he had his finite collection of lines, Root proved that when taking a limit of finite atomic distributions which converge to a general distribution, the barrier converges as well.

You can read Root’s original paper here.

**How I stumbled upon the problem**

To be frank, a couple of months ago I was just an ordinary bloke, completely unaware that Skorokhod even had a problem with embeddings, not to mention that he solved it. I was working at the time on generalizing an approach used by my advisor, Ronen Eldan.

You see, Eldan, being a mathematician, also loves Brownian motion, and so much so that he uses it to manufacture practically all his other distributions, often with great success. One distribution which repeatedly comes up is the “uniform distribution on the Boolean hypercube”. This is a fancy name for the distribution on vectors of the form , where each vector has the same probability, namely, . Geometrically, each such vector is actually a vertex in the -dimensional Boolean hypercube. You can think of the uniform distribution on these vertices as a sequence of individual and independent coin flips, where each flip is either or with probability . Sounds familiar? Sure does.

So, naturally, Eldan generates the numbers by running independent Brownian motions ; whenever one of them reaches either or , he stops it. When the last Brownian motion is stopped, then all coordinates together are a uniform point on the hypercube. The nice thing about this construction is that it has a pretty geometric interpretation; like many things in math, you have to draw it to appreciate it.

It all relies on a fact we stated at the beginning, that -dimensional Brownian motion is actually comprised of independent, -dimensional Brownian motions. So we may treat Eldan’s independent Brownian motions as one multi-dimensional motion, living in . This Brownian motion starts at and wanders about until it hits one of the faces of the hypercube (i.e one of its coordinates is either or ). The moment it does that, it “sticks” to that face, since that particular coordinate doesn’t move anymore. It then continues its journey, confined to a space of one dimension less.

Here’s a representation of this process in three dimensions (so we are going to generate a random vector with three components of either s or s). We start the motion in the three dimensional hypercube (which, in this case, is just the good-ol’ ordinary cube):

After the Brownian motion hits the rightmost face, it is confined to it and continues its journey on it:

Finally, after hitting one the bottom edge, we are left with a one-dimensional Brownian motion, with which we are quite familiar:

Note that unlike before, the Brownian motion doesn’t have to start at 0 at each successive stage. For example, in this particular case, the Brownian motion hit the face of the cube at the point , so the two-dimensional motion effectively started at .

Here is the entire trajectory:

The reason that Eldan even deals with all of this high-dimensional geometry stuff, and doesn’t just take the naive perspective of “-independent tiny-weeny Skorokhod embeddings”, is that he actually takes this simple Brownian motion and adds drift to it, and then looks at geometric properties of that drift and where it makes the motion go. So geometry is crucial here. I wanted to generalize Eldan’s work so that adding this drift term would make sense not only in the discrete Boolean hypercube situation, but for more general distributions, namely: a) any discrete distribution on a finite number of elements; b) uniform / continuous distributions on . I thus needed to find a geometric structure which, when Brownian motion hit it, would give me some particular distribution that I desired. And so, as it turns out, Skorokhod’s embedding problem arose quite naturally (although I didn’t know it by its name when I started).

**My solution**

Like Root’s solution, my approach also involves looking at some geometric barrier which the Brownian motion is supposed to hit. But while Root barrier inspects when the graph hits the barrier, my solution instead looks at when a two-dimensional Brownian motion hits a barrier. As mentioned above, two-dimensional motion is made up of two independent one-dimensional motions, , so we actually have to use another process, along the way. In other words, my solution requires having additional randomness laying about. This can be seen as a slight negative – we have a natural desire for nice, clean solutions which do not use external resources. But my randomness dealers are going to have to live with it, I guess. On the plus side, my method can give some explicit examples of barriers which Root could not do, using entirely different tools.

There are two main ingredients in my construction. The first is a practical result from probability and statistics, called the “inverse sampling method”, which can be seen as a baby, non-time-dependent version of the Skorokhod embedding problem. Suppose once more that you want to flip a coin (getting the value and both with probability ). You reach into your pocket, but are again disappointed when all you come up with is the uniform distribution on . But once again, not all is lost, and you can easily simulate a coin using a random variable : If , treat it as if you flipped , and if , treat it as if you flipped . Since is uniform, both events are equally likely.

As (almost) always in mathematics, this method can be applied to general distributions , not just to silly coin flips. The key is to look at the inverse cumulative distribution. A quick reminder: If is a random variable distributed according to , i.e , then it has a cumulative distribution function , which describes the probability of being smaller than some number:

For a coin flip, the cumulative distribution is quite simple: The probability of being strictly less than is always , the probability of being between and is , and the probability of being at least is always . The cumulative distribution function looks something like this:

This is an increasing function, so we can take what is called its “generalized inverse”, , which is obtained by rotating the graph of the function about the diagonal (and ignoring vertical lines stretching out to infinity):

You must be careful with possible discontinuities and infinities, of course, but those are rather technical details which we will not touch.If you stare long enough at the inverse of the cumulative distribution function of the coin flip, you might notice something peculiar: It attains the value for half of the possible inputs, and the value for half of its possible inputs (we ignore single, isolated points). It essentially encodes the coin-flip-simulation scheme we described earlier! Instead of “looking at when is smaller than or larger than ”, we can just plug it in to and output the result .

The statement of the inverse sampling method is that this trick works for all distributions , and not just coin flips. (Slightly) more formally, for every distribution , if is a uniform random variable on , then

The second ingredient in my construction is called conformal invariance, which is a fancy name for “if you rotate something that is rotation invariant, it stays the same”. I’ll explain (but won’t go too much into the details). The plane is often identified with the complex plane , so that planar Brownian motion can be thought of as a complex process . One common thing mathematicians like to do with the complex plane is deform it, i.e apply a transformation . The well-behaving transformations are called “conformal”, and they have the peculiar property that locally, all they do to a small square is rotate it and scale it a bit.

Planar Brownian motion is rotationally invariant – it is equally likely to go in any one direction as the other. So it really doesn’t care if you rotate it at all. And since Brownian motion is self-similar (in that, if you zoom in on it, it looks the same), multiplying the motion itself by a constant is the same as “speeding up or slowing down time”: If you blow up the motion so that points that were very close to the origin are now very far, it’s equivalent to boosting up the speed of the motion, so that in a small amount of time it can zip across the plane.

Summing things up, since conformal transformations locally only scale and rotate, they don’t really do anything to Brownian motion: The rotation is shrugged off, and at most, the scaling can make it go faster or slower at some point. That’s the content of the phrase “Brownian motion is conformally invariant”: If is a Brownian motion and is a conformal complex function, then is also a Brownian motion , where is a monotone function of .

Alright! It’s time to combine the pieces. We start with the observation that if we run Brownian motion until it hits a circle of radius around the origin, it will be uniformly distributed on it. This is a direct consequence of the fact that Brownian motion is rotationally invariant. Thus, letting be the hitting time of the circle, we have that the angle of is uniform in the interval .

The inverse sampling method says that if is uniform in , then distributes as . So if we apply a function which takes a complex number as input and returns for on the unit circle, we would have that

which is the distribution we want to get!

However, these are not the rules of the game. We can’t just apply any function we want to the point after we have stopped – the whole point of Skorokhod’s theorem is to find a time so that no further modifications to the result will be needed. We want itself to distribute as , not some function of it.

Here steps in the conformal invariance. Instead of applying just the function (and getting a real number), we’ll try to find a complex-valued conformal function . The function should be defined on all of the unit disc , and satisfy that on the unit circle itself, the real part of the complex number that it returns is equal to . The imaginary part, , is basically just there in order to make the function conformal. If we apply this new to , we’ll get that the real part (i.e, the component) of distributes as by construction. The imaginary part (i.e the component) does not, but we don’t really care about it. In general, such an will map the unit disc into some other, perhaps complicated shape:

Now we are in good shape! Since is conformal, by conformal invariance is also a Brownian motion! Hence, instead of looking at when the original hits the circle, we can look at when the new motion hits the new boundary of . In this way, we circumvent the fact that we cannot modify the result after we stopped the motion – if we find a function so that applying it does not change the law of the motion, then looking at its image is the same as looking at the original motion.

That’s basically all there is to my plan of attack: Find a conformal so that the real part of distributes as . This amounts to finding a conformal which maps the unit circle to in some way. Showing that such an exists is not hard, but does require a tiny bit of work. It’s not very pretty work, but luckily, the images that result from the conformal motions are. Here are examples of the domains for the two cumulative distribution functions we saw way back in the beginning:

I won’t go deep into the details of how to obtain the desired conformal function ; that’s what the paper is for. But here is a rough sketch:

Instead of working with directly, I work with a normalized, symmetrized version of it, which in the paper I denote as . This is an even function defined on the interval . Like pretty much all functions you’ll encounter in the wild, it can be decomposed into a Fourier series, and because it’s even, it contains only cosines:

From the Fourier coefficients we build our conformal map:

This construction takes advantage of the fact that the Fourier series and the power series agree on the unit circle. Indeed, for on the unit circle, the real part of satisfies

So if the angle is distributed uniformly, we indeed get that the real part of distributes as (notice that is not an exact inverse of – it actually gives each point “twice the probability”, because of the absolute value we used when defining it, but since this factor of two is the same for all points, it cancels out). A bit of work (with complex analysis) is then required to show that satisfies all the exact properties we need.