Difference between revisions of "Max Command"

From GeoGebra Manual
Jump to: navigation, search
(CAS Syntax)
 
(15 intermediate revisions by 7 users not shown)
Line 1: Line 1:
<noinclude>{{Manual Page|version=4.2}}</noinclude>
+
<noinclude>{{Manual Page|version=5.0}}</noinclude>{{command|cas=true|algebra}}
{{command|cas=true|algebra}}
+
;Max( <List> )
;Max[ <Number a>, <Number b> ]
+
:Returns the maximum of the numbers within the list.
:Gives the maximum of the given numbers ''a'' and ''b''.
+
:{{example| 1=<code><nowiki>Max({-2, 12, -23, 17, 15})</nowiki></code> yields ''17''.}}
:{{example| 1=<div><code><nowiki>Max[12, 15]</nowiki></code> yields ''15''.</div>}}
+
:{{note| 1=If the input consists of non-numeric objects, then this command considers the numbers associated with those objects. If you have a list of segments for example, the command ''Max( &lt;List> )'' will yield the maximum segment length.}}
;Max[ <List of Numbers> ]
+
;Max( <Interval> )
:Gives the maximum of the numbers within the list.
+
:Returns the upper bound of the interval.
:{{example| 1=<div><code><nowiki>Max[{-2, 12, -23, 17, 15}]</nowiki></code> yields ''17''.</div>}}
+
:{{example| 1=<code><nowiki>Max(2 < x < 3)</nowiki></code> yields ''3''.}}
:{{note| 1=If the input consists of non-numeric objects, then ''Max[]'' considers the numbers associated with those objects. For example, ''Max[List of Segments]'' will yield the maximum segment length.}}
 
;Max[ <Function>, <left-x>, <right-x> ]
 
:Calculates the maximum point of the function in the given interval. The function should be continuous and have only one ''local'' maximum point in the interval.
 
;Max[ <Interval> ]
 
:Gives the upper bound of the interval.
 
:{{example| 1=<div><code><nowiki>Max[2 < x < 3]</nowiki></code> yields ''3''.</div>}}
 
 
:{{note| 1=Open and closed intervals are treated the same.}}
 
:{{note| 1=Open and closed intervals are treated the same.}}
{{note| 1=See also [[Extremum Command]], [[Min Command]] and [[Function Inspector Tool]].}}
+
;Max( <Number>, <Number> )
 +
:Returns the maximum of the two given numbers.
 +
:{{example| 1=<code><nowiki>Max(12, 15)</nowiki></code> yields ''15''.}}
 +
;Max( <Function>, <Start x-Value>, <End x-Value> )
 +
:Calculates (numerically) the '''local''' maximum point of the function in the given interval. The function should be continuous and have only one ''local'' maximum point in the interval (and no local minimum).
 +
:{{note| 1=For polynomials you should use the [[Extremum Command]].}}
 +
:{{example| 1=<code><nowiki>Max(exp(x)x^2,-3,-1)</nowiki></code> creates the point (-2, 0.54134).}}
 +
;Max(<List of Data>, <List of Frequencies> )
 +
:Returns the maximum of the list of data with corresponding frequencies.
 +
:{{example| 1=<code><nowiki>Max({1, 2, 3, 4, 5}, {5, 3, 4, 2, 0})</nowiki></code> yields 4, the highest number of the list whose frequency is greater than 0.}}
 +
 
 +
{{note| 1=<div>
 +
*If you want the maximum of two functions <code>f(x)</code> and <code>g(x)</code> then you can define <code>(f(x) + g(x) + abs(f(x) - g(x)))/2</code>
 +
*See also [[Extremum Command]], [[Min Command]] and [[Function Inspector Tool]].</div>}}
 +
 
 
==CAS Syntax==
 
==CAS Syntax==
;Max[ <Number a>, <Number b> ]
+
;Max( <Function>, <Start x-Value>, <End x-Value> )
:Gives the maximum of the given numbers ''a'' and ''b''.
+
:Unlike in the Algebra View, this syntax will give the maximum over the interval, including endpoints
:{{example| 1=<div><code><nowiki>Max[12, 15]</nowiki></code> yields ''15''.</div>}}
+
:{{example|1=<div>
;Max[ <List of Numbers> ]
+
:*<code><nowiki>Max(x^2,-1,2)</nowiki></code> yields the point ''(2,4)''
:Gives the maximum of the numbers within the list.
+
:*<code><nowiki>Max(-x^2,-1,2)</nowiki></code> yields the point ''(0,0)''
:{{example| 1=<div><code><nowiki>Max[{-2, 12, -23, 17, 15}]</nowiki></code> yields ''17''.</div>}}
+
</div>}}
{{note| 1=See also [[Extremum Command]] and [[Min Command]].}}
 

Latest revision as of 13:43, 22 November 2023


Max( <List> )
Returns the maximum of the numbers within the list.
Example: Max({-2, 12, -23, 17, 15}) yields 17.
Note: If the input consists of non-numeric objects, then this command considers the numbers associated with those objects. If you have a list of segments for example, the command Max( <List> ) will yield the maximum segment length.
Max( <Interval> )
Returns the upper bound of the interval.
Example: Max(2 < x < 3) yields 3.
Note: Open and closed intervals are treated the same.
Max( <Number>, <Number> )
Returns the maximum of the two given numbers.
Example: Max(12, 15) yields 15.
Max( <Function>, <Start x-Value>, <End x-Value> )
Calculates (numerically) the local maximum point of the function in the given interval. The function should be continuous and have only one local maximum point in the interval (and no local minimum).
Note: For polynomials you should use the Extremum Command.
Example: Max(exp(x)x^2,-3,-1) creates the point (-2, 0.54134).
Max(<List of Data>, <List of Frequencies> )
Returns the maximum of the list of data with corresponding frequencies.
Example: Max({1, 2, 3, 4, 5}, {5, 3, 4, 2, 0}) yields 4, the highest number of the list whose frequency is greater than 0.


Note:

CAS Syntax

Max( <Function>, <Start x-Value>, <End x-Value> )
Unlike in the Algebra View, this syntax will give the maximum over the interval, including endpoints
Example:
  • Max(x^2,-1,2) yields the point (2,4)
  • Max(-x^2,-1,2) yields the point (0,0)
© 2024 International GeoGebra Institute