nCr | R Documentation |
Calculates the number of arrangements in which no element occurs more than once and order does not matter, without the requirement of using all the elements from a given set. For example, if we were arranging an apple, a pear, and an orange (n = 3) into sets of two (k = 2), we would find that there are three possible combinations: an apple and a pear, an apple and an orange, and a pear and an orange. We would not count combinations where the order was reversed (e.g. a pear and an apple) as different combinations.
nCr(n, r)
n |
An integer number of elements to choose from for the combination. May be a vector if |
r |
An integer subgroup size to combine. May be a vector if |
Implements the equation
n! / (r! * (n - r)!)
An integer number of possible permutations
## Not run: nCr(3, 2) nCr(3:5, 2) nCr(5, 2:4) nCr(1:5, 3) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.