Suppose I have a basket of fruits, like this one.
And I have a bunch of English words in this dictionary here.
We can use these two things to build something called a “map,” or “function.”
The word “function” may bring to mind a picture like this:
Ignore that mental image for now. It’ll fit in later, but the idea of a function is way simpler than what you might be familiar with.
Suppose I wanted to to take each of my fruits and assign it one word from my dictionary. Let’s go left to right along the front of the basket (for this post, those are the only five fruits that matter). I might assign the words pepper, apple, apple, orange, lemon.
That’s a function.
The function here is not the fruit, the words, or any particular one of the arrows. The function is the rule that assigns one word to each fruit.
So that’s what a function is: a rule that takes each object from one set of things (a fruit basket), and assigns it one object from another set of things (a dictionary). Our function is a rule that tells us how to go from fruits to words.
In a way, a function creates a correspondence between two sets of things. Once we’ve specified our function, every fruit corresponds to exactly one word. Keep in mind that this correspondence has a direction: it goes from fruits to words, not the other way around. A word in the dictionary, like calendar, may not have any fruit that corresponds to it. Or, like apple, it may have two fruits that correspond to it.
Here’s another example of a function: the rule that takes my five fruits and assigns them the words red, red, green, orange, yellow. Another is the rule assigns them the words hat, barbecue, lipid, mystery, when. A function doesn’t need to have an obvious pattern.
The word “map” is often used instead of “function.” “Map” is also as a verb. Instead of saying that my function takes each fruit and assigns it one word, can say that my function “maps fruits to words.”
The idea of a function can be used just about anywhere. A function can map books to titles, stocks to prices, or ice cream scoops to flavors.
So, what does this have to do with the functions people usually think of – the ones they associate with graph paper and parabolas? Actually, those functions use the same principles as our map from fruit to words.
We’ll discuss how in the next post.