In how many ways can 15 identical lots be split among 4 desks so that each desk receives at least 2 and at most 6?

In how many ways can 15 identical lots be split among 4 desks so that each desk receives at least 2 and at most 6?

Approach: Shift each variable down by its lower bound to remove the minimum, apply stars and bars for the unrestricted count, then subtract the assignments that break the upper bound.

80. Set y_i = x_i - 2 to clear the lower bounds, so the y_i are non-negative, sum to 15 - 8 = 7, and each is at most 4. The unrestricted stars and bars count for 7 identical items in 4 boxes is C(7 + 3, 3) = C(10, 3) = 120. A violation means some y_i is at least 5, and the change of variable y_i' = y_i - 5 leaves a sum of 2 in 4 boxes, giving C(5, 3) = 10 arrangements for each of the 4 choices of the offending desk, so 40 in total. Two desks cannot both exceed the upper bound constraint since that would need at least 10 against a total of 7, so no inclusion-exclusion term is added back and the answer is 120 - 40 = 80.

Follow-up: How many ways are there if the desks are distinguishable only by size, so any permutation of the same multiset counts once?

Key concepts: stars and bars, inclusion-exclusion, change of variable, upper bound constraint.