2

This might not only be related to latex, but I'm struggling to find a way of expressing a condition which is if a vector contains at least one element that is greater than zero.

Currently I have this, but I'm not sure if it is mathematically correct and neither is the latex code that great:

\begin{equation}
    f(x)= 
    \begin{cases}
        1,& \text{if } \exists \, x_i > 0\\
        0,              & \text{otherwise}
    \end{cases}
    \qquad s \in \mathbb{R}_+, x \in \mathbb{R}^{n}, n \in \mathbb{N}
\end{equation}

closed as off-topic by Werner, Stefan Pinnow, Raaja, Marijn, siracusa Mar 26 at 3:18

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center." – Werner, Stefan Pinnow, Raaja, Marijn, siracusa
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    A vector $x=(x_1,\dots,x_n)\in\mathbb{R}^n$ is called \emph{nonpositive} if $x_i\le0$, for every $i$. Define $f(x)=0$ if $x$ is nonpositive and $f(x)=1$ otherwise. – egreg Mar 25 at 17:11
  • 1
    That's an abuse of \exists. Properly, you should write \exists i\colone x_i>0, but that is awkward. Just use words instead. I think \text{if some $x_i>0$} is clear enough, though again, \text{if $x_i>0$ for some $i$} is more correct. But the rewording by @egreg is pretty good, too. – Harald Hanche-Olsen Mar 25 at 17:13
2

Something like this?

enter image description here

\documentclass{article}
\usepackage{amsmath,amssymb}
\begin{document}
Let $n\in\mathbb{N}$ and $\mathbf{x}=
  \begin{pmatrix}x_1&x_2&\dots&x_n\end{pmatrix}'\in\mathbb{R}^n$. Then
\[
f(\mathbf{x})=
\begin{cases}
1 & \text{if $\max_i x_i>0$,}\\
0 & \text{otherwise.}
\end{cases}
\]

In words: $f(\mathbf{x})=1$ if at least one $x_i>0$, $i=1,\dots,n$.
\end{document}  

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