Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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 have this question that I can't seem to wrap my brain around. It goes something like this. How many ways are there to arrange n black and 4 white marbles so that every white marble is adjacent to at least one other white marble?

Thanks in advance!

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

If all white marbles have to be adjacent to another, you could say that you are arranging pairs of marbles instead. $4$ marbles make $2$ pairs and there are $\binom{n+2}{2}$ ways to arrange $2$ white objects among $n$ black marbles.

share|cite|improve this answer

If every white marble is adjacent to at least one other white marble, then we have two options:

  • We have two groups of two adjacent white marbles in our permutation
  • We have one group of four adjacent white marbles in our permutation

where the second option is really a subset of the first one (two adjacent groups of two adjacent white marbles). So, in order to count all possibilities, we need to count the number of ways to put two groups of two white marbles in the gaps between our $n$ black marbles (the number of gaps here include the "gap" before the black marbles and after them). So we have $(n+1)$ gaps, in which we need to put our white marble groups. The number of ways to put the first group in gaps is $(n+1)$, and the number of ways to put the second group is $(n+2)$ (as we have a new gap after adding a new element to our permutation). The total number of ways is $\frac{(n+1)(n+2)}2$, because there is no distinction between the order, in which we place the first and the second group.

Answer: $\frac{(n+1)(n+2)}2$

share|cite|improve this answer

The four white marbles can occur as either one block of four marbles or two blocks of two marbles each. In fact we can interprete the first case as two consecutive blocks of two marbles. A block of three white marbles cannot occur as it would leave the fourth white marble isoloated.

Therefore: Arrange $n$ black and two green marbles in arbitrary sequence. Each such arrangement gives rise to an arrangement as in the problem statement if you replace the green marbles by two white marbles and vice versa.

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.