Share
Explore BrainMass

Using constraints and inclusion-exclusion principle

How many solutions does u1+u2+u3+u4 = 30 have in non-negative integers with u1 >=3, u2 <= 8, 3 <= u3 <=8, u4 >=0?

Ok, my attempt. Let v1 = u1 - 3, v2 = u2, v3 = u3 - 3 and v4 = u4. Then we have v1+v2+v3+v4 = 24 with v1 >= 0, v2 <=8, v3 <= 5, v4 >=0. So without constraints there are C(24+4-1, 24) = C(21,24) solutions (is this right?). And the only contraints we have to worry about now are v2 <=8 and v3 <= 5.

But how do we cater for the remaining constraints using inclusion-exclusion?

Cheers!

Solution Summary

The number of solutions is found, subject to constraints.

$2.19