Number of sub-sequences in a given sequence

前端 未结 12 653
傲寒
傲寒 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:45

    Basically you will have twice as many subsequences for each new number since you'll have (2^(m-1)) "equivalent" subsequences that are shifted one space to the right (assuming horizontal ordering and adding in the right) plus the subsequence of all elements.

提交回复
热议问题