Combinations with repetitons and order matters

55 Views Asked by At

I'm looking for a way to calculate the number of combinations one can make with $5$ numbers from $1$-$5$.  Repetition are also allowed and order matters. I am making a $8$ digit combinations using numbers $1$-$5$. Order is important $12345432$ is not the same as $45321231$, and numbers such as $11111111$, $22222222$ are included. So, I am choosing $8$ things from a list of $5$ items.

I think the possible combinations can be calculated as $5^8 = 390625$. Is this correct? What is the complexity of such a problem?

1

There are 1 best solutions below

0
On

It is correct, there are $5$ ways of choosing the first element, having done that there are again $5$ ways of choosing the second, so there are $5\times 5$ of choosing the first two, continuing this way you get $5^8$ ways of choosing these numbers.