Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Anonymous functions and Map' topicStudent Support Forum > General > Archives > "Anonymous functions and Map"

Next Comment >Help | Reply To Topic
Author Comment/Response
LeDo
06/03/13 6:08pm

Hi! I don't seem to understand the workings of anonymous functions in conjunction with the Map function.

If I enter the following in a notebook:

Map[#^2&,a+b]

I get:

a^2 + b^2.

I would have expected:

a^2 + b^2 + 2ab

If I enter:

#^2&[a+b]

I then get, as I would expect:

(a+b)^2

Strangely, if I enter

Map[#^2&,a+a]

I get:

4a^2

and NOT a^2+a^2.

What is the explanation for this?

Thanks!



URL: ,

Subject (listing for 'Anonymous functions and Map')
Author Date Posted
Anonymous functions and Map LeDo 06/03/13 6:08pm
Re: Anonymous functions and Map Bill Simpson 06/03/13 11:39pm
Re: Re: Anonymous functions and Map LeDo 06/04/13 2:53pm
Re: Anonymous functions and Map jf 06/04/13 6:56pm
Next Comment >Help | Reply To Topic