# How many ways can we order a set of $n$ elements? [closed]

If you have $n$ CDs to arrange sequentially on a shelf, say for $1 \le n \le 20$, how many ways can they be ordered? Please also explain the solution steps.

-

## closed as off-topic by Jonas Meyer, Ivo Terek, RecklessReckoner, dustin, Ahaan S. RungtaJan 19 at 2:58

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question is missing context or other details: Please improve the question by providing additional context, which ideally includes your thoughts on the problem and any attempts you have made to solve it. This information helps others identify where you have difficulties and helps them write answers appropriate to your experience level." – Jonas Meyer, Ivo Terek, RecklessReckoner, dustin, Ahaan S. Rungta
If this question can be reworded to fit the rules in the help center, please edit the question.

I am not willing to repeat: Given that you have 355 rep and a silver badge, I assume you know the workings of the forym but still you post questions in this manner. I will downvote for now, and if you rephrase your question into a more polite form, I am willing to retract that vote. Please understand and help the forum move on. –  user21436 Feb 13 '12 at 8:07

There are $n!$ ways of ordering them, where the exclamation mark represents factorial, which itself is a special case of the gamma function.
The reasoning is that you have $n$ choices for the first (assume leftmost) object. Then for the next, there are $n-1$ choices remaining, and so on, until in the last place, there is only one choice. By a counting principle from combinatorics (sometimes called the rule of product or fundamental rule of counting), the total number of ways is then the product $$(n)\cdot(n-1)\cdots3\cdot2\cdot1=n!$$ This process is also called sampling without replacement (with ordering), but usually in the context of sampling, the order of draws is unimportant, and only the resulting set of objects drawn (without regard to order) is significant. And when all objects are drawn and order is significant, the process of assigning an order to each object (or reassigning orders starting from an arbitrary numbering of them) is also equivalent to defining a permutation of the objects.
Think about choosing them in some order. First you have $n$ objects to choose from, then $n - 1$ then $n - 2$ and so on. Thus $n!$ is your solution.