Macaulay2 » Documentation
Packages » Macaulay2Doc :: any(BasicList,Function)
next | previous | forward | backward | up | index | toc

any(BasicList,Function) -- whether any elements of a list satisfy a specified condition

Synopsis

Description

i1 : any({1,2,3,4}, even)

o1 = true
i2 : any({1,3,5,7}, even)

o2 = false
i3 : any(20,n -> n == 15)

o3 = true

We can test whether a permutation has a fixed point as follows.

i4 : fp = x -> any(#x, i -> x#i == i);
i5 : fp {2,3,4,0,1}

o5 = false
i6 : fp {2,4,0,3,1}

o6 = true

See also

Ways to use this method: