# Finding the number of permutations

Here is the following problem: Suppose I have coordinates $(x,y,z)$ in which I choose 3 numbers (they are fixed) and permute them, For example I may choose (1,2,3) then I will want to determine how many ways can I permute these numbers (3,2,1), (2,1,3) etc. However I may also have negatives in the permutations so (-3,2,1) or (-3,-1,-2) are both possible. How many permutations are there and is there a way to mathematically express this? What about the case for $x=y$ or $x=y=z$ or $(x,0,0)$?

• Exactly where are you having trouble figuring this out? Some (if not all) of the cases, you should be able to figure out yourself, for instance $x=y=z$ or $x,0,0$. – Bobson Dugnutt Sep 7 '17 at 6:59
• Yes, $(x,0,0)$ can have 6 permutations but I would rather find a mathematical way of doing this instead of writing a list. – adam Sep 7 '17 at 7:00

For the case of $(x,y,z)$ we have 3 distinct numbers they can be put in 3 places in $3!$ ways. Now in each place there can be either a negative or positive. So there can be $2^3$ ways in which the signs on the coordinates can be arranged so there are in total $3! \times 2^3 = 48$ ways to do this.

If say it of form $(x,x,x)$ or $(x,x,z)$ then in the first case excluding sign there is only one permutation which is obvious, but can be solved as, if we have $n$ objects and k of them are similar then ways of arranging them are $\frac{n!}{k!}$. So for two digits similar the permutations are $\frac{3!}{2!}=3$. Now they can have positive or negative sign which are 8 possible ways.

So for $(x,x,x)$ it is $1 \times 8 = 8$

And for $(x,x,z)$ it is $3 \times 8 = 24$

All the above cases are assuming that the numbers are nonzero.

There can be forms $(x,0,0), (x, y,0), (0,0,0)$. The last one is trivial and has only one permutation. If there are $0$s then only the nonzero elements can have sign so if one of the numbers are $0$ there can be $4$ ways in which signs can be assigned. If there are two $0$s then there are one ways in which the signs can be assigned. The other rules remain the same.

Using all this we can give following formula. $$2^{3-(\#of\_0s)}\times\frac{3!}{(\#of\_same\_digits)}$$