CASE 1 : n distinct balls , k distinct bins .
here, every bin can contain zero ball, one ball, two balls,......n balls etc. every ball has k choices to reside into the bin.
so , total ways here = k*k*k*...n times = k^n
Case 2 : In number system , n symbols (i.e. radix n) k digit
In every position , n symbols can repeat. so in every digit position has n choices. So, n*n*n*....k times = n^k
Difference between two cases ---> in case 1 , k can repeat , case 2 ---> n can repeat. so total ways = (the number repeat) ^ how many times repeat .