Counting Combinations with Restricted Summation using Generating Functions

  • Thread starter Thread starter FAhmad
  • Start date Start date
  • Tags Tags
    Binomial
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 1K views
FAhmad
Messages
1
Reaction score
0
If we have numbers 1,2,3,4,5,6,7,8,9,10,11.

We want to pick 5 numbers out of that, but there is a restriction - the summation of the 5 picked numbers must be 21 or less.

How many different combinations can we get?

The answer is 24 but I would like to know how to work it out (besides the impractical way of listing down all the possibilities in this case there are 462 different combinations, and testing one by one so that it is 21 or less)
 
Physics news on Phys.org
You can use generating functions. Just count all the possibilities with an unrestricted number of draws and unrestricted summation with a weight of x^(#numbers drawn) y^(value of the summation of numbers).