How to make a "function"?

I dropped out of school early when I was still a teenager and now I'm trying to take my GED. I'm really close to passing but I'm still having trouble understanding some concepts.

In the pre-test, there is this question:

Add one number to each column of the table so that it shows a function. Do not repeat an ordered pair that is in the table.

$$\begin{array}{c|c} x & y \\ \hline 6 & 6 \\ 3 & 8 \\ 9 & 12 \\ 7 & 8 \\ \fbox{?} & \fbox{?} \end{array}$$

$$\fbox{ 3 }\quad\fbox{ 6 }\quad\fbox{ 7 }\quad\fbox{ 8 }\quad\fbox{ 9 }\quad\fbox{ 12 }$$

I'm not entirely sure what a function is, and I have found some questions on SE explaining it, I'm not really getting any of it. It's all confusing.

So I was hoping if someone could explain this question to me, and what's the answer, and why. I'm hoping this could help me understand the concept.


The other answers are good. I thought I would include these pictures from Wikipedia because, while you can visualize a function as a graph on $x,y$ axes, I also like visualizing functions as objects connected by arrows.

Here we have an example of a function that turns $x$'s into $y$'s just by traveling along the arrows.

enter image description here

This is a perfectly good function because there is no ambiguity. We can see that $f(1)$ gives us $D$, $f(2)$ gives us $C$, and $f(3)$ gives us $C$ as well.

This next example is not a function, because one of the inputs ($2$) has more than one output.

enter image description here

We can see that $f(1)$ is $D$, but what about $f(2)$? We can't decide what it is because there is more than one output. So this is not a function. Rather, it is a relation.

(In case you're disturbed that the outputs are letters and not numbers... functions can connect any two collections of "things". These things don't have to be numbers, but they often are.)


The key point here is that by definition, if $y$ is a function of $x$, then for each value of $x$ there is a single value of $y$ (Thanks to N.F. Taussig for phrasing).

Four $x$ values have already been determined, so we cannot reuse any of those. There are just two values left from our answer choices: $8$ and $12$. We can pick either of these for our $x$ value and anything we want for our $y$ value and we will have a function.


There are enough answers explaining what a function is in general, so instead, I'd like to look at a particular function and discuss that.

Consider the graph of me walking to the grocery store to buy some pickled herring. I don't buy it all of the time, so when I go to the store, I really have to look for it.

On the horizontal axis is time ($t$), which represents the number of minutes since I left home, and on the vertical axis is the distance $(d)$, in meters, which represents the distance that I am from my house.

enter image description here

Initially, the distance (from home) is increasing. This represent my walk to the store.

Then it alternates between increasing and decreasing as I go up and down the aisles because the west side of the store is closer to my house than the east side of the store is. What is interesting about this part of my trip is that I can be the same distance from my house at different points in time. In fact, I am $350$m from home no fewer than $6$ times. At times, I may even be in the same location, but I can never be in $2$ places at once (this is really what the vertical line test will tell me).

Finally, are the last two legs of my trip. There is a horizontal leg to this function, which represents me waiting in line at the cashier, and not moving at all, hence not going further away nor closer to home. And lastly, I gradually decrease my distance until it reaches $0$m (at about the $28$ minute mark).

There are a multitude of other scientific relationships where one quantity depends on another that are modeled as functions. Think about throwing a ball up in the air. The ball can be at the same altitude at two different times (on the way up, and on the way down), but cannot be at two different altitudes at the same time (there's that vertical line test again).

By the way, the pickled herring was delicious. enter image description here


None of the other answers are wrong, but given you are self-taught, it might be illuminating to see some wrong answers.

$x=6$, $y=6$

This is wrong because you're not allowed to give an ordered pair that's already provided. This isn't helpful for learning what a function is, but it's probably something you already understood.

$x=6$, $y=7$

This too is wrong. The reason it's wrong is that the other rows in the table have already defined the function's $y$ value for $x=6$. And it's not $y=7$. The essence of a function (as opposed to a relation) is that there is only one $y$ for each $x$.

In fact, the only wrong answers are those which

  • give a row that's already provided
  • give an $x$ that's already provided, and give a $y$ that is different to the one next to the corresponding $x$

So the correct answer is: any $x$ that's not already in the $x$ column, with literally any $y$ in the other column. The first bullet point is just to prevent "cheating"; the second point is really what functions are about.


The picture below may help you think about this in a different light. As Peter pointed out, a function can only have a particular $x$-value paired with a single $y$-value. In the picture, the points $(6,6), (3,8),(9,12),(7,8)$ have been plotted.

Given the definition of a function, you need to choose an $x$-value that corresponds with a $y$-value "not already taken". For example, the point $(3,6)$, where $x=3$ and $y=6$, will not work because $(3,8)$ is already a point and $6\neq 8$. In the context of the vertical line test and the picture below, this would mean a blue dot would appear directly below the first blue dot. Since a vertical line would intersect both dots, then we would not have a function (this is the vertical line test). Of course, you could do something trivial like list the point $(3,6)$ in the table again and you would have a function, but the test makers anticipated this "cheat" by saying, "Do not repeat an order pair that is in the table."

As Peter pointed out, using an $x$-value of $8$ or $12$ and any correspondent $y$-value will do. In the context of the picture, this works because there is no dot on the line $x=8$ or $x=12$.

Dirty explanation, but maybe it will give you more intuition.

enter image description here