charfcn - Maple Programming Help

charfcn

characteristic function for expressions and sets

 Calling Sequence charfcn[A](x)

Parameters

 x - any algebraic expression A - specification for a set

Description

 • The charfcn function is the characteristic function of the "set" A.  It is defined to be

$\mathrm{charfcn}\left[A\right]\left(x\right)=\left\{\begin{array}{cc}1& x\in A\\ 0& x\notin A\\ \mathrm{\text{'}charfcn}\left[A\right]\left(x\right)\text{'}& \mathrm{otherwise}\end{array}$

 • The set specification A can be a set, a real numeric, a complex numeric, a real numeric range, a complex numeric range, an arbitrary range, or an expression sequence of any of the previous.  The meaning of each one of these is as follows

 $A$ can be: "in" ($\in$) means: ----------- -------------------- a set set membership a real or complex numeric equality a real numeric range, $a..b$ $a\le x\le b$ a complex numeric range, $a..b$ $\mathrm{\Re }\left(a\right)\le \mathrm{\Re }\left(x\right)\le \mathrm{\Re }\left(b\right)$ and $\mathrm{\Im }\left(a\right)\le \mathrm{\Im }\left(x\right)\le \mathrm{\Im }\left(b\right)$ (so $a$ is the bottom left corner, $b$ is the top right corner) an arbitrary range, $a..b$ $a\le x\le b$, as determined by $\mathrm{signum}\left(0\right)$-- note that $\mathrm{\Im }\left(a\right),\mathrm{\Im }\left(b\right),\mathrm{\Im }\left(x\right)$ must all evaluate to $0$ an expression sequence of any of the above (except set) "or" of the above conditions an expression sequence of sets set membership in the union of the sets

 • When the specification is a set, the maple function member is used to test set membership, and thus charfcn will always return one of 0 or 1 in this case.  In the other cases, charfcn is symbolic, in that it will return unevaluated if the "in" conditions cannot be verified or the specification is not exactly as described above.
 • Ranges $a..b$ where $b are treated as empty, and so charfcn will return 0 for all input.

Examples

 > ${\mathrm{charfcn}}_{3,5,9}\left(0\right)$
 ${0}$ (1)
 > ${\mathrm{charfcn}}_{3,5,9}\left(3\right)$
 ${1}$ (2)
 > ${\mathrm{charfcn}}_{3,5,9}\left(x\right)$
 ${{\mathrm{charfcn}}}_{{3}{,}{5}{,}{9}}{}\left({x}\right)$ (3)
 > ${\mathrm{charfcn}}_{3.13..3.16}\left(\mathrm{Pi}\right)$
 ${1}$ (4)
 > ${\mathrm{charfcn}}_{0..3,5..7}\left(6\right)$
 ${1}$ (5)
 > ${\mathrm{charfcn}}_{\left\{\mathrm{one},\mathrm{two},\mathrm{three}\right\}}\left(\mathrm{four}\right)$
 ${0}$ (6)
 > ${\mathrm{charfcn}}_{\left\{\mathrm{one},\mathrm{two},\mathrm{three}\right\}}\left(\mathrm{two}\right)$
 ${1}$ (7)
 > ${\mathrm{charfcn}}_{1+I..3+2I}\left(2+I\right)$
 ${1}$ (8)
 > ${\mathrm{charfcn}}_{3+I..3+2I,7,\mathrm{Pi}..{\mathrm{Pi}}^{2}}\left({ⅇ}^{{y}^{3}}\right)$
 ${{\mathrm{charfcn}}}_{{3}{+}{I}{..}{3}{+}{2}{}{I}{,}{7}{,}{\mathrm{\pi }}{..}{{\mathrm{\pi }}}^{{2}}}{}\left({{ⅇ}}^{{{y}}^{{3}}}\right)$ (9)
 > $\mathrm{assume}\left(1.1
 > ${\mathrm{charfcn}}_{3+I..3+2I,7,\mathrm{Pi}..{\mathrm{Pi}}^{2}}\left({ⅇ}^{{y}^{3}}\right)$
 ${1}$ (10)
 > ${\mathrm{charfcn}}_{3+I..-1+2I}\left(x\right)$
 ${0}$ (11)