TITLE: Largest Part of a Random Weak Composition
QUESTION [9 upvotes]: Suppose we have a weak composition of the integer n into k parts. (A weak compositions is essentially a partition in which order matters and 0 is allowed)
My question is, what is the expected value of the largest part of the composition? The assumption is that all compositions have equal probability.

REPLY [8 votes]: I'm going to give an exact answer in the form of a double sum and then a derivation showing why the approximation $$E[M] \approx \frac{H_k}{\log(1+k/n)} - \frac{1}{2}$$ using the maximum of geometric random variables (and mentioned by leonbloy) is an excellent one.
The Exact Expression.
As Henry notes in the comments above, the expected largest part of the weak composition of $n$ into $k$ parts is 1 less than the expected largest part of (strong) compositions of $n+k$ into $k$ positive parts.  Randomly decomposing $n+k$ into $k$ positive parts, in turn, is the same problem as taking a stick of length $n+k$ and breaking it at $k-1$ randomly chosen distinct integer points.
The last problem has been studied.  If we let $M^+$ denote the largest piece, David and Nagaraja's Order Statistics, Problem 6.4.10, p. 155, gives, for $m \geq 1$, 
$$P(M^+ \leq m) = \frac{1}{\binom{n+k-1}{k-1}} \sum_{i=0}^k (-1)^i \binom{k}{i} \binom{n+k-1- mi}{k-1}.$$
(The approach is to consider the coefficient of $n+k$ in $(x + x^2 + \cdots x^m)^k$.)
Thus $$E[M^+] = \sum_{m=0}^{n+k} \left(1 - \frac{1}{\binom{n+k-1}{k-1}} \sum_{i=0}^k (-1)^i \binom{k}{i} \binom{n+k-1- mi}{k-1}\right)$$
$$ = \sum_{m=0}^{n+k}  \sum_{i=1}^k (-1)^{i+1} \binom{k}{i} \frac{\binom{n+k-1 -mi}{k-1}}{\binom{n+k-1}{k-1}}.$$
So the answer to the OP's question is just 1 less than this: $$E[M] = \sum_{m=1}^{n+k}  \sum_{i=1}^k (-1)^{i+1} \binom{k}{i} \frac{\binom{n+k-1 -mi}{k-1}}{\binom{n+k-1}{k-1}} - 1,$$
which is exact but not as clean as we might like.  (Note that this expression gives the same answers Henry obtained for small values of $n$ and $k$.)
The Approximation.  While the double sum likely does not have a closed form, if we approximate the ratio of binomial coefficients using the known asymptotic for the ratio of gamma functions $\frac{\Gamma(z+a)}{\Gamma(z+b)} \approx z^{a-b}$ we get 
$$\frac{\binom{n+k-1-mi}{k-1}}{\binom{n+k-1}{k-1}} = \frac{(n+k-1-mi)! n!}{(n+k-1)! (n-mi)!} \approx (n+k)^{-mi} n^{mi} = \frac{1}{(1+k/n)^{mi}}.$$ 
So now we have 
$$E[M^+] \approx \sum_{i=1}^k (-1)^{i+1} \binom{k}{i} \sum_{m=0}^{n+k} \frac{1}{(1+k/n)^{mi}} \approx \sum_{i=1}^k (-1)^{i+1} \binom{k}{i} \sum_{m=0}^{\infty} \left(\frac{1}{(1+k/n)^i}\right)^m$$
$$ = \sum_{i=1}^k (-1)^{i+1} \binom{k}{i} \frac{1}{1 - (1+k/n)^{-i}}.$$
As I prove in my answer here, this is the expected maximum of a sample of size $k$ from a geometric distribution with parameter $p = 1 - q = 1- 1/(1+k/n)$.  Then, in my answer here, I prove that this is very closely approximated by $\frac{1}{2} + \frac{1}{\lambda} H_k,$ where $\lambda = -\log (1-p)$.  Therefore, we have, as mentioned by leonbloy, that $E[M]$ is very closely approximated by $$E[M] \approx \frac{H_k}{\log(1+k/n)} - \frac{1}{2}.$$