Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The definition of a subsequence is if you have a(n) as a sequence of real numbers and n_1 < n_2 <n_3 < ... is an increasing sequence of integers then

a(n_1), a(n_2), a(n_3), ... is a subsequence of a_n and is denoted a(n_k).

So the indexes don't need to be contiguous, just increasing.

So in your example 2, 1, 1/2, 1/3, ... is a decreasing subsequence.

edit: changed to using function-style notation because the nested subscript notation looks confusing in ascii



Thanks. I was thinking subsequence ~ substring but that’s a false analogy apparently!


Yeah it’s a bit confusing. It’s also confusing when you see them written because they’re actually written usually with a nested subscript. Like

   a
    n
     k
With the k smaller than the n which is in turn smaller than the a. Sequences of all kinds are just a function from the integers to the reals so I don’t know why we had to go and invent a whole new notation for them just to be extra obtuse.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: