This can be confusing, for sure.

The “ordering” is very much defined by the problem statement you have. If you have a pin code for your phone to unlock it, then you can’t enter `1234`

if your code is `3412`

. The same set of digits but the order is different.

But, in general, if a phone accepts a 4 digit code to unlock it, there are 10,000 possible 4-digit numbers because each number is a valid option in that regard because for the defined problem, the order matters.

You have 10000 outcomes because the order matters when you have a 4 digit code. `1234`

is a different outcome than `3412`

.

So, given the above what would be the scenario if the order did **not** matter?

Well, if the order did **not** matter, you could pick `1234`

or `3412`

or `1324`

and other variants of those 4 digits and say “any one of them can be the correct code”.

The above would make more sense if looked at from the perspective of probability. **Note** the use of the word `outcome`

might make things a bit confusing here, but it’s based on what you have covered in previous lessons.

What would be the probability of selecting the correct 4-digit code out of 10,000 4-digit numbers?

- If the order matters, then you have
`1`

successful outcome and `10000`

total number of possible outcomes. So, the probability is `1/10000`

.
- If the order does not matter, then you have
`N`

successful outcomes and `10000`

total number of possible outcomes. The probability is `N/10000`

.

So, how the problem is defined very much plays a part in this. It’s more clear when the problem statement is framed as -

Given `n`

, select `k`

**Let’s consider a different example now.**

You have a group of `3`

people playing some sport. Out of those `3`

you need to select a captain and a vice-captain.

Let’s simplify this visually, to an extent. The `3`

people are - `A, B, C`

. You need to select a captain and a vice-captain.

What all possible ways can that happen?

Now, you might think -

`A`

was captain and `B`

was vice-captain. But `B`

could have been captain and `A`

could be vice-captain.

A different way to state the above could also be -

We selected a captain first then the vice-captain. But we could have selected the vice-captain first then the captain.

And you would be absolutely correct. The order of selection matters here.

So, the above changes to -

`A, B`

`B, A`

`B, C`

`C, B`

`A, C`

`C, A`

The above permutations are possible because the order of our selection matters and each possible outcome is a valid option. There are 6 ways we can select a captain and vice-captain out of a group of 3.

Let’s change our problem statement just a little bit.

The `3`

people are - `A, B, C`

. You need to select **any** two people.

What all possible ways can that happen?

Again, you might think

But what about `B, A`

?

Well, we are just selecting two people out of three. It doesn’t matter if we pick `A`

first or `B`

. The order does not matter here. There are 3 ways we can pick any two people out of a group of three.

As per me, this is a difficult concept to grasp. I have struggled with this as well (and still do at times). It will take time and practice to understand it better to get to an intuitive level. Hopefully, the above helps a bit. If the above is still confusing or I made a mistake somewhere, let me know.