This is not an R question, but a question on some combinatorial mathematics. Apologies for the OT if it is wildy inappropriate. The traditional C(n.k) method tells me how many combinations k I can make with n objects. However, suppose I want the number of combinations where an object cannot be used more than Q times where Q is a parameter that changes?

For instance:

combn(LETTERS[1:5], 3)

shows the number of triplets I can make with the 5 letters. But, suppose I want the constraint that no letter can be used more the twice (Q).

Are there well-known methods for identifying the number of possible combinations with this kind of constraint?

Thanks,
Harold


	[[alternative HTML version deleted]]

