A box contains 8 red marbles, 8 green marbles, and 10 black marbles. A sample of 12 marbles is to be picked from the box. How many samples contain exactly 7 red marbles or exactly 6 green marbles?

The answer key sets it up as (8 nCr 7)*(18 nCr 5)+(8 nCr 6)*(18 nCr 6)=588,336. Where does the (18 nCr 5) and (18 nCr 6) come from?

18 marbles are not red

... 5 of those are the remainder of the 12 marbles picked

18 marbles are not green
... 6 of those are the remainder of the 12 marbles picked

To determine the number of samples that contain exactly 7 red marbles or exactly 6 green marbles, you need to consider two scenarios:

1. When there are exactly 7 red marbles:
- The number of ways to choose 7 red marbles out of 8 is represented as (8 nCr 7). This is calculated as 8! / (7! * (8-7)!), which equals 8.
- Since you have chosen 7 red marbles, you need to select 5 more marbles from the remaining 18 marbles (8 green + 10 black). This is represented as (18 nCr 5) or 18! / (5! * (18-5)!), which equals 8568.
- Therefore, the number of samples with exactly 7 red marbles is (8 nCr 7) * (18 nCr 5) = 8 * 8568 = 68,544.

2. When there are exactly 6 green marbles:
- The number of ways to choose 6 green marbles out of 8 is represented as (8 nCr 6). This is calculated as 8! / (6! * (8-6)!), which equals 28.
- Since you have chosen 6 green marbles, you need to select 6 more marbles from the remaining 18 marbles (8 red + 10 black). This is represented as (18 nCr 6) or 18! / (6! * (18-6)!), which equals 18,564.
- Therefore, the number of samples with exactly 6 green marbles is (8 nCr 6) * (18 nCr 6) = 28 * 18,564 = 518,352.

Finally, to calculate the total number of samples containing exactly 7 red marbles or exactly 6 green marbles, you add the results from both scenarios:
Total = (8 nCr 7) * (18 nCr 5) + (8 nCr 6) * (18 nCr 6) = 68,544 + 518,352 = 586,896.

The value mentioned in the answer key, 588,336, seems to be a slight typo. The correct result should be 586,896 as that's the sum of the two scenarios.

In the given question, we need to determine the number of samples that contain exactly 7 red marbles or exactly 6 green marbles. To find this, we break the problem into two cases: one for exactly 7 red marbles and another for exactly 6 green marbles.

1. Case 1: Exactly 7 red marbles.
There are 8 red marbles in the box, and we need to choose 7 of them. This can be denoted as 8 nCr 7 (pronounced as "8 choose 7"), which represents the number of ways to choose 7 objects out of 8 without considering their order.

For the remaining 5 marbles in the sample, we need to choose them from the remaining marbles in the box (which includes the green and black marbles). There are 8 green marbles and 10 black marbles, totaling 18 marbles. So, we need to choose 5 marbles out of the remaining 18. This can be represented as 18 nCr 5.

Therefore, the number of samples containing exactly 7 red marbles is given by (8 nCr 7) * (18 nCr 5).

2. Case 2: Exactly 6 green marbles.
Similar to Case 1, we have 8 green marbles in the box, and we need to choose 6 of them, represented as 8 nCr 6.

For the remaining 6 marbles in the sample, we need to choose them from the remaining 18 marbles in the box. So, we choose 6 marbles out of the remaining 18, denoted as 18 nCr 6.

Therefore, the number of samples containing exactly 6 green marbles is given by (8 nCr 6) * (18 nCr 6).

Finally, to find the total number of samples containing either 7 red marbles or 6 green marbles, we add the results of both cases:
(8 nCr 7) * (18 nCr 5) + (8 nCr 6) * (18 nCr 6) = 588,336.