# Premutations? or combinations?

1. Sep 2, 2010

### BananaNeil

Hey every body... I have been trying to figure this out for quite a while now.... and i feel like i am making progress, but it just doesn't seem to be working.

Imagine you have a string of numbers with a length of X

N of those numbers must be 1 and X-N of those numbers must be zero. how many different combinations can i make?

(if it matters the relationship between n and x is this... x=(n^2)-(2*n))

any help would be really appreciated.

2. Sep 3, 2010

### JCVD

x choose n = x!/(n!*(x-n)!)

3. Sep 3, 2010

### BananaNeil

wowwww, thank you so much. =]

I was wondering if you could possibly explain why it works..

your answer was defiantly sufficient for my program, but i am really interested in why works.

4. Sep 3, 2010

### HallsofIvy

Staff Emeritus
Since you title this "Permutations? or combinations?", I feel I should point out that, strictly speaking, there is only one combination of X numbers, N of which are 1 and X- N of which are 0. There are
$$\begin{pmatrix}X \\ N\end{pmatrix}= \frac{X!}{N!(X- N)!}[/itex] permutations. For example, if X= 4 and N= 1, 1000, 0100, 0010, and 0001 are all the same combination. They are different permutations, differing in the order in which the digits are written. There is eactly 1 combination and 4!/(3!1!)= 4 permutations. By the way, please don't use "X" and "x", "N" and "n" interchangably. They are different symbols and often mean different values in equations and formulas. 5. Sep 3, 2010 ### gerben Consider a particular example, say X=10, N=3: You want to pick 3 spots out of 10 spots. In how many ways can you do that? Well, for the first one you have 10 possible choices for the second you have 9 possible choices and for the third you have 8 possible choices. So you can do this in 10·9·8 ways. This is equal to: [tex] \frac{10 \cdot 9 \cdot 8 \cdot 7 \cdot 6 \cdot 5 \cdot 4 \cdot 3 \cdot 2 \cdot 1}{7 \cdot 6 \cdot 5 \cdot 4 \cdot 3 \cdot 2 \cdot 1} = \frac{10!}{(10-3)!}$$

These 10·9·8 possible ways to pick the spots include different ways of picking the same 3 spots (i.e. picking the same spots in different order). So we want to divide these 10·9·8 possible ways to pick the spots by the number of ways in which each set of 3 spots can be ordered. This is the number of ways in which you can pick 3 out of 3 spots: 3·2·1 = 3!

So the total number of different sets of 3 spots that can be drawn from a set of 10 spots is: $$\frac{10!}{(10-3)!\cdot 3!}$$

6. Sep 11, 2010

### moonman239

Actually, the number of permutations (not combinations) is x!/(x-n)!