Let we have $p$ $+$ and $q-$. How many ways we can put them in a line so that no $2$ $-$ are near? If $p = 2$ and $q = 3$ there is only one way $-+-+-$.
Asked
Active
Viewed 39 times
1
-
Have a look at this. It is not completely answering your question, but it comes near. – drhab Sep 29 '13 at 14:38
2 Answers
4
Put down $p$ $X$'s like this: $$X \qquad X \qquad X \qquad X \qquad X \qquad X \qquad X \qquad X \qquad X \qquad $$ These are intended to mark the ultimate locations of the $+$.
These determine $p+1$ places where we could inset a $-$ (the $p-1$ "gaps" between $X$'s, and the two ends).
We must choose $q$ of these. That can be done in $\dbinom{p+1}{q}$ ways.
Remark: This is correct even if $q\gt p+1$, if we use the convention that $\binom{a}{b}=0$ if $a\lt b$.

André Nicolas
- 507,029
0
By near, let's say it means next to each other.
Suppose $p = 5$ and $q = 7$.
Then there are "total arrangements - impossible arrangements" = $\frac{12!}{5!7!} - 2!11 = 770$ ways.
So there are $\frac{p + q}{p!q!} - 2(p + q - 1)$ ways.
p.s. that means there are 2, not 1, ways to your example.

Don Larynx
- 4,703