.
Below is another solution, which leads to the same answer.
To answer the question, we need to know the number of cookies that have chocolate chips OR Pecans.
For it, add the numbers 10 and 15 that are known as containing chocolate chips or pecans, respectively.
But doing this way, we count TWICE that 6 cookies that contain BOTH chocolate chips and pecans.
Therefore, we should subtract that 6 from the sum of 10 and 15, and doing so, we obtain the exact number of cookies
that have chocolate chips OR pecans
10 + 15 - 6 = 19.
Now the probability under the question is
.
In probabilistic terms
We have a subset "C" of cookies with chocolate chips - it has 10 elements and the probability to chose from it is p(C) =
.
We have a subset "P" of cookies with pecans - it has 15 elements and the probability to chose from it is p(P) =
.
We have a subset "CP" of cookies with chocolate chips AND pecans - it has 6 elements and the probability to chose from it is p(CP) =
.
Note that subset "CP" is exactly the intersection of subsets "C" and "P" : CP = (C & P).
Then the basic formula of the Probability theory says that
p(C U P) = p(C) + p(P) - p(C & P) =
+
-
=
.
Thus both approaches give the same result.
--------------
The lesson to learn from my post is THIS :
1. If P and C are two subsets of the finite universal set U, then the numbers of elements in sets
C, P, (C U P) and (C & P) (intersection) are connected by the identity
n(C U P) = n(C) + n(P) - n(C & P). (1)
2. In the same situation, probabilities are connected by the identity
p(C U P) = p(C) + p(P) - p(C & P). (2)
The formulas (1) and (2) are always valid : they are UNIVERSAL.
--------------
See the lesson
- Counting elements in sub-sets of a given finite set
in this site.