Let us name the 5 red balls as R1, R2, R3, R4, R5 and the 2 black balls as B1, B2.
Now, let us, temporarily, treat R1, R2, R3, R4, R5 as different balls and B1, B2 as different balls. Then, the number of permutations of 7(=n) different balls taken 2(=r) at a time, and the balls do not repeat is given by
nPr=n!/(n−r)!
7P2= 7!/5!= 7x6= 42.
But we know that the balls are not all different.Thus, let us now treat R1, R2, R3, R4, R5 as the same red balls and B1, B2 as the same black balls. Then,
the 20 arrangements
{R1,R2}, {R1,R3}, {R1,R4}, {R1,R5},
{R2,R1}, ... , {R2,R5},
{R3,R1}, ... , {R3,R5},
{R4,R1}, ... , {R4,R5},
{R5,R1}, ... , {R5,R4}
would be exactly the same as one another and can be written as one of four permutations {R,R}.
Similarly, the 2 arrangements (B1,B2}, {B2,B1} would be exactly the same as one another and can be written as one of four permutations {B,B}.
Now, each of the remaining two permutations {R,B} and {B,R} would have 10 corresponding arrangements ( do them for yourself).
Thus ,we can account: 20+2+10+10=42 arrangements ( if we treat the balls as different) have been condensed into 4 permutations.
Now, let us see where you committed a mistake:
nPr=n!/(n−r)!⋅p!
There is indeed no such formula for the number of permutations of n objects( in which p1 are of one kind, p2 are of second kind... pk are of kth kind and the rest, if any, are different) for r objects taken at a time.
Yes, if all the n objects are taken at a time, then we have
Required number of permutations= n!/p1!xp2!x...xpk!
Thank you,
nobjects whereP1objects are of one kind,P2of second kind, ...Pkofkth kind and the rest if any are of different kind isn! / (P1! × P2! ... × Pk!). In your case it will becomen! / p!. Source : see topic 7.3.4 in this pdf for explanation – frakod Nov 05 '21 at 09:22