What is a Function?
Open the lesson
What makes a relation a function: every element of the domain has exactly one image. Learn the two conditions to check, image and pre-image, domain, codomain and range, the vertical line test, the number of functions from A to B, and two JEE-style solved problems with the classic traps.
Chapters
- 0:00Introduction
- 0:38Function: every element, exactly one image
- 1:38Two conditions: check both
- 2:40Domain, codomain and range
- 3:25Topper's trick: the vertical line test
- 4:24How many functions from A to B?
- 5:16Example 1: which of four relations are functions
- 6:30Example 2: count functions with 2 in range, not one-one
- 8:03Quick revision: one image each, line test, counting
Transcript
0:00Introduction
Hello everyone! Let's begin with one small puzzle. Think of a vending machine: you press a button, and an item comes out. Now picture four machines. In the first, two different buttons give the same chips. In the second, one item never comes out. In the third, one button gives two different items. And in the fourth, one button is dead; nothing comes out. Which machines are fine, and which are broken? Hold on to your answer. Here's the thing: these machines are exactly the idea of a function, and functions follow you through almost every chapter of JEE maths.
0:38Function: every element, exactly one image
So, let's turn the machine into maths. Put the buttons in a set A, and the items in a set B, both non-empty, okay? Now f is a relation from A to B: each arrow on screen joins a button to an item. When is f a function? When every element x of A is related to exactly one element of B, called its image, okay? The rounded e on screen means belongs to. Two words to remember: every, and exactly one. Clear? We write f, colon, A, arrow, B, and read it, f from A to B, okay? When x is related to y, we write y equals f of x. This y is the image of x, and x is a pre-image of y. Notice, I said a pre-image, not the pre-image. Why? Yes, exactly, because two different elements of A can share the same image.
1:38Two conditions: check both
Alright, back to our machines. The definition hides two conditions; check both. Condition one: no element of A is left out. In the middle diagram, three has no image. That is the dead button machine. Broken! Condition two: no element of A has two images. In the third diagram, one goes to a and also to b. One button, two items. Broken again! Now the tricky one. Two buttons give the same chips. Is that a problem? No problem at all! Each button still gives exactly one item. In the first diagram, one and two both go to b, and it is still a function. See, this is a classic JEE trap: two arrows landing on one point, and students shout, not a function. Wrong! And the item that never comes out? Also fine: in the first diagram, c gets no arrow at all. So the first two machines are fine, and the last two are broken. Puzzle solved!
2:40Domain, codomain and range
Now three names. The set A, where the arrows start, is the domain. The set B, where they land, is the codomain, okay? In the first diagram, the domain is one, two, three, and the codomain is a, b, c. The range is f of A, the set of all f of x, for x in A, okay? So, the images actually obtained. What is the range in the first diagram? Only a and b, correct! Because c never gets an arrow. So the range is always a subset of the codomain; the curved sign with a line under it means subset. In machine words: the codomain is the whole menu, and the range is what actually comes out. Got it?
3:25Topper's trick: the vertical line test
Now, what if the question gives a graph instead of arrows? Here is a trick toppers use: the vertical line test. Draw vertical lines, straight up and down, across the curve. Now think: how many times is each vertical line allowed to meet the curve? Yes, at most once! If every vertical line meets the curve at most once, it is the graph of a function of x. The double arrow means, if and only if. The parabola on the left, y equals x squared: any vertical line meets it just once. So, definitely a function. Now the circle on the right: x squared plus y squared equals four. Function, or not? Not a function! The vertical line cuts it twice. Take x equals one: y squared is three, so y is plus or minus root three. One x, two values of y: our machine where one button gives two items!
4:24How many functions from A to B?
Now, one more big result. How many functions are there from A to B? Say A has m elements and B has n elements. Each element of A picks its own image, independently, from n choices, okay? So, is the answer m to the power n, or n to the power m? n to the power m! n choices, multiplied m times, once for every element of A, in other words, n of B to the power n of A, okay? Remember it like this: the domain sits up in the power, because every element of the domain makes a choice. Look, the order matters. If A has three elements and B has four, then from A to B there are four cubed, sixty four functions. But from B to A: three to the power four, eighty one. Different answers!
5:16Example 1: which of four relations are functions
Right, example one. Set A is one, two, three, and set B is a, b, c, okay? Which of the four relations on screen are functions from A to B? Pause the video, and check both conditions for each one. Done? Okay, let's check. f one: one goes to a, two goes to b, three goes to b. Oh, b is used twice! So not a function, right? No, no, careful! Remember the two buttons with the same chips? Allowed! Every element has exactly one image, so f one is a function. And c unused is also fine. f two: one goes to a, two goes to c, and three? Three has no image. Dead button! Not a function. f three: one goes to a, and one also goes to b. One element, two images. So, clearly not a function. And f four: everything goes to c. Strange, right? But every element has exactly one image, so it is a function: a constant function. So f one and f four are functions; f two and f three are not.
6:30Example 2: count functions with 2 in range, not one-one
Now a harder one, a real JEE pattern. Count the functions from one, two, three, to one, two, three, four, where two lies in the range, and the function is not one-one: two inputs share an image. Pause and try. Hint: count the opposite. Done? Okay, let's check. First, two in the range. Directly, that is messy, isn't it? So count the opposite. All functions: four cubed, sixty four. Functions that avoid two pick only from one, three and four: three cubed, twenty seven. So sixty four minus twenty seven: thirty seven have two in the range. So the answer is thirty seven, right? No, no, careful! Some of these have all three images different, so they are one-one. Those must go. How many functions have all three images different? The input one has four choices, the input two has three left, and the input three has two. Four times three times two: twenty four. Of these, the ones avoiding two use only three values: three times two times one, six. So twenty four minus six: eighteen of them contain two. These eighteen must go. Required answer: thirty seven minus eighteen, nineteen. See? Count the opposite, use n to the power m, and a JEE question is done in a few lines. Simple as that.
8:03Quick revision: one image each, line test, counting
So, quick revision. One: in a function, every element of A has exactly one image. Two: shared images and unused elements of B are allowed. Three: for graphs, use the vertical line test, and the number of functions is n of B to the power n of A, okay? Now go and try the practice problems on this page. You will find them easy, I promise. All the best!
More videos in Unit 1 · Sets, Relations & Functions
- What is a Set?
- Representation of Sets
- Types of Sets
- Subsets, Intervals and Power Set
- Universal Set and Venn Diagrams
- Operations on Sets
- Laws of the Algebra of Sets
- Counting: Number of Elements in Unions
- Ordered Pairs and Cartesian Product
- Chapter Summary: Mixed Solved Problems on Sets
- What is a Relation?
- Inverse of a Relation
- Types of Relations
- Equivalence Relations
- Equivalence Classes and Partitions
- Composition of Relations and Partial Orders
- Chapter Summary: Mixed Solved Problems on Relations
- Domain of Real Functions
- Finding the Range
- Standard Real Functions and Their Graphs
- Algebra of Real Functions
- One-one and Many-one Functions
- Onto and Into Functions; Bijections
- Counting Special Functions
- Composition of Functions
- Inverse of a Function
- Even and Odd Functions
- Simple Functional Equations
- Overview
- Part A: Sets
- Part B: Relations
- Part C: Functions
- Part D: Assertion–Reason and Concept Checks