Macaulay2 » Documentation
Packages » Macaulay2Doc :: min
next | previous | forward | backward | up | index | toc

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

Synopsis

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

Ways to use min :

For the programmer

The object min is a method function with a single argument.