Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Piecewise function

  1. May 20, 2005 #1
    i have been working on an Options assignment, and i have this formula as one of my answers:

    [tex]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[/tex]

    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.

  2. jcsd
  3. May 21, 2005 #2


    User Avatar
    Gold Member

    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,
    [tex]\mbox{abs}(x) = \left\{\begin{array}{cc}x,&\mbox{if } x \geq 0 \\-x,& \mbox{if } x < 0 \end{array}\right[/tex]
    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
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?