Keywords

These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

1 Slicing a cube

In this supplemental chapter we will find the Eulerian numbers cropping up in some surprising places.

First, consider cutting up the n-dimensional cube [0, 1]n according to the braid arrangement. For example, Figure 7.1 shows this in three dimensions.

Fig. 7.1
figure 1

Slicing a cube with the braid arrangement, looking down the line \(x = y = z\).

Ignoring overlaps on the boundaries, each region here is a simplex of the form

$$\displaystyle{\mathcal{S}_{w} =\{ \mathbf{x} \in \mathbb{R}^{n}: 0 \leq x_{ w(1)} \leq x_{w(2)} \leq \cdots \leq x_{w(n)} \leq 1\},}$$

where w ∈ S n . By symmetry, each of these regions has the same volume, and since their union has volume 1, we get

$$\displaystyle{\mathop{\mathrm{vol}}\nolimits (\mathcal{S}_{w}) = \frac{1} {n!}.}$$

Now consider slicing the cube by level sets. For fixed n, and any \(k = 0,1,\ldots,n - 1\), let

$$\displaystyle{\mathcal{R}_{k} =\{ \mathbf{y} \in [0,1]^{n}: k \leq y_{ 1} + y_{2} + \cdots + y_{n} \leq k + 1\}.}$$

For three dimensions, we have illustrated these slices in Figure 7.2. The following proposition suggests how to compute the volume of these slices.

Fig. 7.2
figure 2

Slicing a cube with level sets.

Proposition 7.1.

The volume of the kth slice of the n-cube is given by:

$$\displaystyle{\mathop{\mathrm{vol}}\nolimits (\mathcal{R}_{k}) = \frac{{n\abovewithdelims\langle \rangle 0.0pt k} } {n!},}$$

where \({n\abovewithdelims\langle \rangle 0.0pt k}\) is the number of permutations of n with k descents.

This result is mentioned in Dominique Foata’s 1977 paper [67], in which he asks for a combinatorial proof. Richard Stanley provided a beautifully simple proof in a note at the end of Foata’s paper, which we describe here. (This is Problem 51 in Stanley’s textbook [154].)

Let

$$\displaystyle{\mathcal{S}_{k} =\bigcup _{\mathop{\mathrm{des}}\nolimits (w^{-1})=k}\mathcal{S}_{w},}$$

denote the union of points in the cones corresponding to permutations with k descents. We will define a map \(\phi: \mathcal{S}_{k} \rightarrow \mathcal{R}_{k}\) that is “generically” a bijection, in that it is bijective for all points such that no two coordinates are equal. (Such points have measure zero and are irrelevant for the volume calculation.)

The map is given explicitly by ϕ(x 1, , x n ) = (y 1, , y n ) with

$$\displaystyle{y_{i} = \left \{\begin{array}{@{}l@{\quad }l@{}} x_{i+1} - x_{i} \quad &\mbox{ if }x_{i} < x_{i+1}, \\ 1 + x_{i+1} - x_{i}\quad &\mbox{ if }x_{i} > x_{i+1}, \end{array} \right.}$$

where \(x_{n+1} = 1\). If \(x_{i} = x_{i+1}\) for some i, ϕ is undefined.

Suppose \(\mathbf{x} = (x_{1},\ldots,x_{n})\) is a generic point in \(\mathcal{S}_{w}\). To say that x i  > x i+1 is to say that i + 1 appears to the left of i in w, i.e., \(w^{-1}(i + 1) < w^{-1}(i)\). In other words i is a descent of w −1. Notice that if \(\mathop{\mathrm{des}}\nolimits (w^{-1}) = k\), then \(\sum y_{i} = k + 1 - x_{1}\). Thus ϕ maps points from \(\mathcal{S}_{k}\) to \(\mathcal{R}_{k}\).

For example, generic points in the region \(\mathcal{S}_{631425}\) satisfy

$$\displaystyle{0 < x_{6} < x_{3} < x_{1} < x_{4} < x_{2} < x_{5} < 1,}$$

and these get mapped to

$$\displaystyle{(y_{1},y_{2},y_{3},y_{4},y_{5},y_{6}) = (x_{2}-x_{1},1+x_{3}-x_{2},x_{4}-x_{3},x_{5}-x_{4},1+x_{6}-x_{5},1-x_{6}).}$$

The sum of the coordinates under this map is \(\sum y_{i} = 3 - x_{1}\), so \(2 <\sum y_{i} < 3\), as expected since \(\mathop{\mathrm{des}}\nolimits (w^{-1}) = 2\). Notice that on \(\mathcal{S}_{w}\), the map ϕ is an affine transformation, given here by:

$$\displaystyle{\mathbf{y} =\phi (\mathbf{x}) = \left (\begin{array}{c} 0\\ 1 \\ 0\\ 0 \\ 1\\ 1 \end{array} \right )+\left (\begin{array}{rrrrrr} - 1& 1& 0& 0& 0& 0\\ 0 & - 1 & 1 & 0 & 0 & 0 \\ 0& 0& - 1& 1& 0& 0\\ 0 & 0 & 0 & - 1 & 1 & 0 \\ 0& 0& 0& 0& - 1& 1\\ 0 & 0 & 0 & 0 & 0 & - 1 \end{array} \right )\mathbf{x}.}$$

The determinant of the linear part of this transformation has absolute value 1, so it is volume-preserving.

It remains to show that ϕ is invertible.

To reverse the map ϕ, we work from right to left, exploiting the observation that \(x_{i} = x_{i+1} - y_{i}\) or \(x_{i} = 1 + x_{i+1} - y_{i}\). Since 0 < x i  < 1, only one of these expressions can be correct. By convention \(y_{n} = 1 - x_{n}\), so we get started with \(x_{n} = 1 - y_{n}\). Otherwise, once we have calculated x i+1 we get:

$$\displaystyle{x_{i} = \left \{\begin{array}{@{}l@{\quad }l@{}} x_{i+1} - y_{i} \quad &\mbox{ if }x_{i+1} > y_{i}, \\ 1 + x_{i+1} - y_{i}\quad &\mbox{ if }x_{i+1} < y_{i}. \end{array} \right.}$$

To take an example, suppose

$$\displaystyle{\mathbf{y} = (.3,.14,.1592,.6,.53,.58,.97).}$$

Working through the coordinates one at a time we conclude that

$$\displaystyle\begin{array}{rcl} x_{7}& =& 1 - y_{7} =.03, {}\\ x_{6}& =& 1 + x_{7} - y_{6} =.45, {}\\ x_{5}& =& 1 + x_{6} - y_{5} =.92, {}\\ x_{4}& =& x_{5} - y_{4} =.32, {}\\ x_{3}& =& x_{4} - y_{3} =.1608, {}\\ x_{2}& =& x_{3} - y_{2} =.0208, {}\\ x_{1}& =& 1 + x_{2} - y_{1} =.7208\,. {}\\ \end{array}$$

One can check that these coordinates define a point in the region corresponding to w = 2734651, and applying ϕ will take \(\mathbf{x}\) back to \(\mathbf{y}\).

A more succinct way to express the inverse transformation is to collect partial sums from right to left, taking only the fractional part of the partial sum as we go:

$$\displaystyle{x_{i} = 1 -\left ((y_{i} + \cdots + y_{n})\mod 1\right ).}$$

Since the x i must be generic, we leave this inverse map undefined whenever any subset of the y j sums to an integer. But if the y j are generic, this will never happen, so for the volume calculation this set has measure zero.

We have shown that ϕ is generically bijective and volume-preserving. Thus Proposition 7.1 follows.

2 Carries in addition

The volume calculation we just carried out turns out to have a surprising application in the problem of the distribution of “carries” in addition.

Consider adding two numbers in base ten with the usual addition algorithm. As we move from right to left we “carry” a 1 to the next column if the sum in the previous column (plus the previous carried digit) adds up to ten or more. How many carries will we expect to have?

Here is the sum of two thirty digit numbers:

$$\displaystyle{\begin{array}{r r r r r r l} \mbox{ carries:}&000001&01011&11010&00101&00110&1001\\ \\ &27182&81828&45904&52353&60287&47135 \\ +& 31415&92653&58979&32384&62643&38328 \\ \hline & 58598&74482&04883&84738&22930&85463\end{array} }$$

We carried a one in thirteen of the thirty columns, or about forty-three percent of the time. Intuition tells us that we will carry a one about half the time, and this is indeed what will bear out.

But now consider adding three numbers. Here we can carry 0, 1, or 2. For example, here is the sum of three thirty digit numbers:

$$\displaystyle{\begin{array}{r r r r r r l} \mbox{ carries:}&121011&11121&12111&11102&00001&0121\\ \\ &57721&56649&01532&86060&65120&90082 \\ & 69314&71805&59945&30941&72321&21458\\ +&16449&34066&84822&64364&72415&16665 \\ \hline &143485&62521&46300&81367&09857&28205\end{array} }$$

Of the thirty columns, seven carried zero, five carried two, and eighteen carried a one. It certainly doesn’t seem that each carry is equally likely. Symmetry should suggest that carrying a zero has the same probability as carrying a two. The fact that we carry a one much more frequently is suggested by the fact that there are many more ways to obtain a number between 10 and 19 as a sum of three digits than there are ways to write a single digit number as a sum of three digits. But what exactly is the probability of getting a carry of two?

This is the problem considered by John Holte in [91]. (The title of this chapter is a nod to his fine paper.) To quote Holte’s motivating question,

What is the long-run frequency of each possible carry value when we add any number of long numbers represented in any base?

Or, when adding n random numbers in base b, what is the probability of having a carry of k? Remarkably, we will see the answer depends only on n and k, but not the base b. Let us denote the probability by p n, k .

Theorem 7.1.

When adding n numbers in base b, the probability of having a carry of k is

$$\displaystyle{p_{n,k} = \frac{{n\abovewithdelims\langle \rangle 0.0pt k} } {n!},}$$

where \(k = 0,1,\ldots,n - 1\) .

The form this answer takes suggests that we make a connection between Holte’s question and Foata’s question. That is, we will show that the volume calculation in Proposition 7.1 implies Theorem 7.1.

To see the connection, suppose we are adding n numbers in base b, and that in a particular column we add digits d 1, d 2, , d n , with 0 ≤ d i  ≤ b − 1. If we carried a j from the previous column, then to say that we carry k into the next column means

$$\displaystyle{ bk \leq j + d_{1} + d_{2} + \cdots + d_{n} < b(k + 1). }$$
(7.1)

Now split j into n equal pieces so to write

$$\displaystyle{j + d_{1} + d_{2} + \cdots + d_{n} = (d_{1} + j/n) + (d_{2} + j/n) + \cdots + (d_{n} + j/n).}$$

Since 0 ≤ j ≤ n − 1, we have 0 ≤ jn < 1 and so \(0 \leq (d_{i} + j/n) < b\). Thus, dividing (7.1) by b, we obtain

$$\displaystyle{ k \leq x_{1} + x_{2} + \cdots + x_{n} < k + 1, }$$
(7.2)

where

$$\displaystyle{0 \leq x_{i} = \frac{d_{i} + j/n} {b} < 1.}$$

Let ψ denote the map from integer n-tuples to the cube [0, 1]n given by \(\psi (d_{i}) = (d_{i} + j/n)/b\), depending on the prior carry of j in {0, 1, , n − 1}.

Thus having a carry of k corresponds to a point in the kth slice of the n-cube as discussed in Section 7.1. For fixed n and b, there are only finitely many points (j, d 1, , d n ) in \([0,n - 1] \times [0,b - 1]^{n}\). Thus, the image of these points under ψ is finite as well. We want to argue that despite the discrete nature of this problem, we can use the volume calculation to obtain the result here. This can certainly be done if our points x i are geometrically uniform in the n-cube.

If the digits d i are uniformly random in {0, 1, , b − 1}, intuition tells the points x i are distributed roughly uniformly in the interval [0, 1). While perfect uniformity won’t always occur, we get something close enough to uniform. For fixed j, \(d_{i} + j/n\) is just a slight shift away from uniform, and taking all j together splits [0, 1) into n subintervals on which the x i are identically distributed:

$$\displaystyle{[0,1/n) \cup [1/n,2/n) \cup \cdots \cup [1 - 1/n,1).}$$

So whatever the probability of having a carry of j come in, this distribution is repeated in n intervals of equal size in [0, 1), and this is good enough to conclude that probability is proportional to volume.

Hence we can conclude Theorem 7.1 from the geometric result: choosing n random digits in base b that results in a carry of k is equal to the probability of choosing a random point in the kth slice of the unit cube. However while [154] mentions this geometric argument, it was not the technique used by Holte. We present his argument next.

3 The amazing matrix

Holte’s approach to the carries problem is to view the “carries process” as a Markov chain. This is natural, since carrying a k depends only on the digits in the column being added and the number j that was carried into that column.

Thus for fixed b and n, let π(j, k) denote the probability of “carrying out” k given that we “carry in” j to a particular column. Then by (7.1),

$$\displaystyle{\pi (j,k) = \frac{\mbox{ (number of solutions $(d_{1},\ldots,d_{n})$ to (<InternalRef RefID="Equ2">7.1</InternalRef>))}} {b^{n}}.}$$

To count the integer solutions to (7.1) is to ask for the number of integer solutions to

$$\displaystyle{ c + d_{1} + d_{2} + \cdots + d_{n} = b(k + 1) - 1 - j, }$$
(7.3)

where 0 ≤ c, d 1, d 2, , d n  ≤ b − 1. If we let \(r = b(k + 1) - 1 - j\), then the number of solutions to Equation (7.3) is the coefficient of z r in

$$\displaystyle{(1 + z + z^{2} + \cdots + z^{b-1})^{n+1} = \frac{(1 - z^{b})^{n+1}} {(1 - z)^{n+1}}.}$$

Expanding both numerator and denominator as series in z, we find

$$\displaystyle\begin{array}{rcl} \frac{(1 - z^{b})^{n+1}} {(1 - z)^{n+1}} & =& \sum _{l=0}^{n+1}(-1)^{l}\binom{n + 1}{l}z^{bl}\sum _{ m\geq 0}\binom{m + n}{n}z^{m}, {}\\ & =& \sum _{m,l\geq 0}(-1)^{l}\binom{n + 1}{l}\binom{n + m}{n}z^{bl+m}, {}\\ & =& \sum _{r\geq 0}\left (\sum _{l=0}^{n+1}(-1)^{l}\binom{n + 1}{l}\binom{n + r - bl}{n}\right )z^{r}. {}\\ \end{array}$$

Given that \(\binom{n + r - bl}{n} = 0\) if r < bl, the coefficient of z r only ranges over \(l \leq r/b = k + 1 - (j + 1)/b\). We therefore have the following explicit formula for π(j, k).

Proposition 7.2.

Suppose we are adding a list of n numbers in base b. The probability of carrying out a k from one column to the next, given that we carry in a j is

$$\displaystyle{\pi (j,k) = \frac{1} {b^{n}}\sum _{0\leq l\leq k+1-(j+1)/b}(-1)^{l}\binom{n + 1}{l}\binom{n + b(k + 1 - l) - 1 - j}{n}.}$$

The transition matrix \(\varPi _{n} = (\pi (j,k))_{0\leq j,k\leq n-1}\) is what Holte calls the “Amazing matrix.” Here are the first two matrices:

$$\displaystyle{\varPi _{2} = \frac{1} {2b}\left (\begin{array}{cc} b + 1&b - 1\\ b - 1 &b + 1 \end{array} \right ),\varPi _{3} = \frac{1} {6b^{2}}\left (\begin{array}{ccc} b^{2} + 3b + 2&4b^{2} - 4&b^{2} - 3b + 2 \\ b^{2} - 1 &4b^{2} + 2& b^{2} - 1 \\ b^{2} - 3b + 2&4b^{2} - 4&b^{2} + 3b + 2 \end{array} \right ).}$$

It turns out that the matrix Π is diagonalizable, and its eigenvalues are \(1,1/b,1/b^{2},\ldots,1/b^{n-1}\), though the eigenvectors are independent of b.

Let V = V n denote the matrix such that \(V \varPi V ^{-1} = D\), with D the diagonal matrix with the indicated eigenvalues. For example, one can check

$$\displaystyle{\left (\begin{array}{rrr} 1& 4& 1\\ 1 & 0 & - 1 \\ 1& - 2& 1 \end{array} \right )\cdot \frac{1} {6b^{2}}\left (\begin{array}{ccc} b^{2} + 3b + 2&4b^{2} - 4&b^{2} - 3b + 2 \\ b^{2} - 1 &4b^{2} + 2& b^{2} - 1 \\ b^{2} - 3b + 2&4b^{2} - 4&b^{2} + 3b + 2 \end{array} \right ) = \left (\begin{array}{rrr} 1& 0& 0 \\ 0&1/b& 0 \\ 0& 0&1/b^{2} \end{array} \right )\left (\begin{array}{rrr} 1& 4& 1\\ 1 & 0 & - 1 \\ 1& - 2& 1 \end{array} \right ),}$$

so

$$\displaystyle{V _{3} = \left (\begin{array}{rrr} 1& 4& 1\\ 1 & 0 & - 1 \\ 1& - 2& 1 \end{array} \right ).}$$

Let \(V _{n} = (v(j,k))_{0\leq j,k\leq n-1}\). It turns out that

$$\displaystyle{v(j,k) =\sum _{ l=0}^{k}(-1)^{l}\binom{n + 1}{l}(k + 1 - l)^{n-j}.}$$

The matrices V 4 and V 5 are shown here:

$$\displaystyle{V _{4} = \left (\begin{array}{rrrr} 1& 11& 11& 1\\ 1 & 3 & - 3 & - 1 \\ 1& - 1& - 1& 1\\ 1 & - 3 & 3 & - 1 \end{array} \right ),V _{5} = \left (\begin{array}{rrrrr} 1& 26& 66& 26& 1\\ 1 & 10 & 0 & - 10 & - 1 \\ 1& 2& - 6& 2& 1\\ 1 & - 2 & 0 & 2 & - 1 \\ 1& - 4& 6& - 4& 1 \end{array} \right ).}$$

Notice the Eulerian numbers appearing in the top row! This is because if j = 0,

$$\displaystyle{v(0,k) =\sum _{ l=0}^{k}(-1)^{l}\binom{n + 1}{l}(k + 1 - l)^{n},}$$

which is the formula given in Equation (1.11) for the Eulerian number \({n\abovewithdelims\langle \rangle 0.0pt k}\).

For fixed j, v(j, k) is the coefficient of t k in

$$\displaystyle{\left (\sum _{l\geq 0}(-1)^{l}\binom{n + 1}{l}t^{l}\right )\left (\sum _{ m\geq 0}(m + 1)^{n-j}t^{m}\right ) = (1 - t)^{n+1} \frac{S_{n-j}(t)} {(1 - t)^{n+1-j}},}$$

where the second sum is the Carlitz identity given in Equation (1.10). Thus we have a simpler way to describe the entries of V:

$$\displaystyle{\sum _{k\geq 0}v(j,k)t^{k} = (1 - t)^{j}S_{ n-j}(t),}$$

where S nj (t) is the Eulerian polynomial.

Now let us verify that V Π = DV.

We want to show that

$$\displaystyle{\sum _{k=0}^{n-1}v(j,k)\pi (k,l) = \frac{v(j,l)} {b^{j}},}$$

for 0 ≤ j, l ≤ n − 1.

Using the formulas we’ve derived, we have

$$\displaystyle\begin{array}{rcl} \begin{array}{rl} \sum _{k=0}^{n-1}v(j,k)\pi (k,l)& = \frac{1} {b^{n}}\sum _{k=0}^{n-1}\sum _{ m=0}^{l+1-(k+1)/b}(-1)^{m}\left (\begin{array}{c} n + 1 \\ m \end{array} \right )\left (\begin{array}{c} n - 1 - k + (l + 1 - m)b\\ n \end{array} \right )v(j,k), \\ & = \frac{1} {b^{n}}\sum _{m=0}^{l}(-1)^{m}\left (\begin{array}{c} n + 1 \\ m \end{array} \right )\sum _{k=0}^{(l+1-m)b-1}\left (\begin{array}{c} n - 1 - k + (l + 1 - m)b \\ n \end{array} \right )v(j,k).\end{array} & &{}\end{array}$$
(7.4)

If we let \(M = (l + 1 - m)b - 1\), we can rewrite the inner sum here as

$$\displaystyle{\sum _{k=0}^{M}\binom{n + M - k}{n}v(j,k),}$$

which we can recognize as the coefficient of t M in

$$\displaystyle{\left (\sum _{r\geq 0}\binom{n + r}{n}t^{r}\right )\left (\sum _{ k\geq 0}v(j,k)t^{k}\right ) = \frac{1} {(1 - t)^{n+1}}(1 - t)^{j}S_{ n-j}(t).}$$

Using the Carlitz identity once more, we find

$$\displaystyle\begin{array}{rcl} \frac{1} {(1 - t)^{n+1}}(1 - t)^{j}S_{ n-j}(t)& =& \frac{S_{n-j}(t)} {(1 - t)^{n+1-j}}, {}\\ & =& \sum _{M\geq 0}(M + 1)^{n-j}t^{M}, {}\\ \end{array}$$

and therefore

$$\displaystyle{\sum _{k=0}^{M}\binom{n + M - k}{n}v(j,k) = (M + 1)^{n-j}.}$$

Returning to Equation (7.4), we now obtain

$$\displaystyle\begin{array}{rcl} \sum _{k=0}^{n-1}v(j,k)\pi (k,l)& =& \frac{1} {b^{n}}\sum _{m=0}^{l}(-1)^{m}\binom{n + 1}{m}((l + 1 - m)b)^{n-j}, {}\\ & =& \frac{1} {b^{j}}\sum _{m=0}^{l}(-1)^{m}\binom{n + 1}{m}(l + 1 - m)^{n-j}, {}\\ & =& \frac{v(j,l)} {b^{j}}, {}\\ \end{array}$$

as desired.

Since the largest eigenvalue of Π is 1, the Perron-Frobenius theorem tells us the first row of V is proportional to the stable distribution for the carries process. Hence Theorem 7.1 follows.

We finish this chapter by remarking that the Amazing Matrix has reappeared in some surprising places. For instance Francesco Brenti and Volkmar Welker rediscovered the Amazing Matrix in commutative algebra [36], where Π is essentially the transformation of a Hilbert series of a graded ring to its bth “Veronese algebra.” In terms of generating functions, this is the map

$$\displaystyle{ \frac{h(t)} {(1 - t)^{d}} =\sum _{k\geq 0}a_{k}t^{k}\mapsto \sum _{ k\geq 0}a_{bk}t^{k} = \frac{h^{\langle b\rangle }(t)} {(1 - t)^{d}}.}$$

The transformation matrix for \(h\mapsto h^{\langle b\rangle }\) is (after deleting the first row and column) the Amazing Matrix.

Brenti and Welker analyze this transformation as they did for the barycentric subdivision transformation, which is discussed in Chapter 9 Since the stable distribution for the Amazing Matrix is the Eulerian distribution, they find that repeatedly applying the Veronese map takes any h-polynomial to the Eulerian polynomial in the limit. In particular, applying the map enough times yields a real-rooted h-polynomial.

In a different direction, the Amazing Matrix shows up in the analysis of card shuffling. Persi Diaconis and Jason Fulman have several papers on this topic [5759]. A “b”-shuffle of a deck of cards is a generalization of the usual riffle shuffle, which is a b-shuffle for b = 2. In a b-shuffle we split the deck into b piles of sizes c 1, , c b with probability

$$\displaystyle{\frac{\binom{n}{c_{1},\ldots,c_{b}}} {b^{n}}.}$$

Then we drop cards randomly from each of the piles, with probability proportional to the size of the pile. The connection between carries in addition and shuffling is most succinctly summarized by Theorem 1.1 of [58], which we quote directly here:

The probability that the base-b carries chain goes from 0 to j in r steps is equal to the probability that the permutation in S n obtained by performing r successive b-shuffles (started at the identity) has j descents.

The reader is encouraged to read [57] for a very friendly introduction to this story.