Given two nonnegative integers m and n, how many distinct strings can be formed that contain exactly m copies of the character 'a' and n copies of the character 'b'? Provide the closed-form count and a short justification.
Then generalize your answer to an alphabet with k distinct characters occurring with counts c1, c2, ..., ck (with c1 + c2 + ... + ck = N), and give the corresponding formula.
Login required