Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to calculate number of combinations? [duplicate]

Tags:

r

combinations

Possible Duplicate:
How to calculate combination and permutation in R?

When I try to calculate combinations in R using the Combinat package and the combn command it gives me all possible combinations. But I just want to return the number of combinations, i.e. I want to get 45 in case of 10C2. What should I do?

like image 744
Debarghya Avatar asked Feb 01 '13 20:02

Debarghya


People also ask

What is the equation for calculating the number of combinations when repetition is allowed?

If we choose a set of r items from n types of items, where repetition is allowed and the number items we are choosing from is essentially unlimited, the number of selections possible: (n+r−1r).

How many combinations of 4 items have no repeats?

Answer and Explanation: The number of possible combinations with 4 numbers without repetition is 15.

How many combinations of 5 items are there without repeating?

How many combinations with 5 numbers without repetition are possible? There's one (1) possible combination without repetitions C(n,r) and 126 combinations with repetitions C'(n,r) of arranging a group of five numbers (i.e., the 1-5 number list).


1 Answers

Use the base function choose:

choose(10,2)
#[1] 45
like image 57
Blue Magister Avatar answered Oct 13 '22 05:10

Blue Magister