# min -- yields the minimum element in a list or sequence

• Usage:
min X
• Inputs:
• X,
• Outputs:
• m,

## Description

 i1 : X = for i from 1 to 10 list random(100) o1 = {24, 65, 71, 72, 19, 19, 91, 72, 93, 79} o1 : List i2 : min X o2 = 19

If L contains elements in a polynomial ring, the MonomialOrder of the ring is used for comparisons.

 i3 : R1 = QQ[x, y, z, MonomialOrder => Lex]; i4 : min {x*y^2, x*y^2 + z^2, y^4, y*z^5} 5 o4 = y*z o4 : R1 i5 : R2 = QQ[x, y, z, MonomialOrder => GRevLex]; i6 : min (x*y^2, x*y^2 + z^2, y^4, y*z^5) 2 o6 = x*y o6 : R2

More generally, the order of the elements is determined using the ? operator.

If X is a list of lists, min acts on the outermost level.

 i7 : min {{3, 1, 2}, {2, 9, 6}, {3, 7, 5}} o7 = {2, 9, 6} o7 : List i8 : min flatten {{3, 1, 2}, {2, 9, 6}, {3, 7, 5}} o8 = 1

## See also

• minPosition -- position of the smallest element
• max -- yields the maximum element in a list or sequence
• sort -- sort a list or columns of a matrix
• ? -- comparison operator

## For the programmer

The object min is .