for example have list of letters: "a, b, c, a, d, a, a, b" how can find number of combinations can made of letters? length. combinations "ab" , "ba", "aab" , "aba" - not unique.
let's there c(i) entries of i-th element in given set. number of possible subsets (not counting empty one) is
m = (ะก[1] + 1) * (c[2] + 1) * ...* (c[n] + 1) - 1 // product of these values
for example (4 x a, 2 x b, 1 x c, 1 x d)
m = (4+1)*(2+1)*(1+1)*(1+1)-1 = 5*3*2*2-1 = 59
Comments
Post a Comment