[OFFTOPIC] Maps and functions (was Re: Apply a function to each list member?)

Robin Becker robin at jessikat.demon.co.uk
Fri Nov 5 15:44:26 CET 1999


In article <14370.53219.667492.946075 at gargle.gargle.HOWL>, Charles G
Waldman <cgw at fnal.gov> writes
>Malcolm Tredinnick writes:
> > 
> > Correct. In fact, since we're being precise, let me point out that
> > (mathematically speaking), all functions are maps (or mappings), but not
> > all mappings are functions. The point is that a function should have only a
> > single "output" for any given input (i.e. it should be many-to-one or
> > one-to-one, not one-to-many). So some mapping that sends, say, the number 2
> > to the numbers 3 and 4 is not a function (but a mapping that sends both the
> > numbers 3 and 4 to the number 2 is a function, since for each input there
> > is only a single output).
>
>Hmm... what kind of "map" are you thinking of that could send 2 to
>"both 3 and 4"?  I think such a thing is not a mapping, at least not
>according to any definition of "map" that I've ever seen.  If you
>look, for instance, in any basic topology text, you will see that
>"map" and "function" mean exactly the same thing, when used as nouns.
>"Map" also has a sense as a transitive verb, which means "to apply a
>function to", which is where the Python/functional programming usage
>comes from.
>
>
>
I define f as a thing which takes integer arguments and outputs sets of
integers

presumably I can have such an f that

        f(2)={3,4}

to my simple engineer's eyes f could belong to the functions mapping Z--
>2^Z

I assume we're not talking that way if the f above isn't a function.
-- 
Robin Becker




More information about the Python-list mailing list