- Distinct symbols (n)
- 10
- Positions to fill (r)
- 4
10,000
Open with these values10,000sequences
Result: 10,000 sequencesEvery position keeps all n choices, so the count is n multiplied by itself r times. Ten digits on four positions give 10 × 10 × 10 × 10 = 10,000 PINs; two symbols on eight positions give 256, one byte. Forbid repeats and the same question becomes the ordinary permutations calculator.
10,000
Open with these values17,576
Open with these values256
Open with these valuesP = n^r
Of the four counting formulas this is the plainest, and the reason deserves saying out loud: it is the only one with nothing to correct. Each of the r positions is filled independently, and because nothing is consumed, each keeps all n options. The multiplication principle then runs straight through — n choices, times n, times n, r times over — and that is n^r. The other three formulas all end in an adjustment: a product that shrinks because items get used up, or a division that takes back orders counted more than once. Here nothing is used up and every order really is a different result, so no factorial appears anywhere. Ten digits on four positions give 10 × 10 × 10 × 10 = 10,000, which is also the plain reading of a four-digit PIN: the codes 0000 through 9999, ten thousand of them exactly. What is counted is possibilities, not difficulty. Eight printable ASCII characters span 6,634,204,312,890,625 strings, but that figure only describes how strong a password would be if it were drawn uniformly at random from the whole space. People do not choose that way, and an attacker does not work through the space in order. The number is an upper bound on the effort, never a measure of one particular choice.
Each of the r positions is filled independently and keeps all n choices, so the count is n multiplied by itself r times. Ten digits on four positions give 10,000 PINs; two symbols on eight positions give 256, one byte.
Ten digits on four positions give 10,000 with repeats, 5,040 without, and 210 if the order is ignored as well. Nothing is ever used up, so no factor shrinks along the way.
99 to the power 8 is the first result a standard number can no longer write out digit for digit: it prints as 9,227,446,944,279,200 when the true value ends in 201. Inside the allowed range every printed digit is true, including 95 printable characters over 8 positions.
A four-digit PIN over ten digits has 5,040 codes.
That count forbids using a digit twice. A PIN may repeat digits, so each position keeps all ten and there are 10,000.
One byte has 2 × 8 = 16 possible values.
Each of the eight positions independently takes one of two symbols, which is 2 to the power 8 = 256. Multiplying instead of raising to a power undercounts badly.
Filling zero positions must give zero sequences.
n to the power 0 is 1 for every n, the single empty sequence. That is the standard convention in combinatorics.
| n, r | Reads as | Sequences |
|---|---|---|
| 1, 0 | no positions at all | 1 |
| 10, 0 | the empty code | 1 |
| 1, 5 | one symbol, five slots | 1 |
| 6, 2 | two dice rolls in order | 36 |
| 26, 3 | three letters | 17576 |
| 2, 8 | one byte | 256 |
| 10, 4 | a four-digit PIN | 10000 |
| 95, 8 | eight printable ASCII characters | 6634204312890625 |
Raise the number of distinct symbols to the power of the number of positions: n to the power r. Each position is filled independently and keeps all n choices. A four-digit PIN over the digits 0 to 9 therefore has 10,000 possible codes.
Here symbols may repeat, so every position still has all n choices. Ordinary permutations use each item up and give n!/(n−r)!, and combinations ignore the order entirely and give the smallest of the three counts. Ten digits on four positions: 10,000 with repeats, 5,040 without, 210 if the order is ignored.
Filling zero positions has exactly one outcome, the empty sequence, so n to the power 0 is 1 for any n. The calculator returns 1, which is the standard convention in combinatorics.
Anywhere order matters and symbols may repeat: PIN and password counts, licence-plate patterns, fixed-length strings over an alphabet, sequences of dice rolls or coin flips recorded in order, and the key space of a cipher.
Because 99 to the power 8 is the first result a standard number can no longer write out digit for digit: it prints as 9,227,446,944,279,200 when the true value ends in 201. Inside the allowed range every printed digit is true, including 95 printable characters over 8 positions. Longer strings need arbitrary-precision arithmetic.
Information, not professional advice.
Diese Seite gibt es auch auf Deutsch.
Zu Deutsch wechseln