What is the expected value of an N-dimensional vector of uniformly distributed random numbers which sum to 1 and have been sorted in descending order?


Here is the algorithm for drawing a sample from the distribution of this N-dimensional vector:


* Create an N-1 dimensional vector of uniformly distributed random numbers between 0 and 1, inclusive. For example, for N=3, [0.564, 0.243].
* Append the numbers 0 and 1 to the vector, then sort it in ascending order. For example, [0, 0.243, 0.564, 1].
* Compute the 1st-order differences of the vector, yielding an N-dimensional vector of uniformly distributed random numbers that sum to 1. For example, [0.243, 0.321, 0.436].
* Sort this vector into descending order. For example, [0.436, 0.321, 0.243].


It is easy to demonstrate by graphical analogy that for N=2, the expected value of the vector is exactly [3/4, 1/4].


For N=3, by sampling I have determined that the expected value is approximately [0.611, 0.277, 0.111].


For N=4, by sampling I have determined that the expected value is approximately [0.520, 0.271, 0.146, 0.063].


What is the analytical form of the expected value for any value of N?



What is the expected value of an N-dim vector of uniform randoms that sum to 1 which have been sorted into descending order?
You pick $N-1$ points $X\_1,\dotsc, X\_{N-1}$ independently and uniformly at random in $[0,1]$. They divide the segment $[0,1]$ into $N$ segments of lengths $S\_1,\dotsc, S\_N$ usually referred to as *spacings*. 


To use your description, rearrange the $X\_i$ in increasing order $X\_{(1)}\leq \cdots \leq X\_{(N-1)}$ and then


$$ S\_1= X\_{(1)},\;\;S\_2= X\_{(2)}-X\_{(1)},\dotsc , S\_N=1-X\_{(N-1)}. $$


The random vector $\vec{S}=(S\_1,\dotsc, S\_n)$ is uniformly distributed on the $(N-1)$-dimensional simplex $\newcommand{\bR}{\mathbb{R}}$


$$ \Delta\_{N-1}= \bigl\{\; (s\_1,\dotsc, s\_N)\in \bR^N\_+;\;\;\sum\_{j=1}^N s\_j=1\;\bigr\} $$


equipped with the normalized surface measure. The "area" $A\_{N-1}$ of $\Delta\_{N-1}$ is found using the recurrence 


$$A\_1=\sqrt{2},\;\;A\_N= \sqrt{\frac{N+1}{N}}\frac{A\_{N-1}}{N}. $$


This yields


$$A\_N= \frac{\sqrt{N+1}}{N!}. $$


Rearrange the spacings $S\_1,\dotsc,, S\_n$ in increasing order


$$S\_{(1)}\leq \cdots \leq S\_{(N)}. $$


The random vector $(S\_{(1)},\dotsc, S\_{(N)})$ is uniformly distributed in the $N-1$-dimensional polyhedron 


$$ P\_{N-1}=\bigl\{\, (s\_1,\dotsc, s\_N)\in \Delta\_{N\_1};\;\;s\_1\leq \cdots \leq s\_N\;\bigr\}. $$


This is another $(N-1)$-dimensional simplex with vertices 


$$v\_1=(0,0,\dotsc, 0,1),\;\;v\_2=\frac{1}{2}(0,\dotsc, 0,1,1),\;v\_3=\frac{1}{3}(0,\dotsc, 0,1,1,1),\dotsc, $$


and total "area"


$$ \alpha\_{N-1}=\frac{1}{N!} A\_{N-1}. $$ 


The mean you are looking for is the center of mass of the simplex $P\_{N-1}$, where the mass is uniformly distributed on this polyhedron.


To compute effectively the coordinates of this center of mass it may be convenient to work with new linear coordinates, $x=(x\_1,\dotsc, x\_N)$ determined by the basis $v\_1,\dotsc, v\_N$ of $\bR^N$. They are related to the standard Euclidean coordinates $(s\_1,\dotsc, s\_N)$ of $\bR^N$ via the equalities


$$ s\_j=s\_j(x) =\sum\_{k=N-j+1}^N\frac{1}{k}x\_k,\;\;j=1,\dotsc, N.$$


In the $x$-coordinates the simplex $P\_{N-1}$ becomes the simplex


$$ D\_{N-1}= \bigl\{\; (x\_1,\dotsc, x\_N)\in \bR^N\_+;\;\;\sum\_{j=1}^N x\_j=1\;\bigr\} $$


Denote by $dA\_x$ the *normalized* area form on $D\_{N-1}$. The coordinates of the center of mass of $P\_{N-1}$ are $(\bar{s}\_1,\dotsc, \bar{s}\_N)$, where


$$\bar{s}\_j=\int\_{D\_{N-1}} s\_j(x) dA\_x,\;\;j=1,\dotsc, N. $$


Now observe that


$$\int\_{D\_{N-1}} x\_j dA\_x= \frac{1}{N},\;\;j=1,\dotsc, N.$$


We deduce


$$ \boxed{E[S\_{(j)}]=\bar{s}\_j=\frac{1}{N}\sum\_{k=N-j+1}^N\frac{1}{k},\;\;j=1,\dotsc, N.} $$


Here is also a plausibility test. The above formula implies


$$\bar{s}\_1+\cdots + \bar{s}\_N=1. $$


This is in perfect agreement with the equality $S\_{(1)}+\cdots +S\_{(N)}=1$. 


**Remark.** The problem of the distribution of spacings is rather old. For example there is *Witworth formula* (1897) describing the expectation of the larges spacing $S\_{N}$. More precisely it states


$$ E[S\_{(N)}]=\underbrace{\sum\_{k=1}^{N}(-1)^{k+1} \frac{1}{k^2} \binom{N-1}{k-1}}\_{=:L\_N}. $$


It looks rather different from what we proved


$$ E[S\_{(N)}]=\bar{s}\_N=\frac{1}{N}\left(1+\frac{1}{2}+\cdots +\frac{1}{N}\right). $$


I have not thought how prove directly that


$$ L\_N=\bar{s}\_N, $$


but simple computer simulations show that indeed the two rather different descriptions are identical. For more details about the spacings problem see [this blogpost](http://liviusmathblog.blogspot.com/2015/11/random-subdivisions-of-interval.html).


