Discrete Mathematics: I Permutations with Repetition
Permutations with Repetition
-
How many distinct strings with length \(L\) are there in a system with \(N\) digits \(0, \ldots, N-1\)?
There are \(N\) outcomes for all \(L\) digits so:
$$ N^L $$ -
How many distinct strings with length \(L\) are there in a system with \(N\) digits \(0, \ldots, N-1\) without leading zero?
There are \(N-1\) outcomes for the digit with greatest place value and \(N\) outcomes for the rest of the digits so:
$$ (N-1)N^{L-1} $$ -
How many distinct strings with length \(L\) are there in a system with \(N\) digits \(0, \ldots, N-1\) where the digit \(1\) appears \(K\) times?
There are \(\binom{L}{K}\) possible combinations of positions for the \(1\)s that appear \(K\) times. For the remaining \(L-K\) digits, there are \((N-1)^{L-K}\) possible combinations. Therefore:
$$ \binom{L}{K}(N-1)^{L-K} $$ -
How many distinct strings with length \(L\) are there in a system with \(N\) digits \(0, \ldots, N-1\) where the digit \(1\) appears at least \(K\) times?
Add all possible combinations where the digit \(1\) appears \(K, \ldots, L\) times so:
$$ \sum_{i=K}^{L} \binom{L}{i}(N-1)^{L-i} $$
Equivalently:
$$ N^L - \sum_{i=0}^{K-1} \binom{L}{i}(N-1)^{L-i} $$ -
How many distinct strings of length \(L\) are there in a system with \(N\) digits \(0, \ldots, N-1\) with no two consecutive \(1\)s?
Let \(f(L)\) be the number of valid strings. Then \(f(1)=N\), \(f(2)=N^2-1\).
Case 1: Last digit is not \(1\):
\((N-1)f(L-1)\)
Case 2: Last digit is \(1\) and previous is not \(1\):
\((N-1)f(L-2)\)
Therefore:
$$ f(L) = (N-1)f(L-1) + (N-1)f(L-2) $$
with \(f(1)=N\), \(f(2)=N^2-1\). -
How many distinct strings with length \(L\) are there in a system with \(N\) digits \(0, \ldots, N-1\) that uses \(K\) distinct digits?
First choose the \(K\) digits: \(\binom{N}{K}\).
Fix a set of \(K\) digits and use inclusion–exclusion:
$$ \sum_{j=0}^{K} (-1)^j \binom{K}{j}(K-j)^L $$
Multiplying:
$$ \binom{N}{K} \sum_{j=0}^{K} (-1)^j \binom{K}{j}(K-j)^L $$ -
How many distinct strings of length \(L\) can be formed using digits \(0,1,\ldots,N-1\) where each digit \(i\) appears exactly \(n_i\) times (so \(n_0+n_1+\cdots+n_{N-1}=L\))?
This is a multiset permutation problem. We are arranging a total of \(L\) digits, but some digits are identical, so swapping identical digits does not create a new string.
If all digits were distinct, there would be \(L!\) permutations. However, we must correct for overcounting caused by identical digits. For each digit \(i\), we divide by \(n_i!\).
Therefore, the number of distinct strings is:
$$ \frac{L!}{n_0!\,n_1!\cdots n_{N-1}!} $$

Comments
Post a Comment