How to Count Permutations with Repetition with PERMUTATIONA in Excel
Use PERMUTATIONA to count codes where characters can repeat — keypad PINs, lock codes — and judge how secure they are.
You will learn to
- Count codes that allow repeated characters
- Find the chance of guessing a code in a few attempts
- Find the share of codes with a repeated character
How it works
PERMUTATIONA(n,k) counts ordered arrangements of k items chosen from n when items can be reused — exactly how PINs, lock combinations and product codes work. A 4-digit PIN from 10 digits gives =PERMUTATIONA(10,4) = 10,000 codes. It is the same as n^k.
Compare it with PERMUT, which forbids repeats. 1 − PERMUT(10,4)/PERMUTATIONA(10,4) shows that almost half of all 4-digit PINs repeat at least one digit — a handy fact when someone thinks "no repeated digits" makes a code safer.
=PERMUTATIONA(10,4)