If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

# Relations and functions

Learn to determine if a relation given by a set of ordered pairs is a function. Created by Sal Khan and Monterey Institute for Technology and Education.

## Want to join the conversation?

• I still don't get what a relation is. Can someone help?
• Let me try to express this in a less abstract way than Sal did, then maybe you will get the idea.

Suppose there is a vending machine, with five buttons labeled 1, 2, 3, 4, 5 (but they don't say what they will give you).
Scenario 1:
Suppose that pressing Button 1 always gives you a bottle of water. Pressing 2, always a candy bar. Pressing 3, always Coca-Cola. Pressing 4, always an apple. Pressing 5, always a Pepsi-Cola.

There is a RELATION here. The buttons 1, 2, 3, 4, 5 are related to the water, candy, Coca-Cola, apple, or Pepsi.

Scenario 2: Same vending machine, same button, same five products dispensed. However, when you press button 3, you sometimes get a Coca-Cola and sometimes get a Pepsi-cola. Otherwise, everything is the same as in Scenario 1.

There is still a RELATION here, the pushing of the five buttons will give you the five products. The five buttons still have a RELATION to the five products.

While both scenarios describe a RELATION, the second scenario is not reliable -- one of the buttons is inconsistent about what you get.

So, we call a RELATION that is always consistent (you know what you will get when you push the button) a FUNCTION. But, if the RELATION is not consistent (there is inconsistency in what you get when you push some buttons) then we do not call it a FUNCTION.

Of course, in algebra you would typically be dealing with numbers, not snacks. But the concept remains.
• If you have:
Domain: {2, 4, -2, -4}
Range: {-3, 4, 2}

But for the -4 the range is -3 so i did not put that in .... so will it will not be a function because -4 will have to pair up with -3.
• it is a function because no x values are used multiple times.
• does the domain represent the x axis? You wrote the domain number first in the ordered pair at :52. I just wanted to ask because one of my teachers told me that the range was the x axis, and this has really confused me.
• Hi,
The domain is the set of numbers that can be put into a function, and the range is the set of values that come out of the function. So on a standard coordinate grid, the x values are the domain, and the y values are the range.

The way I remember it is that the word "domain" contains the word "in". Therefore, the domain of a function is all of the values that can go into that function (x values).

Hope that helps :-)
• Hi, this isn't a homework question. I just found this on another website because I'm trying to search for function practice questions. Anyways, why is this a function:

{(2,3), (3,4), (5,1), (6,2), (7,3)}

if 2 and 7 in the domain both go into 3 in the range.
• To be a function, one particular x-value must yield only one y-value. In this case, this is a function because the same x-value isn't outputting two different y-values, and it is possible for two domain values in a function to have the same y-value. If you graph the points, you get something that looks like a tilted N, but if you do the vertical line test, it proves it is a function.
• so if there is the same input anywhere it cant be a function?
• Yes, you are correct. If there is the same input with two different outputs, it isn't a function.
• I have a question. How do I factor 1-x²+6x-9
• Why don't you try to work backward from the answer to see how it works. The way you multiply those things in the parentheses is to use the rule FOIL - First, Outside, Inside, Last

First: 4*x
Outside: 4*-2=-8
Inside: -x*x = -x^2
Last: -2*-x =+2x

Now add them up: 4x - 8 -x^2 +2x = 6x -8 -x^2. If you rearrange things, you will see that this is the same as the equation you posted.

Now your trick in learning to factor is to figure out how to do this process in the other direction. It usually helps if you simplify your equation as much as possible first, and write it in the order ax^2 + bx + c.

So you have -x^2 + 6x -8

Now make two sets of parentheses, and figure out what to put in there so that when you FOIL it, it will come out to this equation. I will get you started: the only way to get -x^2 to come out of FOIL is to have one factor be x and the other be -x. So here's what you have to start with:

(x + ?)(-x+?) = -x^2 + 6x -8.

Now you figure out what has to go in place of the question marks so that when you multiply it out using FOIL, it comes out the right way.
• If the f(x)=2x+1 and the input is 1 how it gives me two outputs it supposes to be 3 only ? can you give me an example, please? :D
• It is only one output. However, when you are given points to determine whether or not they are a function, there can be more than one outputs for x. If there is more than one output for x, it is not a function.
• Is there a word for the thing that is a relation but not a function? Like {(1, 0), (1, 3)}?
• There are many types of relations that don't have to be functions- Equivalence Relations and Order Relations are famous examples. But, I don't think there's a general term for a relation that's not a function.
• In which set of ordered pairs is y a function of x?

(2, 2), (4, 2), (6, 6), (8, 8)

(8, 8), (4, 6), (6, 4), (8, 2)

(-2, 2), (-4, 4), (-2, 6), (0, 8)

(-8, 4), (-6, 2), (-2, 0), (-2, 1)
• Choose the set that does not have two or more points with the same x value but different y values. Of these four sets, the only set that works is (2, 2), (4, 2), (6, 6), (8, 8).

Have a blessed, wonderful day!
• Can the domain be expressed twice in a relation?
• Hi Eliza,
We may need to tighten up the definitions to answer your question. The domain is the collection of all possible values that the "output" can be - i.e. the domain is the fuzzy cloud thing that Sal draws and mentions about https://youtu.be/Uz0MtFlLD-k?t=150 . So there is only one domain for a given relation over a given range.

But I think your question is really "can the same value appear twice in a domain"? If so the answer is really no. At the start of the video Sal maps two different "inputs" to the same "output". The output value only occurs once in the collection of all possible outputs but two (or more) inputs could map to that output.

I hope that helps and makes sense. Please vote if so.

Best regards,
ST