Bodh Prabodh

Relations and Functions · Part 2 of 6

Relations Explained: Domain, Codomain and Range

A relation is just a subset of A cross B. Learn the three ways to write a relation, domain, codomain and range, arrow diagrams, and how to count the number of relations, with practice questions.

  • 10 min video
  • 16 topics
  • 3 check questions
  • Full transcript
Next: Part 3

Topics in this part

  1. Welcome
  2. Relations
  3. A relation as an arrow diagram
  4. Three ways to write a relation
  5. Domain, co-domain and range
  6. Practice question 1
  7. Reading a rule: y = x + 1 on A = {1, …, 6}
  8. x divides y on {1, 2, 3, 4}
  9. Practice question 2
  10. y = x² − 1, x ∈ {−1, 0, 1, 2}
  11. How many relations from A to B?
  12. Practice question 3
  13. What to remember
  14. Common mistakes in Part 2
  15. Recap of Part 2
  16. Next part

Check yourself

3 questions on this part from the chapter bank. Pick an answer, then check. No score is shared with anyone.

Question 1
R={(x,y):y=x+2, x∈{1,2,3,4}}R=\{(x,y):y=x+2,\ x\in\{1, 2, 3, 4\}\}. The range of RR is:
Question 2
A relation is a function when:
Question 3
f(x)=x2xf(x)=\dfrac{x^2}{x} and g(x)=xg(x)=x are not equal because:

Want more like these? Browse the whole question bank or take the chapter quiz.

Transcript

English captions of this part, in time order. The narration is in Hinglish; these are the on-screen English subtitles.

0:00 Welcome

0:02 Welcome back to Bodh Prabodh.

0:05 Relations

0:05 In Part 1, we learnt ordered pairs and the Cartesian product A cross B, which is all possible pairs. Today we do something selective. We pick only some pairs, the ones that follow a rule.

0:20 That is a relation. By the end of this part you will write relations in three ways, find the domain, co domain and range without confusion, and count how many relations are possible.

0:35 A relation as an arrow diagram

0:35 Here is the definition. A relation R from a set A to a set B is a subset of A cross B. That is all. Any collection of pairs, with the first element from A and the second from B, is a relation.

0:55 If a comma b is in R, we say a is related to b. Take A as 1, 2, 3, and B as 1 to 6. Let the rule be: second equals twice the first. Draw an arrow from each first element to its partner.

1:14 1 goes to 2. 2 goes to 4. 3 goes to 6. This picture is called an arrow diagram. Now name the parts. The relation R is the set of three pairs: 1 comma 2, 2 comma 4, 3 comma 6.

1:31 The first elements, 1, 2, 3, form the domain. All of B, 1 to 6, is the co domain. And the second elements that were actually used, 2, 4, 6, form the range.

1:46 Three ways to write a relation

1:46 There are three ways to write the same relation. First, the roster form: just list the pairs inside braces. Second, the rule form, also called set builder: the set of x comma y, such that y equals 2x, where x is in A and y is in B.

2:08 Third, the arrow diagram. Use whichever is quicker. For finding the domain and range, the roster form is the most direct. For understanding what is going on, the arrow diagram is the most visual.

2:25 Domain, co-domain and range

2:25 Let us make the three names crystal clear. The domain is the set of all first elements of the pairs. These are the inputs that actually have an arrow leaving them.

2:36 The co domain is the whole second set B, whether or not every element receives an arrow. The range is the set of second elements that actually appear in the pairs.

2:48 Here A is 1 to 4 and B is 1 to 8. The domain is 1, 2, 3, 4. The co domain is 1 to 8. But the range is only 2, 4, 6, 8, the elements that receive an arrow.

3:07 So always remember: the range is a part of the co domain. The co domain is the stage, and the range is the set of seats actually occupied.

3:19 Practice question 1

3:19 Pause and try. R is the relation 1 comma 3, 2 comma 3, 4 comma 5. What is its range? The answer is option B, 3 and 5. Look at the second elements: 3, 3 and 5.

3:51 The value 3 appears twice, but in a set we write it only once. So the range is 3, 5. The domain would be 1, 2, 4.

4:03 Reading a rule: y = x + 1 on A = {1, …, 6}

4:03 A relation can also be described only by a rule, with the pairs left for you to find. Take A as 1 to 6 and the rule: y equals x plus 1, where x and y are both in A.

4:21 Go through each x. If x is 1, y is 2. Then 3, 4, 5, 6. When x is 6, y would be 7, which is not in A. So that pair is not allowed. So R is 1 comma 2, 2 comma 3, 3 comma 4, 4 comma 5, 5 comma 6.

4:44 The domain is 1 to 5, not 1 to 6. The range is 2 to 6. This is a classic trap: the domain can be smaller than the set A.

5:00 x divides y on {1, 2, 3, 4}

5:00 Rules can also be in words. On the set 1, 2, 3, 4, let x be related to y when x divides y. Go through each x. 1 divides everything, so 1 comma 1, 1 comma 2, 1 comma 3, 1 comma 4.

5:23 2 divides 2 and 4. 3 divides 3. 4 divides 4. That makes 8 pairs. Notice that the pair 1 comma 2 is in R but 2 comma 1 is not, because 2 does not divide 1.

5:42 Relations need not be symmetrical.

5:47 Practice question 2

5:47 Pause and try. On A equals 1, 2, 3, 4, 5, let R be the relation x plus y equals 6. How many pairs are in R? The answer is option B, 5. The pairs are 1 comma 5, 2 comma 4, 3 comma 3, 4 comma 2, 5 comma 1.

6:27 Each x from 1 to 5 has exactly one y that is also in A.

6:35 y = x² − 1, x ∈ {−1, 0, 1, 2}

6:35 Here is a slightly harder one. R is the set of x comma y where y equals x squared minus 1, and x is minus 1, 0, 1, 2. Compute y for each x. Minus 1 gives 0.

6:53 Zero gives minus 1. One gives 0. Two gives 3. So R has four pairs. The domain is the four x values. The range is 0, minus 1 and 3. Notice 0 appears as an output twice, but we list it once.

7:14 Two different inputs may share an output in a relation.

7:20 How many relations from A to B?

7:20 How many relations can exist from A to B at all? Every subset of A cross B is a relation. If A has p elements and B has q elements, A cross B has p q pairs, and so there are 2 to the power p q subsets.

7:39 That is the number of relations. For example, A has 2 elements and B has 3. Then p q is 6, and the number of relations is 2 to the power 6, which is 64.

7:52 This count includes the empty relation, which has no pairs, and also the full relation, which is A cross B itself.

8:03 Practice question 3

8:03 Pause and try. If A has 3 elements and B has 2 elements, how many relations are there from A to B? The answer is option C, 64. A cross B has 3 times 2, which is 6 pairs.

8:34 So the number of relations is 2 to the power 6, which is 64.

8:41 What to remember

8:41 A relation need not follow a neat rule. Any subset of A cross B is a relation. For example, from a set of students to a set of subjects, you can list which student likes which subject, with no formula at all.

9:00 That is a perfectly good relation. A relation can also be from a set to itself, like our divides example. Then we say it is a relation on A.

9:13 Common mistakes in Part 2

9:13 Common mistakes. Writing the range as the whole co domain. Listing a repeated output twice. Writing a pair as y comma x, the wrong way round. And forgetting the empty relation when counting.

9:29 Always read the pair as: first from the domain side, second from the co domain side.

9:37 Recap of Part 2

9:37 Let us recap Part 2. A relation is a subset of A cross B. We write it as a roster, a rule, or an arrow diagram. The domain is the set of first elements, the co domain is the second set, and the range is the set of second elements actually used.

9:58 The number of relations from A to B is 2 to the power p q.

10:03 Next part

10:03 In Part 3, we meet the star of this chapter: the function. It is a very special relation, where every input has exactly one output. See you there. Thank you for learning with me.

10:19 Try the questions in the PDF, and see you in Part 3.

Report a mistake on this page