# Permutation with exception/repetition

Tags:
1. Dec 3, 2015

### Crazorin

I need a formula to calculate permutation.
For example I have a 5 numbers and I creating a 3 digit number from it.
The numbers are: 1, 1, 1, 2, 3; I could write up 13 variations, but I couldn't work out the formula.
If the numbers are: 1, 1, 2, 2, 3 the number of variations are 18 (if I wrote them up properly)
Is there a formula to calculate this, or is it becoming too complex?

2. Dec 3, 2015

### aikismos

You're looking for permutations of a multiset (a set in which redundant elements are allowed).
(See https://en.wikipedia.org/wiki/Permutation#Permutations_of_multisets.)

3. Dec 3, 2015

### Crazorin

Thanks. It is almost what I need except in those example they use up all element of each set.
I would only use part of it. So if the sets are {1, 1}{2, 2}{3} then I have a total of 5 elements. And the question is how many different 3 digit numbers I can create of these 5 elements. Because they are numbers, the order matter so it would be a kind of permutation.
What would be the formula for that?