The following assumptions are taken for this answer
a. All white balls are identical, all black balls are identical.
b. All urns are distinct
c. The order in which balls are placed inside the urn does not matter
10 distinct urns are there, say 1,2,....10. Each urn must have at least one ball.
Case 1 : Any of the 6 urns contain one white ball each. Rest of the 4 urns contain one black ball each. Remaining two black balls are distributed in any two urns.
6 urns can be selected in 10C6 ways.
Put one white ball in each of the selected 6 urns. Since the white balls are identical, this can be done only in 1 way
4 urns can be selected from the remaining 4 urns in 4C4 ways .
Put one black ball in each of the selected 4 urns. 1 way of doing this
Select any two urns in 10C2 ways
Place two black balls in these urns. 1 way of doing so
Total number of ways = 10C6 × 4C4 × 10C2
Case 2 : Any of the 6 urns contain one black ball each. Rest of the 4 urns contain one white ball each. Remaining two white balls are distributed in any two urns
Similar to what we have seen in case 1, this can also be done in 10C6 × 4C4 × 10C2 ways
But case 2 and case 1 together has resulted in overcounting of some of the possibilities . Suppose, in case 1, a white ball is placed in each of the 1-6 urns, a black ball is placed in each of the 7-10 urns and remaining two black ball is placed in 5 and 6, as given below
1 2 3 4 5 6 7 8 9 10
W W W W W W B B B B
B B
Assume, in case 2, a black ball is placed in each of the 5-10 urns, a white ball is placed in each of the 1-4 urns and remaining two white balls are placed in 5 and 6 urns,as given below
1 2 3 4 5 6 7 8 9 10
W W W W B B B B B B
W W
As we observe, such possibilities which are already counted in case1, have been counted in case 2 as well. This overcounting occurs in case 2, when the last two white balls are placed in urns which has a black ball. Count of such possibilities are 10C6 × 4C4 × 6C2. This need to be reduced from the total to balance the effect of overcounting.
Case 3 : Any of the 6 urns contain one white ball each. Rest of the 4 urns contain one black ball each. Remaining two black balls are placed together in any one urn.
6 urns can be selected in 10C6 ways.
Put one white ball in each of the selected 6 urns. 1 way of doing this
4 urns can be selected from the remaining 4 urns in 4C4 ways .
Put one black ball in each of the selected 4 urns. 1 way of doing this
Select any one urn in 10C1 ways
Place two black balls in these urns. 1 way of doing so
Total number of ways = 10C6 × 4C4 × 10C1
Case 4 : Any of the 6 urns contain one black ball each. Rest of the 4 urns contain one white ball each. Remaining two white balls are placed together in any one urn
As seen in case 3, this gives another 10C6 × 4C4 × 10C1 possibilities
Unlike what happened in case 1 and case 2, no overcounting occurs here
Case 5 : Any of the 5 urns contain one white ball each. Rest of the 5 urns contain one black ball each. Remaining one white ball is placed in any of the 5 urns which already has a white ball. Remaining one black ball is placed in any of the 5 urns which already has a black ball.
(Note that if we place the last white ball and/or the last black ball in urns where a different colour ball is already placed, it will result in overcounting of what we have already taken in case 1, case 2, case 3 and case 4)
5 urns can be selected in 10C5 ways.
Put one white ball in each of the selected 5 urns. 1 way of doing this
Remaining 5 urns can be selected in 5C5 ways.
Put one black ball in each of these 5 urns. 1 way of doing this
Select any one urn which has a white ball in 5C1 ways
place the remaining white ball in this urn. 1 way of doing this
Select any one urn which has a black ball in 5C1 ways
place the remaining black ball in this urn. 1 way of doing this
Total number of ways = 10C5 × 5C5 × 5C1 × 5C1
Therefore, required number of ways
= (10C6×4C4×10C2)+(10C6×4C4×10C2)-(10C6×4C4×6C2)+(10C6×4C4×10C1)
+(10C6×4C4×10C1)+(10C5×5C5×5C1×5C1)
= (10C6×10C2)+(10C6×10C2)-(10C6×6C2)+(10C6×10C1)+(10C6×10C1)+(10C5×5C1×5C1)
= 2(10C6×10C2)-(10C6×6C2)+2(10C6×10C1)+(10C5×5C1×5C1)
= 2(210×45)-(210×15)+2(210×10)+(252×5×5)
= 18900 - 3150 + 4200 + 6300
= 26250