In this question, as it was specifically 9, after accounting for atleast one in each of the 4 dice we get a+b+c+d=5 and here each of a,b,c,d can be max 5 meaning each dice can be max 6 so that is valid. But how to solve such a sum if instead of 9, it was asked for something bigger like 12?
Please log in to comment and participate in discussions.
Watch the afterboards topic video on PnC, titled under "No of solutions", you can learn the method from there.
Else the general form for such equations is, (n+r-1)C(r-1)
(Stars and bars method or as Bhavesh Bhaiya calls it pp method^^)
Academic discussion and doubt solving for: Logarithms, Set Theory, Matrices & Determinants, Permutation & Combination, Probability, Binomial Theorem
Create an account to join our community and participate in discussions.
for sum = 9, it worked cleanly because after giving 1 to each die, you got
a + b + c + d = 5 and the upper bound (≤5) didn’t matter
but when the sum becomes bigger like 12, the upper bound starts mattering
let’s see how to think about it
sum = 12
give 1 to each → let xi = ai − 1
so:
x1 + x2 + x3 + x4 = 12 − 4 = 8
and now each xi can be from 0 to 5 (because original die max is 6)
step 1 (ignore upper bound):
number of non-negative solutions = C(8+4−1, 3) = C(11,3)
step 2 (remove invalid cases where any xi > 5)
if any xi ≥ 6, say x1 ≥ 6
put x1 = y1 + 6
then:
y1 + x2 + x3 + x4 = 2
number of such solutions = C(2+4−1,3) = C(5,3)
this can happen for any of the 4 variables → multiply by 4
step 3 (check double violations)
can two variables be ≥6?
no, because 6+6 = 12 > 8, impossible
so no need to add back anything
final answer:
C(11,3) − 4×C(5,3)
= 165 − 4×10
= 165 − 40 = 125
so the key idea is:
small sums → upper bound doesn’t matter
bigger sums → use stars & bars minus cases where variable exceeds limit