next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
Macaulay2Doc :: any(BasicList,Function)

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