1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

MAX - expression

  1. May 17, 2012 #1
    How do I put down an expression that means the maximum value of a set of numbers?
  2. jcsd
  3. May 17, 2012 #2


    User Avatar
    Science Advisor

    Hey xeon123.

    Typically we write the expression as y = max(x1,x2,x3,...) in notational terms.

    One way to write this is to use Heaviside functions where H(x) = 0 for x < 0 and 1 otherwise. If you want to just use a computer though then you can either sort a list and get the last element or implement an optimized routine that does the minimal number of compares to get the answer.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook