OK, Dick....
The Combinatorial function is C(n,r) = n! / ( r! * ( ( n - r )! )
In this formula, you have n = number of possible elements and r = number of elements you will select from the list.
Couple of simple cases: First, how many combinations of 5 numbers taken 5 at a time?
Well, n is 5, so n! = 120 (= 5*4*3*2*1), r = 5, so that is ALSO 120. And (n - r) = 0. As it happens, 0! = 1. So based on the combinatorial analysis, you have ... 1 combination ( 120 / ( 120 * 1 ) )
Your friend gave you the wrong formula. That formula is for the possible number of combinations of something where ORDER DOES NOT MATTER and NO REPETITIONS are allowed. Neither of those is appropriate for passwords. Look over this article instead.
https://www.mathsisfun.com/combinatorics/combinations-permutations.html
In this linked article, you get FOUR formulas, but it is clear when to use each one. The four formulas are just after the sub-header "In Conclusion."
The differences are whether you can re-use one of the digits and whether the order of digits matters.
Now, simple case: You want to make a PIN (personal ID number) out of only digits. OK, 10 digits = 0, 1, ..., 8, 9. You want it to be a 4-digit PIN.
For this, N = 10, R = 4. The formula for R elements from a possible set of 10 elements, where order matters and repetition can occur, is N^R or in this case, 10^4 = 10000 possible PINs. For limits with the digits 1, 2, 3, 4, 5 and a 5-digit PIN, you would get 3125 possible combinations.