Making Maps: Part I

 

Suppose I have a basket of fruits, like this one.

Basket of Earth

A pepper is botanically a fruit! So there.

And I have a bunch of English words in this dictionary here.

Dictionary
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:

By MartinThoma - Own work, CC0, https://commons.wikimedia.org/w/index.php?curid=34775894
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.

See https://flic.kr/p/EVasJ for original

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.

See https://flic.kr/p/EVasJ for original

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.

harry potter books :)

One function from books to titles maps the top left book to “The Sorcerer’s Stone,” the top right book to “The Deathly Hallows,” the middle book to “The Tales of Beedle the Bard”, and so on.

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.