I'm working on a game. In the game, all the pieces have stats, like "Strength", "Smarts", "Skill" etc. Any of these stats might be above or below the baseline.

I want to work out how many permutations of stats I can have if I've settled on the following rules to make each piece interesting:

1. Each piece starts with baseline stats.
2. Each piece gets a +1 to one of its baseline stats, twice. These can both be to the same stat, or different stats.
3. Each piece gets a -1 to one of its baseline stats. The stat chosen cannot be one that received a bonus.

For example, say that my game has six stats: Strength, Brains, Skill, Charm, Will, and Speed All start at a baseline rating of "1"

According to my rules, it would be legal to have a game piece with the following stats:

Strength: 2, Brains: 2, Skill: 1, Charm: 1, Will: 0, Speed: 1 or Strength: 3, Brains: 1, Skill: 0, Charm: 1, Will: 1, Speed: 1

...but it would be boring and therefore illegal, to have a game piece whose penalty cancelled out a bonus, leaving it with stats that looked like:

Strength: 2, Brains: 1, Skill: 1, Charm: 1, Will: 1, Speed: 1

Now I know basic permutations. I know that if none of the three bonuses or penalties could overlap, then I'd have a simple 6 choose 3 permutations. And if there were no restrictions on permutations, I would have 6^3 possible ways of awarding the bonuses & penalties, though only 156 unique statlines as a result.

Now I can hand compute the number of permutations for my example. (90). What I'd really like is a generalized equation for the number of permutations my stat rules generate if the number of stats changes. Also if the number of upgrades each piece gets changes from 2 to a different number of upgrades.

• For each unordered partition of the number of available upgrades and the number of available downgrades subject to being made up of at most 5 parts (for two upgrades, it can be 2 or 1+1) (at most five parts because otherwise there would be no legal place to put the downgrade(s)) find the multinomial coefficient where each number appearing corresponds to the number of each type of part used as well as unused parts and downgrade parts. For two upgrade one downgrade, it would be $\binom{6}{1,1,4}+\binom{6}{2,1,3} = 90$. – JMoravitz Jul 30 '16 at 19:27
• For three upgrade one down, the unordered partitions are 3, 2+1, 1+1+1, giving a total of $\binom{6}{1,1,4}+\binom{6}{1,1,1,3}+\binom{6}{3,1,2} = 210$. Had there been 3 upgrade, one down, and eight different stats, it would be $\binom{8}{1,1,6} + \binom{8}{1,1,1,5}+\binom{8}{3,1,4} = 672$ – JMoravitz Jul 30 '16 at 19:29
• You should add these an answers rather than comments! I can't select a comment as the solution to the question. – baudot Jul 31 '16 at 2:55
• Further, is there a name for this kind of multi-choose operator? What search term would I use to read up on it more? – baudot Jul 31 '16 at 2:55