Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to solve a two part question:

a) What's the probability that a given composition of $n$ has a first part $1$

b) What's the probability that a randomly selected composition of $n$ has a second part and the second part is $1$

For a) I have that:

$$P(a) = \frac{|E|}{2^{n-1}}$$ where |E| is the number of compositions with a first part of one. I'm thing $|E|$ is ${n \choose1}\cdot{n-1 \choose k-1}$. Since we want to choose $1$ element for the first part and any variation of the rest of the elements. This is using set partitions which I'm not sure is right.

For the second part I'm not entirely sure. Any hints would be greatly appreciated!

share|cite|improve this question
up vote 1 down vote accepted

For a) if a composition of $n$ has first part $1$, the rest is a composition of $n-1$. So if $C(n)$ is the number of compositions of $n$ you want $\frac {C(n-1)}{C(n)}$. For b) you need to delete the compositions that have $n$ as the first (and only) element and apply a)

share|cite|improve this answer

Call a composition with first part $1$ good. A composition of $n-1$ can be uniquely extended to a good composition of $n$ by putting a $1$ in front. Thus there are $2^{n-2}$ good compositions of $n$.

For the second part, apart from the composition into $1$ part, all the others yield to the same argument as the one above. In compositions with at least $2$ parts, there is no effective difference between being first and being second.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.