# Piecewise function

1. May 20, 2005

hi,
i have been working on an Options assignment, and i have this formula as one of my answers:

$$X_{t}=\left\{\begin{array}{cc}X_{t-1},&\mbox{if } S_{t} < S_{t-1}\\aS_{t},& \mbox{if } S_{t}\geq S_{t-1}\end{array}\right$$

where a is a constant. the question however asks for a "single equation", would the equation(s)? i have defined above be ok? is there a way to rewrite this not using a piecewise function. hopefully you know what i mean.

thnx

2. May 21, 2005

### honestrosewater

Just a thought- find the definition of "equation" you were given. If you weren't given one...
As for another way to write a piecewise function, why not define a function on each of your intervals (the restriction of the piecewise function to each interval) and define the piecewise function as the union of those functions? I.e., given abs: R --> R,
$$\mbox{abs}(x) = \left\{\begin{array}{cc}x,&\mbox{if } x \geq 0 \\-x,& \mbox{if } x < 0 \end{array}\right$$
Let f: R+ --> R, f(x) = x and g: R- --> R, g(x) = -x. Then abs = f U g - which is almost certainly a single equation ;) Doesn't save time, but I think it works.

Last edited: May 21, 2005