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

Higher order functions - how should they be defined?

  1. Feb 24, 2009 #1
    I want to write a function that takes other functions as inputs. Specifically I want to define a function F that takes input 't' (time) and 2 distribution functions, D1 and D2, as inputs (each distribution function itself a function of 't').

    For a simple example, if function F is the product of these distribution functions at time t then I could write:

    F(t) = D1(t) * D2(t)

    So far so good. But now, this is where I get stuck, how do I define another function whose definition includes several F functions each using different distribution functions?

    To give an example, lets say I want to define a function G which is the difference between two F functions of different distribution functions. Could I write this:

    G(t) = F(t, D1(t), D2(t)) - F(t, D2(t), D3(t)) where F(t, X(t), Y(t)) = X(t) * Y(t)

    If not, what is a better way to write this?

    Thanks for reading this!
     
  2. jcsd
  3. Feb 24, 2009 #2

    HallsofIvy

    User Avatar
    Staff Emeritus
    Science Advisor

    It's not clear to me what you are asking. You are talking about a "composition" of functions, but what do want to do with it?
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Higher order functions - how should they be defined?
  1. Higher order factoring (Replies: 2)

  2. Higher inverse order? (Replies: 1)

Loading...