Consider the construction of a string of characters which is C characters in length, by randomly selecting from an N-character alphabet (selecting randomly
with replacement).
If the probability that all characters are distinct equals the probability that exactly one character appears twice but all the other characters appear just once, then what is the number of characters in the alphabet?
Find N in terms of C.
(In reply to
Seems to be this by Charlie)
Why even bring in the computer when you already did the analytical work to express each half? Since the two scenarios are to be equally likely then just equate them.
C(n,c)*c! / n^c = n*C(n-1,c-2)*c!/2 / n^c
C(n,c) = (1/2)*n*C(n-1,c-2)
n! / [c!*(n-c)!] = (1/2) * n * (n-1)! / [(c-2)!*(n-c+1)!]
1/[c!*(n-c)!] = (1/2)*[(c-2)!*(n-c+1)!]
c!*(n-c)! = 2*(c-2)!*(n-c+1)!
c!/(c-2)! = 2*(n-c+1)!/(n-c)!
c*(c-1) = 2*(n-c+1)
c*(c-1)/2+c-1 = n
(1/2)*c^2 + (1/2)*c - 1 = n