# Combination of 24 picture cards

Twenty-four picture cards can be combined $1\,686\,553\,615\,927\,922\,354\,187\,744$ times. This means that you can get a complete landscape even with the quadrillionth variant.

The result can be calculated as follows:

$$\sum_{m=1}^{23}{\frac{24!}{(24-m)!}} + 24! = 1\,686\,553\,615\,927\,922\,354\,187\,744$$

However, how do you get to this term? Why isn't it just $24!$?

-
I do not really understand what you are linking to? –  utdiscant Jun 15 '11 at 10:33

$24!$ counts the number of ways that you can rearrange 24 distinct objects.

The expression you give counts the number of ways that you can select a subset of your 24 distinct objects, and then rearrange them into a new order.

For example, with 3 objects {1,2,3} you could choose any of the following orderings:

• (1) (2) (3)
• (1,2) (1,3) (2,1) (2,3) (3,1) (3,2)
• (1,2,3) (1,3,2) (2,1,3) (2,3,1) (3,1,2) (3,2,1)

The total number of ways is

(# of ways to select one object) + (# of ways to select two objects) + (# of ways to select 3 objects)

which is equal to

$$\frac{3!}{2!} + \frac{3!}{1!} + \frac{3!}{0!}$$

or equivalently

$$\sum_{m=1}^2 \frac{3!}{(3-m)!} + 3!$$

which is the expression you give in your question, but for the case of 3 objects rather than 24. In fact you could write it even more succinctly:

$$\sum_{m=1}^3 \frac{3!}{(3-m)!}$$

Moving slightly beyond your question, I would argue that there is one more way to select a subset of those objects, namely selecting none of them at all, in which case there are

$$\sum_{m=0}^3 \frac{3!}{(3-m)!}$$

In addition, I would note that due to a symmetry between $m$ and $3-m$, you can write this as

$$\sum_{m=0}^3 \frac{3!}{m!}$$

Finally, let's generalize to the case of $n$ objects, in which case the number of ways of selecting a subset and rearranging them into a new order is

$$a(n) = \sum_{m=0}^n \frac{n!}{m!}$$

There is an (almost) closed-form formula for this: if $n>0$ then

$$a(n) = \lfloor en! \rfloor$$

-