## Tired of ads?

Join today and never see them again.

Study Guide

A **graph** is a type of picture that we can use to visualize ordered pairs, relations, and functions. Rather than force you to imagine what they might look like, we'll use actual, physical diagrams that you can look at and see right on your screen. No imagination necessary. You can tell the fairies and unicorns they can head on home.

The word "graph'' comes from the word "graphic, " which means having to do with pictures or writing. It has the same root as "graphite, " that stuff they make pencils from. It also has the same root as "graphitti, " which is what happen when taggers spray-paint mathematician's homes.

### Setting up a Graph

We know how to use a number line to visualize where numbers are. For example, to visualize the numbers 0, 5, and 6 we could draw this:

This number line is

**horizontal**, which means that it's oriented in the same direction as the horizon. A horizon is that thing that swallows up the sun every evening. Don't go anywhere near it if it hasn't been fed.To draw a graph, we start with a horizontal number line labelled

*x*, on which 0 is marked.Next we add a vertical number line whose 0 matches up with the one on the horizontal number line. The word "vertical'' comes from the word "vertex, '' which, among other things, means "the point in the heavens directly above a given place." That's according to the Oxford English Dictionary, and those guys know their stuff.

This definition makes sense if we think about going to the "point in the heavens'' directly above 0 and drawing a line straight downward from there. We won't talk about where that line would go straight down

*to*in this scenario; we'll just call it "the bad place." The Oxford English Dictionary had nothing to do with this one.

Now we label the vertical line*y*.The lines we've drawn are called

**axes**. Not axes, like the kind you use to chop wood. Those are far too dangerous for the world of algebra. Instead, it is pronounced "ax-ees," as in the plural of "axis," where you stretch out the second syllable. Go ahead, try it. Again, even louder. Still louder. You just woke your mom up, didn't you? Hey, you walked right into that one.The horizontal line is the

and the vertical line is the*x*-axis. To remember which one is which, we know that*y*-axis*x*comes before*y*in the alphabet, so the*x*-axis is the line we drew first (the horizontal number line) and the*y*-axis is the line we drew second (the vertical line). Or you can think about it this way: a "xylophone" is a horizontal musical instrument, while the string of a "yo-yo" goes up and down. We have like a hundred of these. We could go on all day.The place where the axes cross is called the

**origin**. This spot corresponds to 0 on both number lines. "Origin" starts with "O, " which looks something like a "0." We're only going to give you one helpful way to remember this one. We're feeling stingy.### Graphing an Ordered Pair

We already have a place set up and waiting for us to graph all over it, so let's take advantage. We'll start by graphing the ordered pair (2, 3). In order to do so, we start at the origin, go 2 to the right, 3 up, then draw a dot where we landed. It's almost as if we're following a treasure map. First we travel left or right along the

*x*-axis to find where "*x*" marks the spot, then we travel up or down along the*y*-axis when we want to know "why" the treasure wasn't in the chest where it was supposed to be. Then we track down the wise guy who gave us this bogus map in the first place.The first number in an ordered pair tells us how far to go left or right on the

*x*-axis (horizontal number line), and the second number in the ordered pair tells us how far to go up or down on the*y*-axis (vertical number line). Since*x*comes before*y*in the alphabet,*x*goes with the first number and*y*goes with the second number.These numbers are called

**coordinates**. They "coordinate" with one another to arrive at a certain spot on the graph. The first number in an ordered pair is the*x*-coordinate and the second number is the*y*-coordinate. The dot we draw to represent the ordered pair is called a**point**. You can look at a point, but don't point at it. That's rude.When we graph a point by traveling along the

*x*-axis and then the*y*-axis, it is almost as if we're traveling along two sides of an imaginary rectangle. It should come as no surprise, then, that we're using something called the**Rectangular Coordinate System**, also known as the**Cartesian Coordinate System**. You may see this referred to as "Cartesian Coordinate System" more often, which is unfortunate, since there's no shape called a cartesle. However, we can just pretend that there is one, and that it looks exactly like a rectangle.### Sample Problem

Graph the ordered pair (5, -2).

The

*x*-coordinate is 5 and the*y*-coordinate is -2, which means we start at the origin, count 5 to the right on the*x*-axis and then count 2 down on the*y*-axis. We have a negative*y*-coordinate this time, so our yo-yo will be headed downward.Technically, a point is what we get when we graph an ordered pair. In practice, the phrase "ordered pair'' and the word "point'' are used interchangeably. You can try working this into everyday conversation. "Hm... you have a good ordered pair there, " or "Could you ordered pair me in the direction of the Post Office?"

Okay, so maybe it doesn't work as well in English.

We may talk about the "point'' (3, 4), which has coordinates 3 and 4. We may be asked to graph a point, instead of an ordered pair. You can't go wrong as long as you remember that they're one and the same.

In addition to using coordinates to graph a point, we can also go backwards; that is, we can look at a point on a graph and figure out its coordinates. It's like starting with a treasure and then looking for the treasure map. We're not sure who in their right mind would do things in that order, but here goes. To set our minds at ease, we'll assume for the time being that this process is of more value when dealing with functions than when dealing with gold doubloons.

### Sample Problem

What are the coordinates of the point graphed below?

To get to this point from the origin we have to go 1 right (along the

*x*-axis) and 2 up (along the*y*-axis). Therefore, the coordinates of the point are (1, 2). At least it isn't a long journey from the origin and there are no layovers. It would be a pain if we had to stop at (1, 1) for a couple hours while waiting for a connecting coordinate.So far, all the points we've been graphing have had integer coordinates. These points are easy to graph, but in more advanced problems we'll also need to graph points with non-integer coordinates. On the downside, things will get a little trickier. On the upside, now that we don't have to stick to a grid, we'll be able to graph some more interesting pictures.

As with the number line, we can draw points with non-integer coordinates in approximately the right place, and then label the points so other people know exactly where they are. Hopefully nobody will get out a ruler just to prove that your dot is off by a half-millimeter. If they do, they have way too much time on their hands.

### Graphing Relations

Graphing a finite relation just means graphing a bunch of ordered pairs at once. Don't freak out. You can still draw the dots one at a time. It would be amazing if you could draw them all in one fell swoop, but we're guessing you don't have that many hands.

### Sample Problem

Graph the relation {(1, 2), (3, 4)}.

This problem is telling you to graph the ordered pair (1, 2) and the ordered pair (3, 4) in the same picture. A treasure map leading to two treasures! You're one jolly Roger.

When there are multiple ordered pairs close to each other, we can write the ordered pair next to its corresponding point if we want to keep track of which pairs go with which points. Since it can get pretty crowded in these graphs, we don't recommend writing with a crayon, as badly as you may want to label these guys in burnt sienna. A sewing needle dipped in black ink works best. Or, you can just use a pen.

### Sample Problem

Graph the relation {(1, 2), (3, 4)}.

This is asking us to graph the ordered pair (1, 2) and the ordered pair (3, 4) in the same picture. We already did this in the previous example, but now we'll also label the points. This way, we can glance at the graph and instantly know who's who. It'll be like slapping a name tag on them at a high school reunion: "(3, 4), is that you? You haven't aged a bit!"

As with individual ordered pairs, we can also look at a graph and determine what relation is being graphed. To do this, we make a set containing all the ordered pairs we see in the graph. For you tennis players out there: game, set,...graph!

### Sample Problem

What relation is graphed here?

The points in the graph, starting with the highest and ending with the lowest, are:

(-2, 1)

(-2, 0)

(-2, -1)

(-2, -2)To get the relation being graphed, we put all those ordered pairs into a set. Therefore, the relation is:

{(-2, 1), (-2, 0), (-2, -1), (-2, -2)}

We could also describe this relation by the equation

*x*= -2, where*y*is an integer from -2 to 1. Take your pick, since either one is correct. Mostly, it depends on how much you love parentheses.The above examples are simple enough, but what about when we have an infinite number of points? We're going to go through a lot of ink that way, aren't we?

When graphing an infinite relation, we can't graph

*all*the ordered pairs in the relation. However, we can sometimes graph enough ordered pairs to get an idea of what the relation looks like. Just as you might read the first four pages of*The Brothers Karamazov*so that you can get a gist of what it's about before delivering a 20-minute oral report on it in your World Literature class.### Sample Problem

Graph the relation |

*y*| = |*x*|.Let's find some of the ordered pairs in this relation, starting with small whole numbers (a very good place to start). When

*x*or*y*is 0, the other must also be 0, so the relation at least contains the ordered pair (0, 0).Whole numbers don't get much smaller than that. When

*x*or*y*is 1 or -1, the other can be 1 or -1. This gives us some other ordered pairs in the relation:(1, 1)

(1, -1)

(-1, 1)

(-1, -1)

Similarly, we find the ordered pairs:

(2, 2)

(2, -2)

(-2, 2)

(-2, -2)

Let's graph what we have so far:

It looks sort of like the dots are making a giant X. Doesn't

*x*get enough play in algebra? Couldn't this graph be a*b*or a*q*or a*w*? Share the wealth, function-hog.Anyway, it would be great if this pattern keeps up, because then we would know exactly what this relation looks like, but we're not 100% convinced just yet. Let's find some more ordered pairs in between the ones we already have. The relation described by the equation |

*y*| = |*x*| will also contain the points:(0.5, 0.5), (0.5, -0.5), (-0.5, 0.5), (-0.5, -0.5)

(1.5, 1.5), (1.5, -1.5), (-1.5, 1.5), (-1.5, -1.5)

When we graph these as well, we find:

Yup, that definitely looks like a giant X. It appears someone is trying awfully hard to cross out this graph.

We have now drawn in enough points that we can be almost positive we've identified the pattern, so we now know exactly what this drawing will look like. If we were to graph more points in between the ones we already have, we would fill in the X even more. If we graphed every point in the relation, or at least every point that can fit on a piece of paper or on your computer screen, we'd see this:

Looks like this spider lost a few of its legs.

One tool that can be helpful for graphing a relation is a

**table of values**. This isn't an organized list of moral virtues that you should strive to uphold. Demonstrating a healthy dose of compassion won't help you sail through your functions test, although it might allow you to feel more sympathy for the classmates who fail it.A table of values is a way to write a bunch of ordered pairs without taking up too much room on the paper. No need to kill trees needlessly.

To get our table started, we set up one column for

*x*-values and one column for*y*-values:We put numbers into the columns depending on the relation we're working with. Each row of the table will be an ordered pair in the relation.

### Sample Problem

Use a table of values to graph the relation

*y*^{2}=*x*.First, we set up our table of values:

Next, we start plugging in numbers. For each non-zero value of

*x*, we'll have two values of*y*(a negative and a positive square root). So there will be repeats of our*x*'s but no repeats of our*y*'s. Apparently, those aren't yet in syndication.Each row of the table is an ordered pair in the relation. So far, we have the ordered pairs

(0, 0), (1, 1), (1, -1), (4, 2), and (4, -2).

Let's graph these and see what we have.

What is this, a sideways trapezoid? Based on the points we've drawn so far, that's entirely possible, but if we were to continue filling in dots between the ones we currently have, you would start to see that our picture has some curves. In fact, it is

*very*curvy. Move over, Marilyn Monroe.The relation actually looks like this:

To figure out what numbers to put in the table of values, we usually start with

*x*= 0 and see what values of*y*can be used. Then we move outward from there to see what can happen when*x*= 1 or*y*= 1. Then we move out further, to*x*= 2 and*y*= 2. Sometimes we need to pick values in between the integers to see how the shape is filling in.The idea is to get a good mix of all sorts of pivotal or interesting numbers to be sure we aren't missing any piece of the pattern. See h w conf sing it can be w en you' e mis ing ce tain pie es?

### Graphing Functions

Remember: a function is a relation where each thing in the domain is matched with only one thing in the range. Another way to say this is that each

*x*-value gets matched with only one*y*-value. We can tell simply by looking at a graph whether a relation is a function or not. We can even do it with one hand tied behind our back. This isn't super-impressive, though. Our hands are not all that involved in the seeing process.### Sample Problem

Graph the relation

*y*=*x*+ 1. Is this a function?Let's make a table of values.

When we graph these, we get:

If we fill in the spaces between the points, we get a line:

Each

*x*-value is matched with only one*y*-value because if we go to any spot on the*x*-axis and travel up or down, we'll never hit more than a single*y*-value.The relation

*y*=*x*+ 1 is a function. Woo! Are we putting the "fun" in "function," or what? (Don't answer that.)### Sample Problem

Graph the relation |

*y*| = |*x*| for*x*≥ 0. Is this a function?Let's make a table of values. We're told

*x*has to be at least 0, so there won't be any negative values of*x*in our table. Negative values of*y*are okay, because the problem never said we couldn't use them. A little unfair that*y*is getting more privileges, but*x*is a big boy. He'll get over it.We can already tell this relation isn't a function, because each non-zero value of

*x*is matched with two values of*y*. However, let's carry on so we can see how it's also possible to glean this by looking at our graph. It's always nice to get confirmation from a second source. In the real world, this is called "covering your butt."If we plot the points from our table, we find:

Now we fill in the spaces between the points:

We can see that this isn't a graph of a function. We can go to a spot on the

*x*-axis, travel up and down, and hit two different values of*y*. Can you imagine how much you'd be wigging out if you left your house, passed an office building, continued another 10 miles in the same direction, and passed that exact same office building again? You'd think you stepped into The Twilight Zone, right? Well, now you know how this graph feels.Since two different values of

*y*are being matched with a single value of*x*, as we can see from either our table or our graph, the relation |*y*| = |*x*| for*x*≥ 0 is not a function. Too bad, so sad.Because we at Shmoop are total recap-aholics, let's summarize what we did in the previous examples. The goal was to look at a graph of a relation and determine if the relation was a function or not. To do this, we drew a vertical line through the graph (we went to a value of

*x*and drew a line up and down) and looked to see in how many spots that line hit the points of the relation. If there was a value of*x*where the line could hit the relation more than once, we knew we didn't have a function. Okay, recap over. Hopefully, this paragraph felt like a ton of déjà vu.This process of testing to see whether a relation is a function is called the

**vertical line test**. Clever name, eh? To determine if a graph shows a function, we see if there's any value of*x*for which a vertical line through that value will hit the graph more than once. If there is, we don't have a function. If a vertical line can hit the graph at most once, no matter where we put it, we*do*have a function. It's pretty black and white. Like the cookie. Simple, satisfying, and most commonly bought and sold in Northeastern New Jersey. All right, our analogies could use some work.

Join today and never see them again.

Please Wait...