I am confused when to use $n^r$ or $r^n$ formula but what I see is that the number of ways can be explained by either formula so when to apply which formula,please clarify?
2026-05-05 22:34:48.1778020488
On
Basics of Permutations and combinations
71 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
3
There are 3 best solutions below
0
On
$n^r$ is the number of functions from a set of size $r$ to a set of size $n$: $$ n^r=\overbrace{\ \ \ \ \ \ n\ \ \ \ \ \ }^{\text{choices for element }1}\times\overbrace{\ \ \ \ \ \ n\ \ \ \ \ \ }^{\text{choices for element }2}\times\,\cdots\,\times\overbrace{\ \ \ \ \ \ n\ \ \ \ \ \ }^{\text{choices for element }r} $$ $n^r$ is also the number of ways to fill each of $r$ slots with one of $n$ objects where any of the objects can be reused.
If you think about it, you can see that these are saying the same thing.
$n^r$ captures the number of ways to arrange $r$ objects into a line when you have $n$ options at each position. On the other hand, $r^n$ will capture the number of ways to arrange $n$ objects into a line with $r$ options at each position. As you can see, there's not a fundamental difference between the two formulas because they're solving the same kind of counting problem. The difference is only in how many objects are in the arrangement (which is the power) and how many options you have at each position of the arrangement (which is the base).
Crucial to these is that repetition is allowed, meaning you can use the same object in multiple positions, and that order matters. The formula is a consequence of what's often known as the 'multiplication principle'.
As an example of their differences, let $r = 3$ and $n = 2$. Then $n^r$ can be seen as the number of binary strings of length 3 (000, 001, 010, etc.) where as $r^n$ can be seen as the number of ternary strings of length 2 (00, 01, 02, 10, etc.).