I know this might be one of the silliest questions out there but I'm going ahead and ask it here since I've lost practice in mathematics.
I have been reading that the number of subsequences in a string is $2^x$ where $x$ is the length of the string and I have also worked some examples which agree with this, however I still am not very comfortable with this explanation. Can somebody formally prove this in simple terms please? More specifically where does the $2$ come from?
The list of all subsequences for the word "apple" would be "a", "ap", "al", "ae", "app", "apl", "ape", "ale", "appl", "appe", "aple", "apple", "p", "pp", "pl", "pe", "ppl", "ppe", "ple", "pple", "l", "le", "e", "".
, because this would only be the list of the unique subsequences (24), while for the wordapple
, all the subsequences will be 32 (asp
appears twice in the string). Correct? – user3019105 Dec 12 '19 at 10:38