How many wiring combinations exist for an *n*-pin cable/connector?
The answer involves the vast mathematical field of combinatorics.
If we consider the permutation formula, \$_nP_k\$ or \$P(n,k)\$, which is to say &quot;k-permutations of n&quot;, n is the &quot;total number of elements&quot; and k is the &quot;sample size.&quot;
$$ _nP_k = \frac{n!}{(n-k)!} $$
This formula is specifically for permutations, where elements are not duplicated and element order matters. For our purposes, we can say n is the total number of pins, and k is the used number of pins. So calculating for ordered permutation, with no duplication of 16/16 pins:
$$ _nP_k = \frac{16!}{(16-16)!} $$
$$ _nP_k = \frac{16!}{0!} $$
$$ _nP_k = \frac{16!}{1} $$
$$ _nP_k = 16! $$
$$ _nP_k = 16\times 15\times 14 \ldots \times 3\times 2\times 1 $$
$$ _nP_k \approx 20.9\times 10^{12} $$
The factorial of 0 is 1. So there are almost 21 trillion ways in which the wires could be re-ordered in a 16-pin cable/connector.

If we wanted to allow duplicate elements (repetition) of a permutation, where order does not matter, this is termed a Combination.  This is also known as the binomial coefficient of \$n\$, \$\binom {n}{k}\$, a k-selection, a k-multiset, or a k-combination with repetition.  The combination formula is:
$$ _nC_k = \frac{n!}{(n-k)!k!} $$
This formula is slightly different from the permutation formula to account for the duplicate elements.  The duplicates reduce the number of available combinations, so are factored into the bottom half of the equation.
Ex: a 16-pin connector, all pins of which are used, but the cable only has nine wires. How many unique combinations exist?
Ans: 11,440.

If we wanted to allow duplicate elements (repetition) of a permutation, where order does matter, the formula is:
$$ n^k $$
Where \$n\$ is the range of elements to choose from, and \$k\$ is how many elements are chosen. This (permutation with repetition of \$n\$ chosen elements) is not really a permutation formula at all; it is known as an &quot;n-tuple&quot;.
Ex: How many values are possible on a digital cable, where each digit ranges from 0-2 (tri-state), and 13 wires are used?
Ans: \$ 3^{13} \$ = 1,594,323