Number of sub-sequences in a given sequence

前端 未结 12 602
傲寒
傲寒 2021-01-30 18:18

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

12条回答
  •  时光说笑
    2021-01-30 18:46

    For each element in a sequence of length m, you can either select it or leave it. Thus, there are 2 ways to deal with each element. Therefore, the total no. of ways to deal with all the m elements is 2*2*2...... m times = 2^m times.

提交回复
热议问题