I have a sequence (with unique elements): $a = (1,4,9)$. Is there a short notation for the same set, but without the last element: $b = (1,4)$?

I came up with one solution, which simple removes the last item by index: $$b =a \setminus \{ a_{|a|-1}\}$$ or by taking all except the last: $$b = (a_0,...,a_{|a|-2})$$

However i am hoping to find something shorter, like $a_{-1}$ or something in that direction. Is there a standard way of doing this?

  • $\begingroup$ If you are talking about vectors, I would use something like $b = a_{1:(n-1)}$ or $b = a_{\llbracket 1, n-1 \rrbracket}$, with $a\in\mathbb{R}^n$. $\endgroup$ – Karlo Apr 9 '18 at 22:51
  • $\begingroup$ If you are talking about a set $a = {1, 4, 9}$, then $b = a$ \ $\{9\}$. $\endgroup$ – Karlo Apr 9 '18 at 22:52
  • $\begingroup$ Addendum to the vector case: it seems that \llbracket and \rrbracket are not displayed correctly on SE, see also this question. $\endgroup$ – Karlo Apr 9 '18 at 22:57

Sometimes notation like $$(a_1,\ldots,\widehat{a_k},\ldots,a_n)=(a_1,\ldots,a_{k-1},a_{k +1},\ldots,a_n)$$ is used. The element with the hat is omitted. There are ways to shorten it further, such as $$(a_{\widehat{k}})$$

  • $\begingroup$ How would one then write this for the last element, considering that is not upfront specified that $a_n$ is the last element? Something like: $a_ {\widehat{|a|-1}}$ ? $\endgroup$ – user3053216 Apr 10 '18 at 0:34
  • $\begingroup$ Wow this actually works. Sometimes i like latex $\endgroup$ – user3053216 Apr 10 '18 at 0:39
  • $\begingroup$ In your case, $a=(1,4,9)=(a_1,a_2,a_3)$ with $a_1=1$, $a_2=4$, and $a_3=9$. Then $$(a_{\widehat{3}})=(a_1,a_2)=(1,4)$$ $\endgroup$ – MPW Apr 10 '18 at 0:41
  • $\begingroup$ That is not a notation for the last item, but for the third one. A notation for the last one should work regardless of the length of the set. $\endgroup$ – user3053216 Apr 10 '18 at 0:44
  • 2
    $\begingroup$ Ok I misunderstood. I thought you meant a sequence with known fixed length. If the length is variable, then your suggested amendment works. You can make up any notation that works, of course! For that matter, you could just declare that $\widehat{a}$ is the (finite) sequence $a$ with its last element omitted. $\endgroup$ – MPW Apr 10 '18 at 0:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.