Unit 1, lesson 1

Sets, Intervals, and Inequalities

How to describe sets of real numbers by listing, by set-builder notation and by intervals, combine them with union and intersection, and solve inequalities without losing track of their direction.

  • Theory part 1
  • Practice part 2
  • Sets and Functions

Theory, part 1

Practice, part 2

A ride at a fair lets you on if you are at least 120 centimeters tall. A thermostat keeps a room between 19 and 22 degrees. Each rule picks out a set of numbers, and each is really an inequality. Calculus talks about such sets constantly, for example the inputs close to a point or the values a function can take, so it helps to write them down precisely from the start.

Key terms

The real number line

Definition The real number line is a straight line, usually drawn horizontally, on which one point is chosen to represent 00, a unit of length is fixed and the direction to the right is taken as positive. Each real number xx is matched with exactly one point, which lies xx units to the right of 00 when x>0x > 0 and −x-x units to the left of 00 when x<0x < 0. Every point of the line is matched with exactly one real number. The set of all real numbers is written R\mathbb{R}.

For real numbers aa and bb, the inequality a<ba < b means that b−ab - a is positive, which on the line means that aa lies to the left of bb. For any two real numbers exactly one of a<ba < b, a=ba = b and a>ba > b is true. The statement a≤ba \le b means that a<ba < b or a=ba = b.

In plain words Every real number has its own spot on the line, and every spot is a real number. Smaller numbers sit farther to the left.

Example Which is larger, −3-3 or −12-\frac{1}{2}? The difference

−12−(−3)=52-\frac{1}{2} - (-3) = \frac{5}{2}

is positive, so −3<−12-3 < -\frac{1}{2}. On the line, −3-3 sits to the left of −12-\frac{1}{2}, even though 33 is larger than 12\frac{1}{2}.

Integers, rational numbers and irrational numbers

Definition The integers are the numbers …,−2,−1,0,1,2,…\ldots, -2, -1, 0, 1, 2, \ldots, and their set is written Z\mathbb{Z}. A rational number is a real number that can be written as a fraction pq\frac{p}{q} with integers pp and qq and q≠0q \ne 0. Their set is written Q\mathbb{Q}. Every integer nn is rational, since n=n1n = \frac{n}{1}. A real number that is not rational is called irrational.

In decimal form, a real number is rational exactly when its decimal expansion either ends or eventually repeats the same block of digits forever. The decimal expansion of an irrational number never ends and never settles into a repeating block.

In plain words Integers are the whole numbers and their negatives. Rational numbers are fractions of integers. Irrational numbers such as 2\sqrt{2} and π\pi are points on the line too, but no fraction of integers equals them.

Example Here are six real numbers sorted by type.

NumberTypeReason
−4-4integer, so also rational−4=−41-4 = \frac{-4}{1}
0.750.75rational0.75=340.75 = \frac{3}{4}
0.333…0.333\ldotsrational0.333…=130.333\ldots = \frac{1}{3}
9\sqrt{9}integer9=3\sqrt{9} = 3
2\sqrt{2}irrational2=1.41421…\sqrt{2} = 1.41421\ldots is not a fraction of integers
π\piirrationalπ=3.14159…\pi = 3.14159\ldots is not a fraction of integers

In increasing order they are

−4<13<0.75<2<3<π.-4 < \frac{1}{3} < 0.75 < \sqrt{2} < 3 < \pi.

Sets and membership

Definition A set is a collection of objects, called its elements. We write x∈Ax \in A when xx is an element of AA, and x∉Ax \notin A when it is not. A small set can be given by listing its elements between braces, as in A={1,2,3}A = \{1, 2, 3\}.

A set is determined by its elements alone. Two sets AA and BB are equal when every element of AA is an element of BB and every element of BB is an element of AA. So the order of a list does not matter, and writing an element twice does not add a second copy. The elements of a set are distinct, and the number of elements of a finite set counts each element once. If every element of AA is an element of BB, then AA is a subset of BB, written A⊆BA \subseteq B.

In plain words A set only knows what is in it. For any object you can ask whether it belongs to the set, and the answer is yes or no, nothing more.

Example Let A={2,5,5,7}A = \{2, 5, 5, 7\}. Then 5∈A5 \in A and 3∉A3 \notin A. The list mentions 55 twice, but

A={2,5,7}={7,5,2},A = \{2, 5, 7\} = \{7, 5, 2\},

so AA has three distinct elements, not four. The set {2,5}\{2, 5\} is a subset of AA.

The empty set and the set containing zero

Definition The empty set, written ∅\varnothing, is the set with no elements. For every object xx we have x∉∅x \notin \varnothing. The set {0}\{0\} has exactly one element, the number 00. Since 0∈{0}0 \in \{0\} but 0∉∅0 \notin \varnothing, the two sets are different,

∅≠{0}.\varnothing \ne \{0\}.

The empty set is a subset of every set.

In plain words An empty box and a box holding a single zero are different boxes. The first holds nothing, and the second holds one thing that happens to be the number zero.

Example The solution set of an equation is the set of all numbers that make it true. For 3x+5=53x + 5 = 5 the only solution is x=0x = 0, so the solution set is {0}\{0\}. For x+1=x+2x + 1 = x + 2, subtracting xx from both sides leaves 1=21 = 2, which is false for every xx, so the solution set is ∅\varnothing. Saying the second equation has solution 00 would be wrong, since 0+1≠0+20 + 1 \ne 0 + 2.

Set-builder notation

Definition Let UU be a set and let P(x)P(x) be a statement about xx that is either true or false for each element xx of UU. Then

{x∈U∣P(x)}\{x \in U \mid P(x)\}

is the set of all elements xx of UU for which P(x)P(x) is true. The bar is read “such that”. When UU is clear from the context, usually R\mathbb{R}, it is left out and the set is written {x∣P(x)}\{x \mid P(x)\}. Some books write a colon in place of the bar, as in {x:P(x)}\{x : P(x)\}.

In plain words Instead of listing the elements, you state the test they must pass. The set is everything in UU that passes the test.

Example Take the integers as UU and the condition −2≤x<3-2 \le x < 3. Then

{x∈Z∣−2≤x<3}={−2,−1,0,1,2}.\begin{aligned} &\{x \in \mathbb{Z} \mid -2 \le x < 3\} \\[0.4em] &\quad = \{-2, -1, 0, 1, 2\}. \end{aligned}

The number 33 fails the test because 3<33 < 3 is false. The same condition over the real numbers gives {x∈R∣−2≤x<3}\{x \in \mathbb{R} \mid -2 \le x < 3\}, which has infinitely many elements, every real number from −2-2 up to but not including 33.

Interval notation

Definition For real numbers a<ba < b, the bounded intervals with endpoints aa and bb are the following sets.

Interval notationSet-builder notationEndpoints included
(a,b)(a, b){x∣a<x<b}\{x \mid a < x < b\}neither
[a,b][a, b]{x∣a≤x≤b}\{x \mid a \le x \le b\}both
[a,b)[a, b){x∣a≤x<b}\{x \mid a \le x < b\}only aa
(a,b](a, b]{x∣a<x≤b}\{x \mid a < x \le b\}only bb

A square bracket marks a closed endpoint, which belongs to the interval. A parenthesis marks an open endpoint, which does not. On a number line a closed endpoint is drawn as a filled dot and an open endpoint as a hollow dot. The interval (a,b)(a, b) is called open, [a,b][a, b] is called closed, and the other two are half-open.

For real numbers aa and bb, the unbounded intervals are the following sets.

Interval notationSet-builder notation
(a,∞)(a, \infty){x∣x>a}\{x \mid x > a\}
[a,∞)[a, \infty){x∣x≥a}\{x \mid x \ge a\}
(−∞,b)(-\infty, b){x∣x<b}\{x \mid x < b\}
(−∞,b](-\infty, b]{x∣x≤b}\{x \mid x \le b\}
(−∞,∞)(-\infty, \infty)R\mathbb{R}

The symbols ∞\infty and −∞-\infty are not real numbers. They only say that the interval goes on without end in that direction, so they always get a parenthesis.

In plain words An interval is an unbroken stretch of the number line. The brackets tell you what happens at the ends. A square bracket means the end is in, a round one means it is out.

Example Suppose a ride takes anyone at least 120 and less than 200 centimeters tall. The allowed heights form the interval [120,200)[120, 200). A height of exactly 120120 is allowed, 199.9199.9 is allowed, and 200200 is not. The set {x∣x>−1}\{x \mid x > -1\} has no right end and an open left end, so it is (−1,∞)(-1, \infty).

Union and intersection

Definition For sets AA and BB the union and the intersection are

A∪B={x∣x∈A or x∈B},A∩B={x∣x∈A and x∈B}.\begin{aligned} A \cup B &= \{x \mid x \in A \text{ or } x \in B\}, \\[0.4em] A \cap B &= \{x \mid x \in A \text{ and } x \in B\}. \end{aligned}

The word “or” is inclusive here, so an element of both sets belongs to the union. Two sets with A∩B=∅A \cap B = \varnothing are called disjoint.

In plain words The union collects everything that is in at least one of the sets. The intersection keeps only what the two sets share.

Example Let A=[−1,3)A = [-1, 3) and B=(1,5]B = (1, 5]. Then

A∪B=[−1,5],A∩B=(1,3).\begin{aligned} A \cup B &= [-1, 5], \\[0.4em] A \cap B &= (1, 3). \end{aligned}

Watch the endpoints. The number 11 is in AA but not in BB, so it is not in the intersection. The number 33 is not in AA but is in BB, so it is in the union. The intervals [0,1][0, 1] and [2,3][2, 3] are disjoint, and their union is not a single interval.

Adding and multiplying by a positive number

Definition For all real numbers aa, bb and cc,

a<b  ⟹  a+c<b+c,a < b \implies a + c < b + c,

and if c>0c > 0, then

a<b  ⟹  ac<bcandac<bc.a < b \implies ac < bc \quad \text{and} \quad \frac{a}{c} < \frac{b}{c}.

The same rules hold with ≤\le in place of <<. Subtracting cc is adding −c-c. So adding or subtracting the same number on both sides of an inequality, or multiplying or dividing both sides by the same positive number, gives an equivalent inequality, one with exactly the same solutions.

In plain words Sliding two numbers the same distance along the line, or stretching the line by a positive factor, keeps their left to right order.

Example Solve 4x−7<54x - 7 < 5. Adding 77 to both sides gives 4x<124x < 12, and dividing by the positive number 44 gives x<3x < 3. The solution set is (−∞,3)(-\infty, 3).

Multiplying by a negative number

Definition For all real numbers aa, bb and cc with c<0c < 0,

a<b  ⟹  ac>bcandac>bc.a < b \implies ac > bc \quad \text{and} \quad \frac{a}{c} > \frac{b}{c}.

The reason is that b−a>0b - a > 0 and c<0c < 0, so (b−a)c=bc−ac(b - a)c = bc - ac is negative. The same holds with ≤\le and ≥\ge. So multiplying or dividing both sides of an inequality by a negative number gives an equivalent inequality only if the direction of the inequality sign is reversed.

A number is a solution exactly when it makes the original inequality true. Substituting the endpoint, one number inside the solution set and one number outside it into the original inequality is a quick check that catches a sign that was not reversed. A check like this cannot prove an answer, since it tests only a few numbers, but a single failure proves that something went wrong.

In plain words Multiplying by a negative number flips the number line around 00, which swaps left and right. That is why the inequality sign has to flip too.

Example Start with 2<52 < 5 and multiply by −3-3. The results are −6-6 and −15-15, and −6>−15-6 > -15, so the order reversed. Now solve 5−3x≤115 - 3x \le 11. Subtracting 55 gives −3x≤6-3x \le 6. Dividing by −3-3 and reversing the sign gives x≥−2x \ge -2, so the solution set is [−2,∞)[-2, \infty). Check in the original inequality.

xx5−3x5 - 3xIs 5−3x≤115 - 3x \le 11 true
−2-21111yes
0055yes
−3-31414no

The endpoint and the inside number pass, and the outside number fails, as they should. Had the sign not been reversed, the answer x≤−2x \le -2 would contain −3-3, and this check would expose the mistake.

Compound inequalities

Definition A compound inequality joins two inequalities with “and” or with “or”. The solution set of an “and” statement is the intersection of the two solution sets, and the solution set of an “or” statement is their union. The chain a<x<ba < x < b is short for a<xa < x and x<bx < b, so for a<ba < b it describes the interval (a,b)(a, b), and the same goes for chains with ≤\le. Conditions joined by “or”, such as x<−1x < -1 or x>3x > 3, cannot be written as one chain.

In plain words “And” means both conditions must hold, so you keep the overlap. “Or” means at least one must hold, so you keep everything from both.

Example Solve −1≤2x+3<7-1 \le 2x + 3 < 7. Subtract 33 from all three parts, then divide all three by 22,

−4≤2x<4,−2≤x<2.-4 \le 2x < 4, \qquad -2 \le x < 2.

The solution set is [−2,2)[-2, 2). As a check, x=0x = 0 gives 2x+3=32x + 3 = 3, which lies in [−1,7)[-1, 7), while x=2x = 2 gives 77, which does not. By contrast, the statement x<−1x < -1 or x≥3x \ge 3 has the solution set (−∞,−1)∪[3,∞)(-\infty, -1) \cup [3, \infty).

Check yourself

  1. Solve −3<1−2x≤5-3 < 1 - 2x \le 5 and write the solution set in interval notation.
Show the answer

Subtracting 11 from all three parts gives −4<−2x≤4-4 < -2x \le 4. Dividing by −2-2 reverses both signs, so 2>x≥−22 > x \ge -2, which is [−2,2)[-2, 2). As a check, the value x=−2x = -2 gives 1−2x=51 - 2x = 5, which satisfies −3<5≤5-3 < 5 \le 5, and x=2x = 2 gives −3-3, which fails −3<−3-3 < -3.

  1. Let A=(−∞,2]A = (-\infty, 2] and B=(0,6)B = (0, 6). Find A∩BA \cap B and A∪BA \cup B.
Show the answer

The overlap is A∩B=(0,2]A \cap B = (0, 2], since 00 is not in BB and 22 is in both sets. Together the two sets cover every number below 66, so A∪B=(−∞,6)A \cup B = (-\infty, 6). The number 66 is left out because it is in neither set.

  1. How many elements does each of the sets ∅\varnothing, {0}\{0\}, {3,3,4}\{3, 3, 4\} and {x∈Z∣x2<0}\{x \in \mathbb{Z} \mid x^2 < 0\} have?
Show the answer

They have 00, 11, 22 and 00 elements. The set {3,3,4}\{3, 3, 4\} equals {3,4}\{3, 4\}, and no integer has a negative square, so the last set is empty.

How this lesson connects

Where this leads in Calculus