A simple (?) combinatorial problem

  • MHB
  • Thread starter lfdahl
  • Start date
In summary, the conversation discusses a combinatorial problem in which 20 identical items need to be distributed among 10 different people, with each person receiving anywhere from 0 to 5 items. The Stars and bars method is suggested, but since there is a maximum limit for each person, the solution is not straightforward. The suggested approach is to programmatically enumerate all possibilities, which is feasible given the upper boundary of $6^{10}$. The conversation also includes a python code as an example, and the final result is 2930455 possible ways to distribute the items. The person is grateful for the help and plans to try implementing the solution in SciLab.
  • #1
lfdahl
Gold Member
MHB
749
0
As simple as it seems, I still can´t figure out how to solve the following combinatorial problem:

In how many ways can 20 identical items be distributed among 10 (different) persons, when each person may have from zero to five items?

Thankyou in advance for any help, that can lead me on the right path ...
 
Physics news on Phys.org
  • #2
lfdahl said:
As simple as it seems, I still can´t figure out how to solve the following combinatorial problem:

In how many ways can 20 identical items be distributed among 10 (different) persons, when each person may have from zero to five items?

Thankyou in advance for any help, that can lead me on the right path ...

Hey lfdahl,

It would be simple if we could apply the Stars and bars method.
But since we have a maximum of 5 items per person, I believe it's not so simple.
Simplest that I can come up with, is to programmatically enumerate all possibilities.
That should be doable since we have an upper boundary of $6^{10}$, which is still feasible.

In python:
Code:
""" Number of ways to divide o identical objects over p persons
where each person receives 0 to m objects.
"""
def recurse(o, p, m):
	if p == 1:
		return 1 if o <= m else 0
	n = 0
	for i in range(0, min(m, o) + 1):
		n += recurse(o - i, p - 1, m);
	return n;
	
print recurse(20, 10, 5);
Result is [M]2930455[/M].
 
  • #3
I like Serena said:
Hey lfdahl,

It would be simple if we could apply the Stars and bars method.
But since we have a maximum of 5 items per person, I believe it's not so simple.
Simplest that I can come up with, is to programmatically enumerate all possibilities.
That should be doable since we have an upper boundary of $6^{10}$, which is still feasible.

In python:
Code:
""" Number of ways to divide o identical objects over p persons
where each person receives 0 to m objects.
"""
def recurse(o, p, m):
	if p == 1:
		return 1 if o <= m else 0
	n = 0
	for i in range(0, min(m, o) + 1):
		n += recurse(o - i, p - 1, m);
	return n;
	
print recurse(20, 10, 5);
Result is [M]2930455[/M].

Hey, I like Serena

Thanks a lot for your thorough answer to my problem!
Although I´m not familiar with python, I will see, if I can write your codes in SciLab.
I really appreciate your help!
 

1. What is a simple combinatorial problem?

A simple combinatorial problem is a mathematical problem that involves counting or arranging objects in a certain way. It involves using principles from combinatorics, which is the branch of mathematics that deals with counting and arranging objects.

2. How do you approach solving a simple combinatorial problem?

The first step in solving a simple combinatorial problem is to clearly define the problem and identify the objects that need to be counted or arranged. Then, you can use various counting techniques such as permutations, combinations, or the multiplication principle to find the solution.

3. Can you give an example of a simple combinatorial problem?

One example of a simple combinatorial problem is the "how many ways can you arrange a deck of cards?" problem. In this problem, the objects are the 52 cards in a deck and the goal is to find the number of possible arrangements of the cards.

4. What are some real-life applications of simple combinatorial problems?

Simple combinatorial problems have many real-life applications, such as in computer science, genetics, and probability. For example, in computer science, combinatorics is used in designing efficient algorithms and in genetics, it is used to analyze genetic sequences.

5. Are there any strategies for approaching more complex combinatorial problems?

Yes, there are various strategies for approaching more complex combinatorial problems. Some common strategies include breaking down the problem into smaller subproblems, using mathematical induction to prove patterns, and using generating functions to find solutions.

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
18
Views
559
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
3
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
9
Views
578
  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
2K
Replies
12
Views
797
  • Set Theory, Logic, Probability, Statistics
Replies
7
Views
349
  • General Math
Replies
5
Views
2K
Back
Top