If I am given a sequence X = {x1,x2,....xm}
, then I will have (2^m)
subsequences.
Can anyone please explain how can I arrive at this formula intuitivel
For any sequence X = {x1,x2,....xm}, there will be (2^m) sub-sequences, because you can "choose" sub-sequences of length 0,1,2,...,m ,i.e., mathematically it is
"C(m,0) + C(m,1) + ... C(m,m)" which leads to 2^m.
For e.g., say the string is "abc", then
C(3,0) = 1, ""
C(3,1) = 3, "a", "b", "c"
C(3,2) = 3, "ab", "bc", "ac"
C(3,3) = 1, "abc"
number of subsequences are 8 i.e., 2^3.
For more details visit http://en.wikipedia.org/wiki/Binomial_coefficient#Series_involving_binomial_coefficients