Find the possible combinations

  • Thread starter Thread starter Mentallic
  • Start date Start date
  • Tags Tags
    Combinations
Click For Summary
SUMMARY

This discussion focuses on calculating the possible combinations of distributing points among skills in a game, considering maximum limits for each skill. The initial formula for combinations without limits is given by C(S+P-1, P), where S represents the number of skills and P the total points. To incorporate maximum limits, the user suggests calculating the number of ways to distribute points after exceeding the maximum in one skill, leading to a more complex summation formula. The discussion references the Einstein solid model as a conceptual framework for understanding the distribution of points.

PREREQUISITES
  • Understanding of combinatorial mathematics, specifically permutations and combinations.
  • Familiarity with factorial notation and its applications in combinatorial formulas.
  • Knowledge of the Einstein solid model in statistical mechanics.
  • Basic programming skills to implement combinatorial algorithms.
NEXT STEPS
  • Research advanced combinatorial techniques for constrained distributions.
  • Learn about the Einstein solid model and its applications in combinatorial problems.
  • Explore programming libraries for combinatorial calculations, such as Python's itertools.
  • Study generating functions as a method for solving distribution problems with constraints.
USEFUL FOR

Mathematicians, game developers, and anyone interested in combinatorial optimization and resource allocation problems.

Mentallic
Homework Helper
Messages
3,802
Reaction score
95

Homework Statement


This is something I want to know regarding a game series I am a big fan of.
If we are given a certain amount of points that can be distributed among a certain number of different skills, with the added restriction that each skill has a maximum number of points that can be put into it which is less than the total points we are given, then find the possible combinations.


Homework Equations


[tex]P(n,r)=\frac{n!}{(n-r)!}[/tex]

[tex]C(n,r)=\frac{n!}{r!(n-r)!}[/tex]


The Attempt at a Solution


I was able to find that if we ignore the maximum limit for each skill, then if
S = number of skills
P = number of points

The number of combinations C, should be equal to

[tex]C=\frac{(S+P-1)!}{P!(S-1)!} = C(S+P-1,P)[/tex]

Now to add the limit in each skill to the mix, I'm not feeling comfortable about. Any ideas/hints?
 
Physics news on Phys.org


[tex]C=\frac{(S+P-1)!}{P!(S-1)!}[/tex]

Is exactly the answer if there were no limits. This problem reminds me of the Einstein solid where you have N oscillators (S skills) and q energy units (P points). You have S buckets and P balls to place in the buckets.

What I would do next is to calculate the number of ways you can Put (P - (P_max+1)) units of energy into (S - 1) skills. This is the situation where you have put P_max + 1 points into 1 bucket and are distributing the rest among the other buckets. Then put 1 more in the filled bucket and calculate the number of arrangements all the way up to 1 bucket having P skill points. This is assuming you can't completely fill 2 buckets (P < 2*P_max)

So, the number of states where you have overfilled 1 bucket is:

[tex]\sum^{P-P_m}_{n=1} \frac{(P-P_m-n+S-2)!}{(P-P_m-n)!(S-2)!}[/tex]

You can probably use the same or a similar argument for P>2*p_max
 

Similar threads

Replies
6
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
Replies
10
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 36 ·
2
Replies
36
Views
4K