6
$\begingroup$

Is there any standard function that outputs $1$ if an inequality is true and $0$ otherwise? e.g

$$F = \begin{cases} 1 & \text{if }x>D\\ 0 & \text{otherwise} \end{cases}$$

$\endgroup$
3
$\begingroup$

You've just defined such a function; for your particular condition, this is known as a step function. In the context of probability theory, it's called an indicator function. Some common notations are $\mathbf{1}_{x>D}$ and $[\![ x>D ]\!]$.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ Thanks for so much for your comments. :) $\endgroup$ – Shimano May 13 '15 at 2:02
4
$\begingroup$

See the Heaviside Step Function defined by

$$\theta(x) = \begin{cases}1, & x \ge 0 \\ 0, & x < 0 \end{cases},$$

with

$$\theta(x-c) = \begin{cases}1, & x \ge c \\ 0, & x < c \end{cases}.$$

| cite | improve this answer | |
$\endgroup$
  • 1
    $\begingroup$ Thanks for so much for your comments :). Very helpful $\endgroup$ – Shimano May 13 '15 at 2:02
  • $\begingroup$ @Shimano No problem, happy to help :) $\endgroup$ – MathMajor May 13 '15 at 2:13
2
$\begingroup$

The problem with using the Heaviside function is that there are several conventions at to what $H(0)$ should equal. Sometimes it is $0$, sometimes it is $\frac{1}{2}$, sometimes it is $1$. To avoid ambiguity, we can write the Kronecker delta $f(x) = H(x) \cdot (1-\delta_{0,x})$; this ensures that $$f(x) =\left\{ \begin{aligned} &0 & x \leq 0 \\ &1 & x > 1 \end{aligned} \right.$$ In the case of the particular example that you gave, this would be $F(x) = H(x-D) \cdot (1-\delta_{D,x})$.

Given all this, I think Yuval Filmus's answer with the indicator function $\Bbb{1}_{x>D}$ is simpler.

| cite | improve this answer | |
$\endgroup$

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.