Please, I'm having a serious problem in my scifi work, and I'm not really good at math.
I have N positions available for three different particles. Each particle has an intrinsic number assigned to it.
Particle A is assigned a +1; Particle B a 0; Particle C a -1.
Assuming that
1)The order of the positions do not matter;
2)The total sum of the combination must be zero,
how many possibilities of combinations do I have? Could you please explain your reasoning?
Thanks.
Notice that the number $a$ of $A$ particles must equal the number $c$ of $C$ particles, and the remaining $b$ positions must be $B$ particles. This is in order for the sum to be $0$. In particular, we have $N-b=a+c=2a$, that is, $N-b$ is even and hence $N$ and $b$ are the same parity.
Hence, the number of possible combinations is the number of distinct solutions to
$$2a+b=N$$
where $a,b\geq 0$ are integers.
Case $(1)$: $N = 2k$
When $N$ is even, the solutions are uniquely determined by the values of $a=0,1,\dots,k$ for a total of $k+1$ solutions.
Case $(2)$: $N = 2k+1$
When $N$ is odd, we must have at least one $B$ particle $($ie, $b\geq 1)$. Since order does not matter, the remaining $2k$ positions can be counted according to case $(1)$, so we once again have $k+1$ solutions.
Conclusion
In short, we can say there are $\left\lfloor N/2\right\rfloor +1$ possible arrangements.