# Permutations/combinations problem

1. Aug 4, 2008

### JL3

I have a problem about combinations and permutations I am trying to solve. Say we have an n-dimensional vector. Each element of the vector can contain any one of $$\lambda=3$$ values (-1, 0 or +1). Then the number of possible vectors is simply:

$$\lambda^n$$

If we place the additional restriction that the vector must contain exactly $$k$$ non-zeros, then it becomes:

$$p=(\lambda-1)^{k}\times\binom{n}{k}=\frac{n!(\lambda-1)^{k}}{k!(n-k)!}$$

If we change the restriction so that it must contain at most $$k$$ non-zeros and at least 1 non-zero, then it becomes:

$$p=\sum_{k'=1}^{k}\left[(\lambda-1)^{k'}\times\binom{n}{k'}\right]=\sum_{k'=1}^{k}\frac{n!(\lambda-1)^{k'}}{k'!(n-k')!}$$

Are my equations correct? Is there a more compact way of expressing this last equation, to get rid of the summation?