MCS-212 · Block 2 Unit 1

Sets, Relations and Functions

Section 7 of 9

Block 2 · Unit 1Sets, Relations and Functions7 min · Section 7 of 9

1.7Functions

Covers IGNOU MCS-212 §1.5 (first part), E22–E25; programme guide: some important functions

A function is the most important kind of relation: to each input it gives exactly one output. Every program routine that returns a value, every lookup table and every formula y=f(x)y = f(x) is a function. This section defines functions precisely and looks at common examples.

So a relation is a function when (1) every element of AA has an image, and (2) no element of AA has two images.

Functions and non-functions

Rule from AA to BBFunction?Reason
A={1,2,3}A = \{1, 2, 3\}, B={1,4,9,11}B = \{1, 4, 9, 11\}, f(x)=x2f(x) = x^2yesevery xx has one square in BB (11 unused — allowed)
A={1,2,3,4}A = \{1, 2, 3, 4\}, B={1,4,9,10}B = \{1, 4, 9, 10\}, f(x)=x2f(x) = x^2nof(4)=16∉Bf(4) = 16 \notin B
a↦1a \mapsto 1 and a↦3a \mapsto 3, …noaa has two images
each IGNOU student ↦\mapsto their enrolment numberyeseach student has one number
each mother ↦\mapsto her childrennoa mother may have several children

Some important functions

NameDefinitionExample
constantf(x)=cf(x) = c for all xxf(x)=7f(x) = 7
identity IAI_Af(x)=xf(x) = xI(5)=5I(5) = 5
floor (greatest integer)⌊x⌋\lfloor x \rfloor = largest integer ≤x\leq x⌊2.3⌋=2\lfloor 2.3 \rfloor = 2, ⌊−2.3⌋=−3\lfloor -2.3 \rfloor = -3
ceiling⌈x⌉\lceil x \rceil = smallest integer ≥x\geq x⌈2.3⌉=3\lceil 2.3 \rceil = 3
modulus (absolute value)∣x∣=x\lvert x \rvert = x if x≥0x \geq 0, −x-x if x<0x < 0∣−10∣=10\lvert -10 \rvert = 10

Key takeaways

  • A function f:A→Bf: A \to B gives every element of AA exactly one image in BB.
  • Domain = inputs, codomain = declared targets, range = actual outputs.
  • Not every relation is a function; every function is a relation.
  • Floor rounds down, ceiling rounds up, modulus removes the sign.

Practice questions

Answer on paper first, then check. The explanation matters more than the letter you chose.

Question 1 · multiple choice

Let A={1,2,3}A = \{1, 2, 3\} and B={x,y}B = \{x, y\}. Which relation is a function from AA to BB?

Show answer

Answer: C. {(1,x),(2,x),(3,x)}\{(1, x), (2, x), (3, x)\}

Every element of AA has exactly one image (all go to xx, which is allowed). Option 1 gives no image to 3; option 2 gives 1 two images.

Question 2 · multiple choice

For f:Z→Zf: \mathbb{Z} \to \mathbb{Z}, f(x)=x2f(x) = x^2, what is the range?

Show answer

Answer: D. {0,1,4,9,16,… }\{0, 1, 4, 9, 16, \dots\}

The outputs are the perfect squares. Option 3 includes numbers like 2 and 3, which are not squares of integers.

Question 3 · multiple choice

What is ⌊−4.7⌋\lfloor -4.7 \rfloor?

Show answer

Answer: A. −5-5

The floor is the largest integer not greater than −4.7-4.7, which is −5-5. Option 2 truncates towards zero, as C’s integer division does.

Question 4 · multiple choice

What is the largest real domain of f(x)=1x2−9f(x) = \frac{1}{x^2 - 9}?

Show answer

Answer: C. R∖{−3,3}\mathbb{R} \setminus \{-3, 3\}

x2−9=0x^2 - 9 = 0 when x=3x = 3 or x=−3x = -3. Option 4 forgets the negative root.

Question 5 · multiple choice

Which statement is true?

Show answer

Answer: B. Every function is a relation

A function is a relation with extra conditions. Option 3 holds only for onto functions.

Question 6 · short answer

Let A={1,2,3,4}A = \{1, 2, 3, 4\}, B={1,8,27,64,125}B = \{1, 8, 27, 64, 125\} and f(x)=x3f(x) = x^3. Is ff a function from AA to BB? Give its domain, codomain and range.

Show worked answer

f(1)=1f(1) = 1, f(2)=8f(2) = 8, f(3)=27f(3) = 27, f(4)=64f(4) = 64; each element of AA has exactly one image, and all images are in BB, so ff is a function. Domain {1,2,3,4}\{1, 2, 3, 4\}, codomain {1,8,27,64,125}\{1, 8, 27, 64, 125\}, range {1,8,27,64}\{1, 8, 27, 64\} (125 has no pre-image).

↑ ↓ move↵ openTab switch type