Bodh Prabodh

Relations and Functions: notes

The full notes as text you can select, search and zoom. 5 sections, with the formulas. Your place is saved on this device.

Download the PDFPractice this chapterBack to the chapter

1

Ordered pairs and the Cartesian product

Watch: part 1 of the video

Ordered pair

(a,b)(a,b): first element aa, second element bb. Order matters: (2,3)≠(3,2)(2,3)\ne(3,2), while {2,3}={3,2}\{2,3\}=\{3,2\}.
Equality: (a,b)=(c,d)  ⟺  a=c(a,b)=(c,d)\iff a=c and b=db=d. Example: (x+1,3)=(2,y−1)⇒x=1, y=4(x+1,3)=(2,y-1)\Rightarrow x=1,\ y=4.

Cartesian product

A×B={(a,b):a∈A, b∈B}A\times B=\{(a,b): a\in A,\ b\in B\}. If n(A)=pn(A)=p and n(B)=qn(B)=q, then n(A×B)=pq=n(B×A)n(A\times B)=pq=n(B\times A).
A×B≠B×AA\times B\ne B\times A unless A=BA=B (for non-empty sets). A×∅=∅A\times\emptyset=\emptyset. n(A×A×A)=n(A)3n(A\times A\times A)=n(A)^3.
R×R\mathbb R\times\mathbb R is the whole plane; R×R×R\mathbb R\times\mathbb R\times\mathbb R is space (ordered triples).
Listing tip: fix the first element, run through the second set. Never guess.

RuleCheck with A={1,2},B={2,3},C={3,4}A=\{1,2\},B=\{2,3\},C=\{3,4\}
A×(B∪C)=(A×B)∪(A×C)A\times(B\cup C)=(A\times B)\cup(A\times C)both sides have 6 pairs
A×(B∩C)=(A×B)∩(A×C)A\times(B\cap C)=(A\times B)\cap(A\times C)both sides ={(1,3),(2,3)}=\{(1,3),(2,3)\}
A×(B−C)=(A×B)−(A×C)A\times(B-C)=(A\times B)-(A\times C)both sides ={(1,2),(2,2)}=\{(1,2),(2,2)\}
A⊆B⇒A×C⊆B×CA\subseteq B\Rightarrow A\times C\subseteq B\times Cbigger first set, bigger product

Find AA and BB from pairs

If (x,1),(y,2),(z,1)∈A×B(x,1),(y,2),(z,1)\in A\times B: first elements give A={x,y,z}A=\{x,y,z\}, second elements give B={1,2}B=\{1,2\}.
If n(A×A)=9n(A\times A)=9 and (−1,0),(0,1)∈A×A(-1,0),(0,1)\in A\times A: n(A)=3n(A)=3, so A={−1,0,1}A=\{-1,0,1\}.

2

Relations

Definition

A relation RR from AA to BB is any subset of A×BA\times B. If (a,b)∈R(a,b)\in R, we say aa is related to bb.
Domain = set of all first elements. Co-domain = the whole set BB. Range = set of second elements actually used (each listed once).
Domain ⊆A\subseteq A (can be smaller). Range ⊆\subseteq co-domain.

FormExample: A={1,2,3}A=\{1,2,3\}, B={1,…,6}B=\{1,…,6\}, y=2xy=2x
RosterR={(1,2),(2,4),(3,6)}R=\{(1,2),(2,4),(3,6)\}
Rule (set-builder)R={(x,y):y=2x, x∈A, y∈B}R=\{(x,y):y=2x,\ x\in A,\ y\in B\}
Arrow diagramarrow 1→21\to2, 2→42\to4, 3→63\to6
Domain / Range{1,2,3}\{1,2,3\} / {2,4,6}\{2,4,6\}; co-domain {1,2,3,4,5,6}\{1,2,3,4,5,6\}

Counting relations

Number of relations from AA to BB =2pq=2^{pq} (every subset of A×BA\times B). Includes the empty relation and A×BA\times B itself.
Example: n(A)=2, n(B)=3⇒26=64n(A)=2,\ n(B)=3\Rightarrow 2^6=64. A relation on AA means from AA to AA.

Reading a rule

y=x+1y=x+1 on {1,…,6}\{1,…,6\}: x=6x=6 gives y=7∉Ay=7\notin A, so R={(1,2),…,(5,6)}R=\{(1,2),…,(5,6)\}, domain {1,…,5}\{1,…,5\}, range {2,…,6}\{2,…,6\}.
y=x2−1y=x^2-1 on {−1,0,1,2}\{-1,0,1,2\}: R={(−1,0),(0,−1),(1,0),(2,3)}R=\{(-1,0),(0,-1),(1,0),(2,3)\}, range {−1,0,3}\{-1,0,3\} (0 once).

3

Functions

Definition

A function f:A→Bf:A\to B is a relation in which every element of AA has exactly one image f(x)∈Bf(x)\in B. Domain =A=A (all of it); co-domain =B=B; range ={f(x):x∈A}⊆B=\{f(x):x\in A\}\subseteq B.
Many inputs may share one output. One input may not have two outputs, and none may be left out.
Every function is a relation; not every relation is a function. y2=xy^2=x is not a function (x=4⇒y=±2x=4\Rightarrow y=\pm2); y=x2y=x^2 is.

Counting

Functions from AA to BB: qpq^p (each of pp inputs picks one of qq outputs; q=n(B)q=n(B)). Relations: 2pq2^{pq}.
Example n(A)=3,n(B)=2n(A)=3,n(B)=2: 23=82^3=8 functions out of 26=642^6=64 relations.
Vertical line test: a graph is a function if every vertical line meets it at most once (a circle fails).

Domain of a real function (largest set where the formula works)

No division by zero: 1g(x)\dfrac1{g(x)} needs g(x)≠0g(x)\ne0.  No even root of a negative: g(x)\sqrt{g(x)} needs g(x)≥0g(x)\ge0.
x−2\sqrt{x-2}: [2,∞)[2,\infty).  1x−3\dfrac1{x-3}: R−{3}\mathbb R-\{3\}.  9−x2\sqrt{9-x^2}: [−3,3][-3,3].  1x2−4\dfrac1{x^2-4}: R−{±2}\mathbb R-\{\pm2\}.  x−1x−4\dfrac{\sqrt{x-1}}{x-4}: [1,∞)−{4}[1,\infty)-\{4\}.
Range: write y=f(x)y=f(x), solve for xx in terms of yy, keep the yy that give a valid real xx. x2+1x^2+1: [1,∞)[1,\infty). x+1x−1\dfrac{x+1}{x-1}: R−{1}\mathbb R-\{1\}.

Evaluating

Always put the substituted value in brackets. f(x)=2x2−3x+1f(x)=2x^2-3x+1: f(a+1)=2(a+1)2−3(a+1)+1=2a2+af(a+1)=2(a+1)^2-3(a+1)+1=2a^2+a.

4

Special functions and their graphs

Watch: part 4 of the video
Diagram for Special functions and their graphs. The same diagram is in the PDF notes.
FunctionRuleDomainRange
Constantf(x)=cf(x)=cR\mathbb R{c}\{c\}
Identityf(x)=xf(x)=xR\mathbb RR\mathbb R
Polynomiala0+a1x+…+anxna_0+a_1x+…+a_nx^nR\mathbb Re.g. x2:[0,∞)x^2:[0,\infty); x3:Rx^3:\mathbb R
Rationalp(x)q(x), q(x)≠0\dfrac{p(x)}{q(x)},\ q(x)\ne0R−{q=0}\mathbb R-\{q=0\}1/x: R−{0}1/x:\ \mathbb R-\{0\}
Modulus∣x∣=x (x≥0), −x (x<0)|x|=x\ (x\ge0),\ -x\ (x<0)R\mathbb R[0,∞)[0,\infty)
Signum+1, 0, −1+1,\ 0,\ -1 for x>0,=0,<0x>0,=0,<0R\mathbb R{−1,0,1}\{-1,0,1\}
Greatest integer[x]=[x]= largest integer ≤x\le xR\mathbb RZ\mathbb Z

Careful with these

[2.7]=2, [−1.3]=−2[2.7]=2,\ [-1.3]=-2 (negatives go down), [5]=5[5]=5, [−0.2]=−1[-0.2]=-1. [−2.5]+[2.5]=−1[-2.5]+[2.5]=-1.
x∣x∣=sgn⁡(x)\dfrac{x}{|x|}=\operatorname{sgn}(x) for x≠0x\ne0: range {−1,1}\{-1,1\}.  ∣x∣+x|x|+x is 00 for x<0x<0 and 2x2x for x≥0x\ge0.
The range of a constant function is a single value, not R\mathbb R. 1/x1/x never equals 00.

5

Algebra of real functions

Watch: part 5 of the video

Definitions

(f+g)(x)=f(x)+g(x)(f+g)(x)=f(x)+g(x),  (f−g)(x)=f(x)−g(x)(f-g)(x)=f(x)-g(x),  (fg)(x)=f(x)g(x)(fg)(x)=f(x)g(x),  (kf)(x)=kf(x)(kf)(x)=kf(x),  (fg)(x)=f(x)g(x)\left(\dfrac fg\right)(x)=\dfrac{f(x)}{g(x)} where g(x)≠0g(x)\ne0.
Domain: f±g, fgf\pm g,\ fg: D(f)∩D(g)D(f)\cap D(g). fg\dfrac fg: D(f)∩D(g)D(f)\cap D(g) minus the points where g(x)=0g(x)=0.

Worked

f(x)=x2, g(x)=x+1f(x)=x^2,\ g(x)=x+1: f+g=x2+x+1f+g=x^2+x+1, f−g=x2−x−1f-g=x^2-x-1, fg=x3+x2fg=x^3+x^2, fg=x2x+1\dfrac fg=\dfrac{x^2}{x+1} (x≠−1x\ne-1).
f=xf=\sqrt x on [0,∞)[0,\infty), g=4−xg=\sqrt{4-x} on (−∞,4](-\infty,4]: f+gf+g on [0,4][0,4]; fg\dfrac fg on [0,4)[0,4).

Bonus: exam-level domain and range

Root of a quadratic: x2−5x+6\sqrt{x^2-5x+6}: factorise (x−2)(x−3)≥0(x-2)(x-3)\ge0, sign chart, domain (−∞,2]∪[3,∞)(-\infty,2]\cup[3,\infty).
Root in a denominator: 14−x2\dfrac1{\sqrt{4-x^2}} needs 4−x2>04-x^2>0 (strict): (−2,2)(-2,2).  Several conditions: take the intersection, e.g. x+2x2−1\dfrac{\sqrt{x+2}}{x^2-1}: [−2,∞)−{−1,1}[-2,\infty)-\{-1,1\}.
Range, three methods: (1) solve for xx: y=2x+1x−3⇒x=3y+1y−2y=\dfrac{2x+1}{x-3}\Rightarrow x=\dfrac{3y+1}{y-2}, range R−{2}\mathbb R-\{2\}. (2) bound it: 11+x2∈(0,1]\dfrac1{1+x^2}\in(0,1]. (3) complete the square: x2−4x+7=(x−2)2+3≥3x^2-4x+7=(x-2)^2+3\ge3.
Equal functions need the same domain and the same rule: x2−4x−2≠x+2\dfrac{x^2-4}{x-2}\ne x+2 (domain leaves out 22).

Speed targets and common mistakes

Counting pairs, functions, relations ≈10\approx10 s. Is it a function? ≈15\approx15 s. Domain ≈30\approx30 s. Range ≈45\approx45 s.
Mistakes: (a,b)(a,b) treated as a set; pqpq confused with p+qp+q; range written as the whole co-domain; a repeated output listed twice; qpq^p written as pqp^q; 00 allowed in the domain of 1/x1/x; greatest integer of a negative decimal found by chopping.

Done reading?

Test what stuck. The chapter quiz gives the reason behind every answer.

Practice this chapterDownload the PDFSee the PDF pages as pictures

Diagrams that are drawn only for the printed notes stay in the PDF. Text here is the same as the PDF.

Report a mistake in these notes