Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Sign function

From Wikipedia, the free encyclopedia
Function returning minus 1, zero or plus 1
"Sgn" redirects here. For other uses, seeSGN (disambiguation).
Not to be confused withSign relation orSine function.
Signum functiony=sgnx{\displaystyle y=\operatorname {sgn} x}

Inmathematics, thesign function orsignum function (fromsignum,Latin for "sign") is afunction that has the value−1,+1 or0 according to whether thesign of a givenreal number is positive or negative, or the given number is itself zero. Inmathematical notation the sign function is often represented assgnx{\displaystyle \operatorname {sgn} x} orsgn(x){\displaystyle \operatorname {sgn}(x)}.[1]

Definition

[edit]

The signum function of a real numberx{\displaystyle x} is apiecewise function which is defined as follows:[1]sgnx:={1if x<0,0if x=0,1if x>0.{\displaystyle \operatorname {sgn} x:={\begin{cases}-1&{\text{if }}x<0,\\0&{\text{if }}x=0,\\1&{\text{if }}x>0.\end{cases}}}

Thelaw of trichotomy states that every real number must be positive, negative or zero.The signum function denotes which unique category a number falls into by mapping it to one of the values−1,+1 or0, which can then be used in mathematical expressions or further calculations.

For example:sgn(2)=+1,sgn(π)=+1,sgn(8)=1,sgn(12)=1,sgn(0)=0.{\displaystyle {\begin{array}{lcr}\operatorname {sgn}(2)&=&+1\,,\\\operatorname {sgn}(\pi )&=&+1\,,\\\operatorname {sgn}(-8)&=&-1\,,\\\operatorname {sgn}(-{\frac {1}{2}})&=&-1\,,\\\operatorname {sgn}(0)&=&0\,.\end{array}}}

Basic properties

[edit]

Any real number can be expressed as the product of itsabsolute value and its sign:x=|x|sgnx.{\displaystyle x=|x|\operatorname {sgn} x\,.}

It follows that wheneverx{\displaystyle x} is not equal to 0 we havesgnx=x|x|=|x|x.{\displaystyle \operatorname {sgn} x={\frac {x}{|x|}}={\frac {|x|}{x}}\,.}

Similarly, forany real numberx{\displaystyle x},|x|=xsgnx.{\displaystyle |x|=x\operatorname {sgn} x\,.}We can also be certain that:sgn(xy)=(sgnx)(sgny),{\displaystyle \operatorname {sgn}(xy)=(\operatorname {sgn} x)(\operatorname {sgn} y)\,,}and sosgn(xn)=(sgnx)n.{\displaystyle \operatorname {sgn}(x^{n})=(\operatorname {sgn} x)^{n}\,.}

Some algebraic identities

[edit]

The signum can also be written using theIverson bracket notation:sgnx=[x>0][x<0].{\displaystyle \operatorname {sgn} x=[x>0]-[x<0]\,.}

The signum can also be written using thefloor and the absolute value functions:sgnx=x|x|+1x|x|+1.{\displaystyle \operatorname {sgn} x={\Biggl \lfloor }{\frac {x}{|x|+1}}{\Biggr \rfloor }-{\Biggl \lfloor }{\frac {-x}{|x|+1}}{\Biggr \rfloor }\,.}If00{\displaystyle 0^{0}} isaccepted to be equal to 1, the signum can also be written for all real numbers assgnx=0(|x|x)0(|x|+x).{\displaystyle \operatorname {sgn} x=0^{\left(\left\vert x\right\vert -x\right)}-0^{\left(\left\vert x\right\vert +x\right)}\,.}

Properties in mathematical analysis

[edit]

Discontinuity at zero

[edit]
The sign function is not continuous atx=0{\displaystyle x=0}.

Although the sign function takes the value−1 whenx{\displaystyle x} is negative, the ringed point(0, −1) in the plot ofsgnx{\displaystyle \operatorname {sgn} x} indicates that this is not the case whenx=0{\displaystyle x=0}. Instead, the value jumps abruptly to the solid point at(0, 0) wheresgn(0)=0{\displaystyle \operatorname {sgn}(0)=0}. There is then a similar jump tosgn(x)=+1{\displaystyle \operatorname {sgn}(x)=+1} whenx{\displaystyle x} is positive. Either jump demonstrates visually that the sign functionsgnx{\displaystyle \operatorname {sgn} x} is discontinuous at zero, even though it is continuous at any point wherex{\displaystyle x} is either positive or negative.

These observations are confirmed by any of the various equivalent formal definitions ofcontinuity inmathematical analysis. A functionf(x){\displaystyle f(x)}, such assgn(x),{\displaystyle \operatorname {sgn}(x),} is continuous at a pointx=a{\displaystyle x=a} if the valuef(a){\displaystyle f(a)} can be approximated arbitrarily closely by thesequence of valuesf(a1),f(a2),f(a3),,{\displaystyle f(a_{1}),f(a_{2}),f(a_{3}),\dots ,} where thean{\displaystyle a_{n}} make up any infinite sequence which becomes arbitrarily close toa{\displaystyle a} asn{\displaystyle n} becomes sufficiently large. In the notation of mathematicallimits, continuity off{\displaystyle f} ata{\displaystyle a} requires thatf(an)f(a){\displaystyle f(a_{n})\to f(a)} asn{\displaystyle n\to \infty } for any sequence(an)n=1{\displaystyle \left(a_{n}\right)_{n=1}^{\infty }} for whichana.{\displaystyle a_{n}\to a.} The arrow symbol can be read to meanapproaches, ortends to, and it applies to the sequence as a whole.

This criterion fails for the sign function ata=0{\displaystyle a=0}. For example, we can choosean{\displaystyle a_{n}} to be the sequence1,12,13,14,,{\displaystyle 1,{\tfrac {1}{2}},{\tfrac {1}{3}},{\tfrac {1}{4}},\dots ,} which tends towards zero asn{\displaystyle n} increases towards infinity. In this case,ana{\displaystyle a_{n}\to a} as required, butsgn(a)=0{\displaystyle \operatorname {sgn}(a)=0} andsgn(an)=+1{\displaystyle \operatorname {sgn}(a_{n})=+1} for eachn,{\displaystyle n,} so thatsgn(an)1sgn(a){\displaystyle \operatorname {sgn}(a_{n})\to 1\neq \operatorname {sgn}(a)}. This counterexample confirms more formally the discontinuity ofsgnx{\displaystyle \operatorname {sgn} x} at zero that is visible in the plot.

Despite the sign function having a very simple form, the step change at zero causes difficulties for traditionalcalculus techniques, which are quite stringent in their requirements. Continuity is a frequent constraint. One solution can be to approximate the sign function by a smooth continuous function; others might involve less stringent approaches that build on classical methods to accommodate larger classes of function.

Smooth approximations and limits

[edit]

The signum function can be given as a number of different (pointwise) limits:sgnx=limn12nx1+2nx=limn2πarctan(nx)=limntanh(nx)=limε0xx2+ε2.{\displaystyle {\begin{aligned}\operatorname {sgn} x&=\lim _{n\to \infty }{\frac {1-2^{-nx}}{1+2^{-nx}}}\\&=\lim _{n\to \infty }{\frac {2}{\pi }}\operatorname {arctan} (nx)\\&=\lim _{n\to \infty }\tanh(nx)\\&=\lim _{\varepsilon \to 0}{\frac {x}{\sqrt {x^{2}+\varepsilon ^{2}}}}.\end{aligned}}}Here,tanh{\displaystyle \tanh } is thehyperbolic tangent, andarctan{\displaystyle \operatorname {arctan} } is theinverse tangent. The last of these is the derivative ofx2+ε2{\displaystyle {\sqrt {x^{2}+\varepsilon ^{2}}}}. This is inspired from the fact that the above is exactly equal for all nonzerox{\displaystyle x} ifε=0{\displaystyle \varepsilon =0}, and has the advantage of simple generalization to higher-dimensional analogues of the sign function (for example, the partial derivatives ofx2+y2{\displaystyle {\sqrt {x^{2}+y^{2}}}}).

SeeHeaviside step function § Analytic approximations.

Differentiation

[edit]

The signum functionsgnx{\displaystyle \operatorname {sgn} x} isdifferentiable everywhere except whenx=0.{\displaystyle x=0.} Itsderivative is zero whenx{\displaystyle x} is non-zero:d(sgnx)dx=0for x0.{\displaystyle {\frac {{\text{d}}\,(\operatorname {sgn} x)}{{\text{d}}x}}=0\qquad {\text{for }}x\neq 0\,.}

This follows from the differentiability of anyconstant function, for which the derivative is always zero on its domain of definition. The signumsgnx{\displaystyle \operatorname {sgn} x} acts as a constant function when it is restricted to the negativeopen regionx<0,{\displaystyle x<0,} where it equals−1. It can similarly be regarded as a constant function within the positive open regionx>0,{\displaystyle x>0,} where the corresponding constant is+1. Although these are two different constant functions, their derivative is equal to zero in each case.

It is not possible to define a classical derivative atx=0{\displaystyle x=0}, because there is a discontinuity there.

Although it is not differentiable atx=0{\displaystyle x=0} in the ordinary sense, under the generalized notion of differentiation indistribution theory, the derivative of the signum function is two times theDirac delta function. This can be demonstrated using the identity[2]sgnx=2H(x)1,{\displaystyle \operatorname {sgn} x=2H(x)-1\,,}whereH(x){\displaystyle H(x)} is theHeaviside step function using the standardH(0)=12{\displaystyle H(0)={\frac {1}{2}}} formalism.Using this identity, it is easy to derive the distributional derivative:[3]dsgnxdx=2dH(x)dx=2δ(x).{\displaystyle {\frac {{\text{d}}\operatorname {sgn} x}{{\text{d}}x}}=2{\frac {{\text{d}}H(x)}{{\text{d}}x}}=2\delta (x)\,.}

Integration

[edit]

The signum function has adefinite integral between any pair of finite valuesa andb, even when the interval of integration includes zero. The resulting integral fora andb is then equal to the difference between their absolute values:ab(sgnx)dx=|b||a|.{\displaystyle \int _{a}^{b}(\operatorname {sgn} x)\,{\text{d}}x=|b|-|a|\,.}

In fact, the signum function is the derivative of the absolute value function, except where there is an abrupt change ingradient at zero:d|x|dx=sgnxfor x0.{\displaystyle {\frac {{\text{d}}|x|}{{\text{d}}x}}=\operatorname {sgn} x\qquad {\text{for }}x\neq 0\,.}

We can understand this as before by considering the definition of the absolute value|x|{\displaystyle |x|} on the separate regionsx>0{\displaystyle x>0} andx<0.{\displaystyle x<0.} For example, the absolute value function is identical tox{\displaystyle x} in the regionx>0,{\displaystyle x>0,} whose derivative is the constant value+1, which equals the value ofsgnx{\displaystyle \operatorname {sgn} x} there.

Because the absolute value is aconvex function, there is at least onesubderivative at every point, including at the origin. Everywhere except zero, the resultingsubdifferential consists of a single value, equal to the value of the sign function. In contrast, there are many subderivatives at zero, with just one of them taking the valuesgn(0)=0{\displaystyle \operatorname {sgn}(0)=0}. A subderivative value0 occurs here because the absolute value function is at a minimum. The full family of valid subderivatives at zero constitutes the subdifferential interval[1,1]{\displaystyle [-1,1]}, which might be thought of informally as "filling in" the graph of the sign function with a vertical line through the origin, making it continuous as a two dimensional curve.

In integration theory, the signum function is aweak derivative of the absolute value function. Weak derivatives are equivalent if they are equalalmost everywhere, making them impervious to isolated anomalies at a single point. This includes the change in gradient of the absolute value function at zero, which prohibits there being a classical derivative.

Fourier transform

[edit]

TheFourier transform of the signum function is[4]PV(sgnx)eikxdx=2ikfor k0,{\displaystyle PV\int _{-\infty }^{\infty }(\operatorname {sgn} x)e^{-ikx}{\text{d}}x={\frac {2}{ik}}\qquad {\text{for }}k\neq 0,}wherePV{\displaystyle PV} means taking theCauchy principal value.

Generalizations

[edit]

Complex signum

[edit]

The signum function can be generalized tocomplex numbers as:sgnz=z|z|{\displaystyle \operatorname {sgn} z={\frac {z}{|z|}}}for any complex numberz{\displaystyle z} exceptz=0{\displaystyle z=0}. The signum of a given complex numberz{\displaystyle z} is thepoint on theunit circle of thecomplex plane that is nearest toz{\displaystyle z}. Then, forz0{\displaystyle z\neq 0},sgnz=eiargz,{\displaystyle \operatorname {sgn} z=e^{i\arg z}\,,}wherearg{\displaystyle \arg } is thecomplex argument function.

For reasons of symmetry, and to keep this a proper generalization of the signum function on the reals, also in the complex domain one usually defines, forz=0{\displaystyle z=0}:sgn(0+0i)=0{\displaystyle \operatorname {sgn}(0+0i)=0}

Another generalization of the sign function for real and complex expressions iscsgn{\displaystyle {\text{csgn}}},[5] which is defined as:csgnz={1if Re(z)>0,1if Re(z)<0,sgnIm(z)if Re(z)=0{\displaystyle \operatorname {csgn} z={\begin{cases}1&{\text{if }}\mathrm {Re} (z)>0,\\-1&{\text{if }}\mathrm {Re} (z)<0,\\\operatorname {sgn} \mathrm {Im} (z)&{\text{if }}\mathrm {Re} (z)=0\end{cases}}}whereRe(z){\displaystyle {\text{Re}}(z)} is the real part ofz{\displaystyle z} andIm(z){\displaystyle {\text{Im}}(z)} is the imaginary part ofz{\displaystyle z}.

We then have (forRe(z)0{\displaystyle \mathrm {Re} (z)\neq 0}):csgnz=zz2=z2z.{\displaystyle \operatorname {csgn} z={\frac {z}{\sqrt {z^{2}}}}={\frac {\sqrt {z^{2}}}{z}}.}

Polar decomposition of matrices

[edit]

Thanks to thePolar decomposition theorem, a matrixAKn×n{\displaystyle {\boldsymbol {A}}\in \mathbb {K} ^{n\times n}} (nN{\displaystyle n\in \mathbb {N} } andK{R,C}{\displaystyle \mathbb {K} \in \{\mathbb {R} ,\mathbb {C} \}}) can be decomposed as a productQP{\displaystyle {\boldsymbol {Q}}{\boldsymbol {P}}} whereQ{\displaystyle {\boldsymbol {Q}}} is aunitary matrix andP{\displaystyle {\boldsymbol {P}}} is a self-adjoint, or Hermitian, positive definite matrix, both inKn×n{\displaystyle \mathbb {K} ^{n\times n}}. IfA{\displaystyle {\boldsymbol {A}}} is invertible then such a decomposition is unique andQ{\displaystyle {\boldsymbol {Q}}} plays the role ofA{\displaystyle {\boldsymbol {A}}}'s signum. A dual construction is given by the decompositionA=SR{\displaystyle {\boldsymbol {A}}={\boldsymbol {S}}{\boldsymbol {R}}} whereR{\displaystyle {\boldsymbol {R}}} is unitary, but generally different thanQ{\displaystyle {\boldsymbol {Q}}}. This leads to eachinvertible matrix having a unique left-signumQ{\displaystyle {\boldsymbol {Q}}} and right-signumR{\displaystyle {\boldsymbol {R}}}.

In the special case whereK=R, n=2,{\displaystyle \mathbb {K} =\mathbb {R} ,\ n=2,} and the (invertible) matrixA=[abba]{\displaystyle {\boldsymbol {A}}=\left[{\begin{array}{rr}a&-b\\b&a\end{array}}\right]}, which identifies with the (nonzero) complex numbera+ib=c{\displaystyle a+\mathrm {i} b=c}, then the signum matrices satisfyQ=P=[abba]/|c|{\displaystyle {\boldsymbol {Q}}={\boldsymbol {P}}=\left[{\begin{array}{rr}a&-b\\b&a\end{array}}\right]/|c|} and identify with the complex signum ofc{\displaystyle c},sgnc=c/|c|{\displaystyle \operatorname {sgn} c=c/|c|}. In this sense, polar decomposition generalizes to matrices the signum-modulus decomposition of complex numbers.

Signum as a generalized function

[edit]

At real values ofx{\displaystyle x}, it is possible to define ageneralized function–version of the signum function,ε(x){\displaystyle \varepsilon (x)} such thatε(x)2=1{\displaystyle \varepsilon (x)^{2}=1} everywhere, including at the pointx=0{\displaystyle x=0}, unlikesgn{\displaystyle \operatorname {sgn} }, for which(sgn0)2=0{\displaystyle (\operatorname {sgn} 0)^{2}=0}. This generalized signum allows construction of thealgebra of generalized functions, but the price of such generalization is the loss ofcommutativity. In particular, the generalized signum anticommutes with the Dirac delta function[6]ε(x)δ(x)+δ(x)ε(x)=0;{\displaystyle \varepsilon (x)\delta (x)+\delta (x)\varepsilon (x)=0\,;}in addition,ε(x){\displaystyle \varepsilon (x)} cannot be evaluated atx=0{\displaystyle x=0}; and the special name,ε{\displaystyle \varepsilon } is necessary to distinguish it from the functionsgn{\displaystyle \operatorname {sgn} }. (ε(0){\displaystyle \varepsilon (0)} is not defined, butsgn0=0{\displaystyle \operatorname {sgn} 0=0}.)

See also

[edit]

Notes

[edit]
  1. ^ab"Signum function - Maeckes".www.maeckes.nl.
  2. ^Weisstein, Eric W."Sign".MathWorld.
  3. ^Weisstein, Eric W."Heaviside Step Function".MathWorld.
  4. ^Burrows, B. L.; Colwell, D. J. (1990). "The Fourier transform of the unit step function".International Journal of Mathematical Education in Science and Technology.21 (4):629–635.doi:10.1080/0020739900210418.
  5. ^Maple V documentation. May 21, 1998
  6. ^Yu.M.Shirokov (1979)."Algebra of one-dimensional generalized functions".Theoretical and Mathematical Physics.39 (3):471–477.Bibcode:1979TMP....39..471S.doi:10.1007/BF01017992. Archived fromthe original on 2012-12-08.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Sign_function&oldid=1338616650"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp