> On Sat, 24 Mar 2001, Martin v. Loewis wrote: > > So given a subset of a lattice, it may not have a maximum, but it will > > always have a supremum. It appears that the Python max function > > differs from the mathematical maximum in that respect: max will return > > a value, even if that is not the "largest value"; the mathematical > > maximum might give no value. > > Ah, but in Python most collections are usually finite. :) Even a finite collection may not have a maximum, which Moshe's original example illustrates: s1 = set(1,4,5) s2 = set(4,5,6) max([s1,s2]) == ??? With respect to the subset relation, the collection [s1,s2] has no maximum; its supremum is set(1,4,5,6). A maximum is only guaranteed to exist for a finite collection if the order is total. Regards, Martin
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4