# Inclusion Exclusion Principle with mixed lower and upper bounds

I know how to solve most types of these problems, but this one is a bit different.

Problem:

John is getting his friend some balloons for his birthday. He can have 4 types of colors (red, blue, green, yellow) for a total of 25 balloons.

• between 1 and 7 red, • between 2 and 11 blue, • at least 4 green, • at most 6 yellow.

How many combinations of balloons satisfy these conditions?

The green balloons throws me off. I know we can adjust the lower bounds for all colors to 0, and subtract from the total number needed because we know we need at least that initial lower bound. So the conditions become:

0 $$\le$$ red $$\le$$ 6

0 $$\le$$ blue $$\le$$ 9

0 $$\le$$ green

0 $$\le$$ yellow $$\le$$ 6

And the sum is now red + green + blue + yellow = 18

If green had an upper bound, I would solve as follows:

(red $$\le$$ 6 $$\cap$$ blue $$\le$$ 9 $$\cap$$ green $$\le$$ upper bound $$\cap$$ yellow $$\le$$ 6) = $$S_{total}$$ - (red $$\ge$$ 7 $$\cup$$ blue $$\ge$$ 10 $$\cup$$ green $$\ge$$ upper bound + 1 $$\cup$$ yellow $$\ge$$ 7)

And apply inclusion-exclusion principle to the last portion.. But I don't know the upper bound for green.

Does anyone know how I solve this as is?

• I think you should try using the multinomial theorem for these questions. I have seen people use it to solve these combinatorics kind of questions. – Tusky Nov 21 '18 at 6:06
• @Tusky I have to use the method I'm trying to use (using inclusion-exclusion) – Mr.Mips Nov 21 '18 at 6:17
• I added the tag combinatorics since inclusion-exclusion principle problems fall into that broader category. Adding the combinatorics tag will make your question more likely to be seen since there are more combinatorics questions than inclusion-exclusion principle questions. – N. F. Taussig Nov 24 '18 at 12:49

Assume John has already selected $$2$$ blue balloons, $$4$$ green balloons, and $$1$$ red balloon. Then he must select $$18$$ more balloons, of which at most $$9$$ are blue, at most $$6$$ are red, and at most $$6$$ are yellow. Since John can only select $$18$$ more balloons, at most $$18$$ are green. We do not need to concern ourselves with this restriction since John can use as many green balloons as he likes.
If we let $$b$$, $$g$$, $$r$$, and $$y$$ denote the number of additional balloons John selects, then we need to find the number of solutions of the equation $$b + g + r + y = 18 \tag{1}$$ in the nonnegative integers subject to the restrictions $$b \leq 9$$, $$r \leq 6$$, $$y \leq 6$$. While we could impose the restriction $$g \leq 18$$ as well, the number of distributions in which $$g \geq 19$$ is zero.