# Thread: Counting using inclusion/exclusion principle.

1. ## Counting using inclusion/exclusion principle.

Hello, I did this problem and wanted to know if I was correct since the answer in the back the book is different.

Question:

In how many ways can a child take 11 candies where there are four types of candies if the child does not take exactly 2 pieces of any type?

I will use inclusion/exclusion. Let

$A_1$ = {selections of candy with exactly two pieces of type 1)
$A_2$ = {selections of candy with exactly two pieces of type 2)
$A_3$ = {selections of candy with exactly two pieces of type 3)
$A_4$ = {selections of candy with exactly two pieces of type 4)

the cardinality of the universe is $C(14,11)$ (11 dots, 3 slashes)

For cardinality of $A_1$, we put two candies in type 1 and we have to distribute the remaining 9 candies into the other three types. (9 dots, 2 slashes)

so $n(A_1) =$ $C(11,9)$

(note: this is also the cardinality of $A_2,A_3,A_4$)

For intersections of two, there are 6 such intersections. They have cardinality $C(8,7)$. (i.e. we have exactly two of two types, distribute the remaining 7 candies among the two other types. 7 dots, 1 slash)

for intersections of three, there are four such intersections.

Fix two candies in three types, place remaining 5 in fourth type.

the cardinality is $C(5,0)$ or 1.

The intersection of all four is empty. Since 2+2+2+2 $\neq$ 11

So via IEP

$n(A_1 \cup A_2 \cup A_3 \cup A_4) = 4*C(11,9)-6*C(8,7)+4$

subtract above from $n(U)$

$C(14,11)-[4*C(11,9)-6*C(8,7)+4]$

I was wondering if I did this correctly since the answer in the book does not have the $+4$ at the end.

Thanks for helping me. Please let me know if I should clarify anything.

2. ## Re: Counting using inclusion/exclusion principle.

Originally Posted by Jame
Hello, I did this problem and wanted to know if I was correct since the answer in the back the book is different.
Question: In how many ways can a child take 11 candies where there are four types of candies if the child does not take exactly 2 pieces of any type?
$A_1$ = {selections of candy with exactly two pieces of type 1)
$A_2$ = {selections of candy with exactly two pieces of type 2)
$A_3$ = {selections of candy with exactly two pieces of type 3)
$A_4$ = {selections of candy with exactly two pieces of type 4)
For cardinality of $A_1$, we put two candies in type 1 and we have to distribute the remaining 9 candies into the other three types. (9 dots, 2 slashes)

so $n(A_1) =$ $C(11,9)$

(note: this is also the cardinality of $A_2,A_3,A_4$)

For intersections of two, there are 6 such intersections. They have cardinality $C(8,7)$. (i.e. we have exactly two of two types, distribute the remaining 7 candies among the two other types. 7 dots, 1 slash) for intersections of three, there are four such intersections.

Fix two candies in three types, place remaining 5 in fourth type.

the cardinality is $C(5,0)$ or 1.

The intersection of all four is empty. Since 2+2+2+2 $\neq$ 11

So via IEP

$n(A_1 \cup A_2 \cup A_3 \cup A_4) = 4*C(11,9)-6*C(8,7)+4$

subtract above from $n(U)$

$C(14,11)-[4*C(11,9)-6*C(8,7)+4]$

I was wondering if I did this correctly since the answer in the book does not have the $+4$ at the end.

Thanks for helping me. Please let me know if I should clarify anything.
You are correct.