# Discrete! #29: Discrete Mathematics and Its Applications 2.3, Part A

2.3: Functions

I’ve got good news and bad news. The good news is that you’re finally going to have a rigorous sense of functions. In calculus you sort of insist that you know what they are, but you really only have a generic (albeit relatively accurate) sense of what they are. Now you get some real depth.

The bad news is you’re in for a hell of a lot of jargon. I’m going to go through, piece by piece, and try to define everything. LET’S DO IT.

BOOK DEFINITION:

“Let A and B be nonempty sets. A function f from A to B is an assignment of exactly one element of B to each element of A. We write f(a) = b if b is the unique element of B assigned by the function f to the element a of A. If f is a function from A to B, we write f : A→B.”

As you might guess, that sounds trickier than it is. Basically it’s saying you have two number sets. A function is a way to identify each number in A with exactly one number in B. This should sound pretty much like how you intuitively think of functions – a function receives an input value then spits up an output.

The book notes that you can also call functions “mappings” or “transformations.” As I recall, we’ll be using “mapping” frequently.

BOOK DEFINITION:

“If f is a function from A to B, we say that A is the domain of f and B is the codomain of f. If f(a)=b, we say that b is the image of a and a is a preimage of b. The range of f is the set of all images of elements of A. Also, if f is a function from A to B, we say that f maps A to B.”

WOOF. Okay, let’s break that down. The first sentence just means “f maps A to B. The generic term for the input set (A) is “domain” and the generic term for the output set (B) is “codomain.” Input set and output set would’ve been a lot prettier, but so it goes.

The second sentence talks about images and preimages. Think of these as just specific members of A and B. So, you take a as your preimage, run the function f on it, and the image (b) gets spat out. According to wikipedia, image/preimage terminology can also refer to a subset. So, basically “preimage” refers to an element or set of elements within the domain. “Image” refers to the same, but in the codomain.

Then they talk about the range. You may be saying to yourself “what the hell is the difference between a codomain and a range?!” Well, it’s slight, and in a lot of contexts I’m told they’re more or less used interchangeably. The technical difference as I understand it is this: The range is all of the images (i.e. elements that are output) you can arrive at from the preimages (i.e. elements of input). You could stipulate a codomain that’s actually larger than the range, containing elements you can’t reach with the function and set of preimages in question. In other words, you have a domain and a codomain. Your function maps between them. The elements of the codomain you can actually reach by this method are called the range.

Why would this matter? Well, I suppose you might start with two sets A and B and then want to figure out different ways to map between. In that case, for one set of values in A, different functions would have different ranges in B.

Make sense?

Okay, let’s keep on going.

The book talks about functions being “equal” and says that two functions are equal if the share a domain, codomain, and the function between the two connects the same elements. Makes sense. If you have two functions, but they map from one set to another exactly, you must actually have two versions of the same function. For example f(x) = x+1 is the same as f(x) = x+1-1+1. Even though you’re, so to speak, running a different operation, you have the some sets and the same connected elements between them. This may seem obvious enough, but in higher math, being able to say “this is actually the same as that” can often really simplify things.

Wow, that ended up a bit wordier than I expected. I’m gonna split this section into since the second half is reallllllly important to understand.

Next stop: One-to-one and onto

This entry was posted in Autodidaction, Discrete Math. Bookmark the permalink.

### 4 Responses to Discrete! #29: Discrete Mathematics and Its Applications 2.3, Part A

1. Josh says:

I prefer to think of functions as well defined relations. One advantage to this definition is that it highlights the difference between the range and the co-domain: the co-domain is the set that is being mapped to, but not necessarily every element in that set is “hit”. The range is all the elements “hit” by the function. Thus, (if we write the real numbers as “R”) the function f: R —> R, defined as f(x) = x^2, has the co-domain of all the real numbers, but its range is only the non-negative real numbers.

2. Leonardo says:

Hi!

I just started reading this blog, and I have to say, all your thoughts and teachings are very fascinating and inspiring.

I especially enjoy Scienceville and your argument for Parkathon Ethics (so far, my tentative model defines three very interesting and distinct, but all theoretically defensible, branches of moral relativism, namely “consensus reality,” “emergent ethics,” and “absolute relativism.” I’m sure there’re many more…)

Anyway, your posts on Discrete Math are very interesting to me, but I think it’d be cool if there’s a textbook I could follow up on. Could you (or better yet, another fellow commenter, so as to not waste Mr. Weiner’s precious time) direct me to the textbook you’re using?