-
-
Notifications
You must be signed in to change notification settings - Fork 18
permutations
Vašek edited this page Feb 6, 2019
·
1 revision
This function returns the number of possible permutations
permutations(n,x)
Argument | Description |
---|---|
int n |
The number of possible numbers |
int x |
Length of row |
Returns: int
A permutation is a number of possible arranging objects in a row. Number n
represents the number of objects, and number x
is a length of the row.
int value = pemutations(3,3);
So, when we have numbers 1, 2 and 3 (n = 3
) we can assemble them in row (x = 3
) - six different ways: (1,2,3), (1,3,2), (2,1,3), (2,3,1), (3,1,2), and (3,2,1). So the output ofthis function is 6.
Back to number_functions