That is true
Randomly extract 3 numbers from the 36 characters of 0~9,a~z to calculate how many permutation combinations are available
Ask the Great God for advice
Reply to discussion (solution)
36*36*36=46656
36*36*36
Forget it, I wrote it.
/** * Permutation combination algorithm * C ($n, $m) * Number of $n elements * $m number of elements taken from $n * $num total number of combinations **/function get_combination ($n, $m) {if (Is_int ($n) &am p;& Is_int ($m)) && ($m <= $n)) {$a = 1;//initialize for ($i =1; $i <= $m; $i + +) {$a = $n * $a; $b = 1* $i; $n--;} $num = $a/$b; return $num;}}
Combination formula: C (n,m) =p (n,m)/m!=n!/((n-m)!*m!)
Do you think you are right?
Combination formula: C (n,m) =p (n,m)/m!=n!/((n-m)!*m!)
Do you think you are right?
You can try.
36*35*34
Calculated by the combined formula is 7140
Half less than you.
Combination formula: C (n,m) =p (n,m)/m!=n!/((n-m)!*m!)
Do you think you are right?
You can try.
echo get_combination (3,3);
Output 2
It's not right, is it?
echo get_combination (3,3);
Output 2
It's not right, is it?
Yes, just looked.
The formula you wrote is also wrong.
If you press your formula,
Two numbers from 2 numbers equals 1.
Right
The combination of two numbers from 2 numbers is 1.
The arrangement is 2.
P (n,m) =n (n-1) (n-2) ... (n-m+1) =n!/(N-M)! (stipulated 0!=1).
Add the following 3 numbers can be the same
For example, extracting a random two number from an array can be
11
22
12
21st
Right
The combination of two numbers from 2 numbers is 1.
The arrangement is 2.
P (n,m) =n (n-1) (n-2) ... (n-m+1) =n!/(N-M)! (stipulated 0!=1).
All right, I'm going to go around.
N^m is OK.
Thank you.
It's been a tangle of permutations and combinations.