Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Блог пользователя kk_tarun

Автор kk_tarun, история, 15 месяцев назад, По-английски

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??

  • Проголосовать: нравится
  • +2
  • Проголосовать: не нравится

»
15 месяцев назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

/incorrect/

  • »
    »
    14 месяцев назад, # ^ |
      Проголосовать: нравится +1 Проголосовать: не нравится

    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.

»
14 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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