I have a grid of $4\times 4$ size and has values starting from $0$ to $15$. How many unique $4\times 4$ patterns can this grid make? I have no idea which formula or mathematical concept is required here.
I found it on the internet that told if you take $16!$ (factorial) this is how many unique patterns you. can have with a 4x4 grid. and $16!$ is in trillions? Is this the right way or is there anything else?
UPDATE:
What qualifies as a unique pattern?
Lets say we have $0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15$ values in our $4\times 4$ grid.
Some unique pattern would be:
- $1,0,2,3,4,5,6,7,8,9,10,11,12,13,14,15$
- $2,1,0,3,4,5,6,7,8,9,10,11,12,13,14,15$
and so on. The key is that every unique pattern. will have the same values $0-15$ but will be randomized. So how many unique random patterns of $4\times 4$ can we make?
$16!$ is correct. It's easy to see from where it comes from.
The first square could contain any of the 16 integers from $0$ to $15$. So, you have $16$ possibilities.
The second square could contain any of the 15 remaining integers. So the number of combinations for 2 squares and 16 integers is $16 \times 15$.
For the i-th square, the number of combinations would be $16 \times 15 \times \cdots \times [16-(i-1)]$.
Think about it with 2 squares and 3 integers $(0,1,2)$, for example.
First square: $(0)$,$(1)$,$(2) \rightarrow 3 \text{ combinations}$.
Second square: For each integer we can pick any of the other 2 integers remaining. $(0,1)$ and $(0,2)$, $(1,0)$ and $(1,2)$, $(2,0)$ and $(2,1)$. Clearly 3 pairs. $3\times2$
If you considered a third square, there would be only one option for each previous combination, so the number of combinations keeps the same. $3\times2\times1$