kk_tarun's blog

By kk_tarun, history, 17 months ago, In English

Recently I came across a question related to combinatorics where you had to find all the number of ways to distribute a particular sum(N) into 3 numbers(different or same) such that the combined sum of these numbers is N and each of the chosen number is less than or equal to a given number(K)?? Anyone has any idea how to solve this problem??

  • Vote: I like it
  • +2
  • Vote: I do not like it

| Write comment?
»
17 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

/incorrect/

  • »
    »
    17 months ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    This is incorrect. The answer should depend on the value of N. Take N = 6 and K = 2. The answer is 1, but your formula gives 11.

»
17 months ago, # |
  Vote: I like it 0 Vote: I do not like it

A general way to solve this (not just limited to 3 partitions), assuming the partitions are ordered: https://math.stackexchange.com/questions/98065/how-many-ways-can-b-balls-be-distributed-in-c-containers-with-no-more-than