Signum function



         


In mathematics and especially in computer science, the sign function is a logical function which extracts the sign of a real number. To avoid confusion with the sine function, this function is often called the signum function. The sign function is often represented as sgn and can be defined thus:

<math> \hbox{sgn} \ x = \left\{ \begin{matrix}

-1 \ : \ x < 0 \\ 0 \ : \ x = 0 \\ 1 \ : \ x > 0 \end{matrix} \right. <math>

Any real number can be expressed as the product of its absolute value and its sign function:

<math> x = ( \hbox{sgn} \ x ) \left| x \right|. \qquad \qquad (1)<math>.

From equation (1) it follows that

<math> \hbox{sgn} \ x = {x \over \left| x \right|} \qquad \qquad (2) <math>

but equation (2) is indeterminate when x is set to zero.

The signum function is the derivative of the absolute value function (up to the indeterminacy at zero):

<math> {d \left| x \right| \over dx} = {x \over \left| x \right|}. <math>

Also, the derivative of the signum function is two times the Dirac delta function,

<math> {d \ \hbox{sgn} \, x \over dx} = 2 \delta (x). <math>

The signum function is related to the Heaviside step function h0.5(x) thus

<math> \hbox{sgn} \ x = 2 h_{0.5}(x) - 1, <math>

where the 0.5 subscript of the step function means that <math> h_{0.5}(0) = 0.5. <math>

Also, if the step function h0(x) is thought of as a mathematical switch, with h0(x) = 0, then the signum function can be expressed as

<math> \hbox{sgn} \, x = \left| h_0 (x) \right| (-1)^{h_0(-x)}. <math>
[Top]

See also





  View Live Article   This article is from Wikipedia. All text is available under the terms of the GNU Free Documentation License