Sets and Functions

Sets, Functions and Cardinality

Sets and functions are the everyday language of discrete mathematics and computer science. This material shows you how to describe sets and combine them, prove set identities, and classify functions as injective, surjective or bijective. You will compose and invert functions, work with floor and ceiling, read and evaluate sums written in sigma notation, and finish by comparing the sizes of infinite sets: why the integers and the rational numbers are countable and why the real numbers are not.

BeginnerLesson 2 of 10 in Discrete Mathematics Course

What you will learn

  1. Write sets by listing their elements or stating a property, compare sets with the subset relation, and form power sets, Cartesian products, unions, intersections, differences and complements.
    • Write sets in roster and set-builder notation
      Describe a set by listing its elements or by a defining property, decide membership, and use the empty set, the standard number sets and the size of a finite set.
    • Compare sets with subsets and power sets
      Decide and prove when one set is contained in another, tell membership apart from containment, and list and count the subsets of a finite set.
    • Form ordered pairs, tuples and Cartesian products
      Use ordered pairs and n-tuples, build Cartesian products of sets, and count their elements.
    • Combine sets with union, intersection, difference and complement
      Apply the basic set operations, show them in Venn diagrams and with bit strings, and count the elements of a union of two finite sets.
  2. Use Venn diagrams and the standard set identities to see when two set expressions are equal, then prove identities with element arguments, membership tables and chains of laws, and disprove false ones with counterexamples.
    • Use Venn diagrams and the standard set identities
      Know the laws of set algebra, connect them with the logical equivalences behind them, and check identities and non-identities with Venn diagrams and small examples.
    • Prove set identities and subset statements
      Write complete proofs that two sets are equal or that one contains the other, using element arguments, set-builder chains, membership tables and the laws of set algebra.
  3. Define functions precisely, find ranges, images and preimages, classify functions as injective, surjective or bijective, combine them by composition, find inverses, and use floor, ceiling and other functions common in computing.
    • Define functions, their domains, codomains and ranges
      Decide whether a rule is a function, and find its range, the image of a subset and the preimage of a subset.
    • Classify functions as injective, surjective or bijective
      Prove or disprove that a function is one-to-one, onto or a one-to-one correspondence, and see how the answer depends on the domain and codomain.
    • Compose functions and find inverse functions
      Form and evaluate compositions, decide when a function has an inverse, find inverses, and use how composition interacts with injectivity, surjectivity and inverses.
    • Use floor, ceiling and other functions common in computing
      Evaluate and reason with the floor and ceiling functions, prove simple statements about them, and use characteristic functions and logarithms in counting problems.
  4. Describe sequences by formulas and by rules that build each term from earlier ones, read and transform summation notation, and evaluate sums with closed formulas.
    • Describe sequences with formulas and recurrence relations
      Write terms of arithmetic, geometric and recursively defined sequences, find a formula from a pattern, and treat strings as finite sequences.
    • Read and transform summation notation
      Expand and evaluate sums written with sigma notation, and rewrite them by splitting, shifting the index, using linearity and working with double sums and products.
    • Evaluate sums with closed formulas
      Use the formulas for arithmetic and geometric sums, sums of squares and cubes, telescoping sums and infinite geometric series, and combine them with splitting and linearity.
  5. Use functions to compare cardinalities, prove that sets such as the integers and the rational numbers are countable, and prove with diagonal arguments that the real numbers and the power set of the natural numbers are uncountable and that every set is strictly smaller than its power set.
    • Compare cardinalities with bijections and injections
      Define equal and smaller cardinality with functions, build bijections between infinite sets, and use the Schröder–Bernstein theorem.
    • Prove that a set is countable
      Show that a set is countable by listing its elements or by building a bijection or injection, including the integers, pairs of integers, the rational numbers and the set of all strings.
    • Prove that a set is uncountable with diagonal arguments
      Use Cantor's diagonal argument for the real numbers and Cantor's theorem for power sets, and draw the consequences for irrational numbers and for functions that no program computes.

Sets and Functions study guide

5 chapters

1

Sets, subsets and set operations

Sets give a precise way to describe collections, from valid inputs to records in a database. The braces and symbols distinguish an element from a set containing that element, and an unordered collection from an ordered pair. You will write sets, compare what they contain, and build new sets with products and operations. These descriptions also have useful visual forms: regions in a Venn diagram and bits in a string.

1.1 Elements and ways to describe a set

A set is an unordered collection of distinct objects. Its objects are called elements or members. The statement 4∈A says that 4 belongs to the set; 5∉A says that 5 does not.

List the elements or give a rule

Roster notation puts the elements inside braces. Order does not matter, and writing an element again adds nothing: {1,2,3}={3,1,2}={1,1,2,3}. All three descriptions give the same set with three elements. An ellipsis is useful when its pattern is clear, such as {1,3,5,…,99}.

Set-builder notation gives the allowed objects and a property they must satisfy. Read {x∈U∣P(x)} as “all elements of U for which P(x) is true.” A colon sometimes replaces the vertical bar. For example,

{n∈ℤ∣0<n2<20}={−4,−3,−2,−1,1,2,3,4}.

The inequality n2<20 allows integers from −4 through 4. The other inequality removes 0. Negative integers belong because their squares are positive; considering only positive square roots would miss half the elements.

Know the number sets

The natural numbers here are ℕ={0,1,2,…}. The positive integers are ℤ+={1,2,3,…}, and ℤ also includes negative integers. The rational numbers ℚ are numbers expressible as p/q with integer numerator and nonzero integer denominator. The real numbers ℝ include the rationals and irrationals. Many texts start the natural numbers at 1, so the definition of ℕ matters.

Intervals specify real numbers between endpoints. Thus [0,1]={x∈ℝ∣0≤x≤1} includes its endpoints, while (0,1)={x∈ℝ∣0<x<1} excludes them. A universal set U fixes the objects under consideration, such as all integers or all students in a course.

Count elements at the outer level

Two sets are equal exactly when they have the same elements. Their descriptions can differ: {x∈ℝ∣x2=1}={−1,1}.

The empty set ∅, also written {}, has no elements. For example, no real number has square −1. There is only one empty set, regardless of the impossible property used to describe it.

The cardinality ∣A∣ of a finite set counts its distinct elements. A set can itself be an element: B={1,{1,2},∅} has three elements. Here {1,2}∈B, but 2∉B; the inner braces make a single object. Similarly, ∣∅∣=0 but ∣{∅}∣=1.

A set is finite if it has exactly some nonnegative integer number of elements, and infinite otherwise. Programming set types also store each value at most once, although whether they preserve insertion order depends on the language.

Key Takeaways

  • Order and repetition do not change a set.
  • Set-builder notation specifies both the allowed objects and their required property.
  • ∅ has no elements; {∅} has one.
  • Cardinality counts distinct elements, including a nested set as one element.

1.2 Subsets and power sets

A subset contains only elements of another set. Write A⊆B when every element of A belongs to B. This permits equality: every set is a subset of itself.

Prove containment with an arbitrary element

Let A be the integers divisible by 6 and B the even integers. Take any x∈A. There is an integer k with x=6k, so x=2(3k) is even. Therefore x∈B and A⊆B. The argument covers every element because x was arbitrary.

To disprove a subset claim, one element is enough. The integer 2 is in B but not in A, so B⊈A. The standard number sets give a chain of containments: ℕ⊆ℤ⊆ℚ⊆ℝ.

The empty set is a subset of every set. The statement “every element of the empty set belongs to A” cannot fail: there is no element to provide a counterexample. This is called vacuous truth. It does not assert that the empty set is an element of every set.

A proper subset satisfies A⊆B and A≠B. We write A⊊B. For example, {1,2}⊊{1,2,3}. Textbooks vary in their use of ⊂: some mean proper subset and others permit equality.

Separate membership from containment
StatementWhat it checks
x∈AIs the object x one of the elements of A?
S⊆AIs every element of the set S also in A?

For A={1,2,3}, both 1∈A and {1}⊆A are true, but {1}∉A. The set's listed elements are numbers, not the singleton set. With C={1,{1}}, however, {1}∈C and {1}⊆C are both true. The first checks a listed element; the second checks that 1 belongs to C.

Double inclusion proves equality: A=B exactly when A⊆B and B⊆A. One inclusion alone permits the larger set to have extra elements.

Build the set of all subsets

The power set 𝒫(A) has every subset of A as an element. For a two-element set,

𝒫({a,b})={∅,{a},{b},{a,b}}.

Include both the empty set and the full set. In particular, 𝒫(∅)={∅}, because the empty set has exactly one subset: itself.

If A has n elements, then ∣𝒫(A)∣=2n. Each element has two independent choices: include it or leave it out. Three elements give 8 subsets; ten give 1,024. With {1,2,3,4} in that order, the bit string 1010 represents {1,3}, and 0000 represents the empty set. Each bit records one inclusion choice.

Key Takeaways

  • A⊆B means every element of A belongs to B.
  • Every set contains the empty set as a subset; membership is a separate question.
  • Proper containment adds the requirement that the two sets differ.
  • Equality requires both inclusions.
  • The power set contains all subsets and has 2n elements when the original set has n.

1.3 Ordered pairs and Cartesian products

An ordered pair records a first entry and a second entry. Two pairs are equal exactly when their corresponding entries are equal: (a,b)=(c,d) means a=c and b=d. In particular, (1,2)≠(2,1), although {1,2}={2,1}.

Build a product one coordinate at a time

The Cartesian product A×B is the set of all pairs (a,b) with a∈A and b∈B. For A={1,2} and B={x,y,z}, fix the first entry and run through every second entry:

A×B={(1,x),(1,y),(1,z),(2,x),(2,y),(2,z)}.

There are three pairs starting with 1 and three starting with 2. For finite sets, this gives ∣A×B∣=∣A∣⋅∣B∣. The product is a set; the expression between cardinality bars is its number of elements. A product with an empty factor has no pairs, because a required coordinate cannot be chosen: A×∅=∅×A=∅.

Reversing the factors changes which entries may occupy each position. The pair (1,x) belongs to A×B but not to B×A, whose first entry must be a letter. The two products have the same size when finite, but need not be the same set. If both factors are nonempty, A×B=B×A holds only when A=B. Empty factors are an exception: both products are empty even if the other factor is nonempty.

Extend pairs to tuples

An ordered n-tuple (a1,…,an) has one entry for each position. Repetition is allowed, as in (3,3). The product A1×⋯×An contains tuples with each ai∈Ai. Repeated factors are abbreviated as An.

The set ℝ2 is the coordinate plane. The set {0,1}8 consists of all 8-bit strings and has 28=256 elements. A table row with columns for student number, course code and grade is a triple from the product of the three column sets. Swapping columns changes the role of an entry even if the same values remain present.

Combine products with set operations

Products distribute across union and intersection in a factor:

A×(B∪C)=(A×B)∪(A×C), A×(B∩C)=(A×B)∩(A×C).

For the intersection identity, a pair on either side must have its first entry in A and its second entry in both B and C. That coordinate test explains why the identity holds for all such sets.

A subset of A×B can record selected links from first entries to second entries. The graph of a function is a special such subset: every element of A appears as a first entry exactly once. This turns the product from a list of all possible pairs into the setting for assigning outputs to inputs.

Key Takeaways

  • Pairs and tuples preserve position and allow repeated entries.
  • A×B contains every allowed first-and-second-coordinate combination.
  • For finite sets, ∣A×B∣=∣A∣∣B∣; an empty factor makes the product empty.

1.4 Union, intersection and membership bits

Set operations describe which elements survive a membership test. Let A={1,2,3,4} and B={3,4,5,6}. The overlap matters because an element may belong to both sets.

Choose the matching operation
OperationMembership ruleResult for these sets
Union A∪BIn at least one set{1,2,3,4,5,6}
Intersection A∩BIn both sets{3,4}
Difference A−BIn A and outside B{1,2}
Symmetric difference A⊕BIn exactly one set{1,2,5,6}

Union uses inclusive “or,” so it keeps the overlap. Symmetric difference uses exclusive “or,” so it removes the overlap. Its alternative notation is A△B, and its definition is (A−B)∪(B−A). Difference, also written A∖B, depends on order: here B−A={5,6}. Sets are disjoint when their intersection is empty.

The complement A‾=U−A keeps all elements of a stated universal set outside A. It is also written Ac or A′. With U={1,…,10}, the complement is {5,6,7,8,9,10}; with U=ℕ it also contains 0 and every integer greater than 10. Difference can be rewritten as A−B=A∩B‾ relative to a common universe.

Read regions and counts

A Venn diagram shows the universe as a rectangle and the sets as regions inside it. Two overlapping circles separate four membership cases: only the first set, only the second, both, and neither. Three circles separate eight cases. Shade the part inside A but outside B for A−B; shade outside both circles for A∪B‾.

For finite sets,

∣A∪B∣=∣A∣+∣B∣−∣A∩B∣.

The sum of the separate sizes counts each shared element twice; subtracting the intersection keeps one copy. In a group of 40 students, 25 take programming, 18 take statistics and 7 take both. The union has 25+18−7=36 students, leaving 40−36=4 taking neither. Disjoint sets have no double count, so their sizes add directly.

Work with families and bits

For a family of sets, ⋃i=1nAi contains elements in at least one set, while ⋂i=1nAi contains elements in every set. If Ai={1,…,i}, their union is {1,…,n} and their intersection is {1}. Over all positive integer indices, the union is ℤ+ and the intersection remains {1}.

A finite universe in a fixed order lets each subset be stored as a bit string: 1 means membership and 0 means absence. Combine strings position by position. Union uses OR, intersection AND, symmetric difference XOR, and complement flips each bit. For U={1,…,10}, the odd members have string 1010101010 and {1,2,3,4,5} has 1111100000. Their OR is 1111101010, representing {1,2,3,4,5,7,9}; their AND is 1010100000, representing {1,3,5}. Changing the universe's order changes the encoding, so the order must stay fixed while the operations are performed.

Key Takeaways

  • Union means at least one set; intersection means both; symmetric difference means exactly one.
  • Complement depends on the chosen universe.
  • Difference keeps elements of the first set that are absent from the second.
  • For finite sets, subtract the overlap once when counting a union.
  • Generalized union means at least one set in the family; generalized intersection means every set.
  • In a fixed finite universe, set operations act on membership bits position by position.
2

Set laws and complete proofs

A set equation claims that two descriptions pick out exactly the same objects. Testing a few collections can reveal a false claim, but a proof must account for arbitrary elements or every possible membership case. Set laws connect this work to familiar logical equivalences. You will use those laws to simplify expressions, compare regions, and write arguments that establish both directions of an equality.

2.1 The laws of set operations

A set identity holds for all sets in the stated universe. Its symbols translate into logic: union means “or,” intersection means “and,” and complement means “not.” This connection explains the laws and helps keep their conditions straight.

Laws that simplify an expression

The identity laws are A∪∅=A and A∩U=A: neither operation changes membership. The domination laws are A∪U=U and A∩∅=∅. The universe admits every possible element in a union; an empty intersection factor admits none.

The idempotent laws are A∪A=A and A∩A=A. Repeating a membership condition does not change it. The complement laws are A∪A‾=U and A∩A‾=∅. Every object in the universe is either in A or outside it, and cannot be both. Double complement gives A‾‾=A.

Both union and intersection are commutative, so their two inputs can be reversed. They are also associative: changing the grouping in A∪(B∪C) or A∩(B∩C) leaves membership unchanged.

Distribution and absorption

Both distributive laws are valid:

A∩(B∪C)=(A∩B)∪(A∩C), A∪(B∩C)=(A∪B)∩(A∪C).

For the second law, an element in A passes both conditions on the right. If it is outside A, it must belong to both B and C. Ordinary addition does not distribute over multiplication, so an arithmetic analogy alone would miss this law.

The absorption laws are A∪(A∩B)=A and A∩(A∪B)=A. The intersection A∩B adds no elements to A, while membership in A already guarantees membership in A∪B.

Move a complement through an expression

De Morgan's laws change the operation as well as complementing the sets:

A∪B‾=A‾∩B‾,A∩B‾=A‾∪B‾.

For U={1,…,6}, A={1,2,3} and B={3,4}, the complement of their union is {5,6}. Their separate complements are {4,5,6} and {1,2,5,6}. Intersecting gives {5,6}; taking their union would incorrectly include 1, 2 and 4.

Check a claim or simplify it

A complete two-set Venn diagram displays all four membership cases; a three-set diagram displays all eight. Matching shaded regions check an identity because every case is present. Four or more circles cannot display every case, so a membership table or written argument is more useful there.

One counterexample disproves a universal identity. The claim (A−B)∪B=A fails for A={1} and B={2}: its left side is {1,2}. It holds exactly when B⊆A.

For a true simplification, factor the shared set:

(A∩B)∪(A∩B‾)=A∩(B∪B‾)=A∩U=A.

The steps use distribution, the complement law and the identity law.

Key Takeaways

  • Set identities express logical equivalences about membership.
  • Both union and intersection distribute over the other operation.
  • De Morgan changes union to intersection, or intersection to union, while complementing each set.
  • One counterexample disproves an identity; matching particular examples do not prove it.

2.2 Element arguments, tables and chains of laws

A proof of equality must show that neither set has an element missing from the other. Three useful methods are an element argument, a membership table and an algebraic chain of established laws.

Follow an arbitrary element

To prove A∩B‾=A‾∪B‾, take an arbitrary x∈U. Then

x∈A∩B‾  ⟺  ¬(x∈A and x∈B)   ⟺  (x∉A or x∉B)  ⟺  x∈A‾∪B‾.

Each step is an equivalence, using the definition of complement, De Morgan's law in logic, and the definition of union. Reading forward proves one inclusion; reading backward proves the other. A forward implication alone would prove only a subset statement.

The same reasoning can be expressed as a set-builder chain, beginning with {x∈U∣¬(x∈A∧x∈B)} and replacing its condition by the equivalent condition x∉A∨x∉B. Both descriptions select precisely the same elements.

Use a hypothesis where it is needed

Suppose A⊆B. To prove A∪B=B, first note that B⊆A∪B. For the reverse inclusion, let x∈A∪B. If x∈B, the conclusion is immediate. If x∈A, the hypothesis gives x∈B. Every case reaches B, proving A∪B⊆B.

Union gives two possible cases, not two simultaneous facts. Replacing its “or” with “and” would make the argument assume more than membership in the union supplies.

Check every membership combination

A membership table uses 1 for membership and 0 for absence. With three sets there are eight rows. To compare L=A∪(B∩C) and R=(A∪B)∩(A∪C), evaluate each subexpression in each row:

ABCLR
00000
00100
01000
01111
10011
10111
11011
11111

The final columns agree in every row, so the identity is proved. A table omitting one combination would leave that case unchecked.

Name the law at each step

An algebraic proof transforms one side into the other. For example,

A∪(B∩C)‾=A‾∩B∩C‾=A‾∩(B‾∪C‾).

Each equality is De Morgan's law. Commutativity can then reorder the intersection or the union. The law used must already be established; using the claim itself would be circular.

For Cartesian products, start with a pair. Membership of (a,b) in A×(B∩C) means a∈A, b∈B and b∈C. These are exactly the conditions for membership in both A×B and A×C. The equivalence proves the product identity in both directions without listing particular elements.

Key Takeaways

  • An arbitrary-element proof covers every element, not just selected examples.
  • Two inclusions prove equality; a reversible equivalence chain proves both at once.
  • A complete membership table checks every combination.
  • In a conditional proof, state where the hypothesis supplies the needed membership.
  • An algebraic proof justifies each equality with an established law.
3

Functions, inverses and computing

A function pairs every allowed input with exactly one output. Its domain and codomain are part of its meaning, so the same formula can behave differently when those sets change. You will distinguish outputs that repeat from outputs that are missed, combine functions in a specified order, and decide when an assignment can be undone. Floor, ceiling and characteristic functions then put these ideas to work in discrete computing problems.

3.1 Inputs, outputs, images and preimages

A function f ⁣:A→B assigns every element of A exactly one element of B. The set A is its domain, and B is its codomain. The value f(a) is the image of the input a.

Check that the assignment is a function

A formula, table, list of pairs, arrow diagram or program can specify a function. In each representation, every domain element needs one output, and that output must belong to the codomain. Two different inputs may share an output.

The rule f(x)=1/x is not a function from ℝ to ℝ because it gives no value at 0. Removing 0 from the domain repairs that problem. The rule f(n)=n/2 does not define a function ℤ→ℤ, since 3 would have the noninteger output 3/2. The proposed assignment “±x” gives two outputs at 4, so it also fails. A partial function permits some inputs to have no value; a total function requires a value at each input.

The graph of f is {(a,f(a))∣a∈A}⊆A×B. Every domain element occurs exactly once as a first coordinate. For a real-variable graph, a vertical line can therefore meet it at most once.

Separate codomain and range

The range f(A) is the set of values actually reached. It lies inside the codomain and can be smaller. For f ⁣:ℤ→ℤ, f(n)=n2, the codomain is all integers, but the range is {0,1,4,9,16,…}. A negative integer is an allowed target but never an output.

The image of a subset S⊆A is f(S)={f(s)∣s∈S}. If S={−2,−1,0,1,2}, squaring gives f(S)={0,1,4}. Repeated outputs appear only once because an image is a set.

The preimage of a subset T⊆B is f−1(T)={a∈A∣f(a)∈T}. It collects inputs, not outputs. For the same integer-square function, f−1({4,5})={−2,2}. Both signs square to 4 and no integer squares to 5. Also f−1({3})=∅. A preimage exists as a set even when there is no inverse function.

ConstructionStarts withReturns
Image f(S)A subset of the domainThe outputs reached from it
Preimage f−1(T)A subset of the codomainAll inputs landing in it
Compare and combine functions

Two functions are equal when they have the same domain, codomain and value at every input. Thus squaring as a function ℤ→ℤ differs from squaring as a function ℤ→ℕ, even though the output formula agrees.

Real-valued functions can be added and multiplied pointwise: (f+g)(x)=f(x)+g(x) and (fg)(x)=f(x)g(x). For f(x)=x2 and g(x)=x−x2, these give x and x3−x4.

For finite sets, there are ∣B∣∣A∣ functions A→B. Each input independently chooses one codomain element. Three inputs and two possible outputs give 23=8 functions. An empty domain has exactly one function, the empty assignment, even into an empty codomain; the counting convention is 00=1. A nonempty domain has no function into an empty codomain.

Key Takeaways

  • A function assigns every domain element exactly one value in the codomain.
  • The range is the set of reached values and can be smaller than the codomain.
  • An image collects outputs; a preimage collects all matching inputs.
  • Preimages do not require invertibility.
  • Function equality includes the domain and codomain.
  • For finite sets, there are ∣B∣∣A∣ assignments A→B.

3.2 One-to-one, onto and bijective functions

Being a function answers whether each input has exactly one output. Injectivity and surjectivity ask different questions about how the outputs are used.

Two tests for a function
PropertyRequirementEvidence that it fails
Injective, or one-to-oneDifferent inputs have different outputsTwo distinct inputs share a value
Surjective, or ontoEvery codomain element is reachedA codomain element has no preimage
BijectiveBoth requirements holdEither requirement fails

In a finite arrow diagram, injectivity means no target receives two arrows. Surjectivity means every target receives at least one. A bijection gives every target exactly one incoming arrow. For example, the assignments a↦3, b↦2, c↦1, d↦3 from {a,b,c,d} to {1,2,3} are surjective but not injective.

Prove each requirement

To prove injectivity of f(x)=3x+2 on ℝ, assume f(a1)=f(a2). Then 3a1+2=3a2+2. Subtracting 2 and dividing by 3 gives a1=a2. Equal outputs can come only from equal inputs.

For surjectivity onto ℝ, take any real target y. Solving 3x+2=y gives x=(y−2)/3. This input is real and maps to y, so every target is reached. The function is bijective.

The same formula f ⁣:ℤ→ℤ remains injective, but is not onto. Reaching 0 would require x=−2/3, outside its domain. Solving an equation is not enough for surjectivity unless the solution is an allowed input.

Domain and codomain change the answer

Squaring illustrates both kinds of restriction:

DomainCodomainProperties of x↦x2
ℝℝNeither: opposite signs collide and negatives are missed
ℝ[0,∞)Onto, but not one-to-one
[0,∞)ℝOne-to-one, but not onto
[0,∞)[0,∞)Bijective

A strictly increasing real function is injective: if one input is larger, its output must be larger. Strictly decreasing functions are injective for the same reason with the inequality reversed. Weakly increasing functions need not be injective, because equal outputs are permitted; a constant function is an example.

The identity ιA(x)=x is bijective on A. A constant function on at least two inputs is not injective. With a nonempty domain it is onto exactly when its codomain consists of that one output.

Use finite sizes carefully

For finite sets, an injection A→B requires ∣A∣≤∣B∣, a surjection requires ∣A∣≥∣B∣, and a bijection requires equality. If the finite sets have equal size, injectivity and surjectivity are equivalent: using distinct targets leaves none unused.

This last equivalence fails for infinite sets. The function n↦n+1 from ℕ to itself is injective but misses 0. Infinitely many distinct outputs do not guarantee that every target is reached.

Key Takeaways

  • Injectivity rules out collisions; surjectivity rules out missed targets.
  • A bijection reaches each codomain element exactly once.
  • Prove injectivity from equal outputs; prove surjectivity by finding an allowed input for an arbitrary target.
  • Always classify the function with its stated domain and codomain.
  • Equal finite domain and codomain sizes make injectivity and surjectivity equivalent.

3.3 Composition and undoing a function

Composition feeds one function's output into another. For g ⁣:A→B and f ⁣:B→C, the composition f∘g ⁣:A→C satisfies (f∘g)(a)=f(g(a)). The function on the right acts first.

Follow the order and the allowed inputs

Let f(x)=2x+3 and g(x)=3x+2 on the integers. Then

(f∘g)(x)=2(3x+2)+3=6x+7, (g∘f)(x)=3(2x+3)+2=6x+11.

At 1 the outputs are 13 and 17. Composition is not commutative: the order can change the answer.

Composition also requires compatible sets: every value of the inner function must lie in the outer function's domain. For g(a)=b, g(b)=c, g(c)=a and f(a)=3, f(b)=2, f(c)=1, the composition f∘g sends a,b,c to 2,1,3. The reverse composition is undefined because g does not accept the outputs 1, 2 and 3.

Composition is associative: h∘(g∘f)=(h∘g)∘f. Both apply f, then g, then h. Identity functions leave an assignment unchanged: f∘ιA=f and ιB∘f=f for f ⁣:A→B.

When can the assignment be reversed?

An inverse function f−1 ⁣:B→A assigns each output its unique original input. It exists exactly when f is bijective. Injectivity provides uniqueness; surjectivity ensures every element of B gets an inverse value. The checks are

f−1∘f=ιA,f∘f−1=ιB.

To find an inverse of f(x)=3x+2 on the reals, write y=3x+2 and solve: x=(y−2)/3. Thus f−1(y)=(y−2)/3. Substitution gives f−1(f(x))=((3x+2)−2)/3=x, and f(f−1(y))=3((y−2)/3)+2=y.

Squaring has no inverse on all reals because opposite inputs collide. Restricting both domain and codomain to [0,∞) gives the inverse y↦y.

The inverse is not the reciprocal: for f(x)=3x+2, f−1(8)=2, while 1/f(8)=1/26. Nor does the preimage notation f−1(T) imply invertibility; it collects all inputs landing in a set.

Properties under composition

Composing two injections gives an injection: equality of final outputs first forces equality after the inner function, then equality of inputs. Composing two surjections gives a surjection: each final target has an intermediate preimage, which has an original preimage. Two bijections therefore compose to a bijection.

Undoing reverses the order: (f∘g)−1=g−1∘f−1. If f(x)=2x and g(x)=x+3, undo 2x+6 by dividing by 2 and then subtracting 3.

Some converses are weaker. If f∘g is injective, g must be injective; if it is onto, f must be onto. The other conclusions fail: take g ⁣:{1}→{1,2} with g(1)=1 and the constant f ⁣:{1,2}→{1}. Their composition is bijective even though g misses 2 and f merges its inputs.

Key Takeaways

  • f∘g applies g first and requires its outputs to be valid inputs to f.
  • Composition is associative but generally not commutative.
  • A function has an inverse on its full codomain exactly when it is bijective.
  • An inverse undoes an assignment; a reciprocal divides 1 by a value.
  • The inverse of a composition reverses the order of its factors.
  • Injectivity of a composition forces injectivity of the first-applied function; surjectivity forces surjectivity of the last-applied function.

3.4 Floor, ceiling, indicators and binary length

Discrete tasks often turn a real quantity into an integer. The direction of that change matters, especially for negative inputs and partially filled containers.

Floor and ceiling are directed rounding

The floor ⌊x⌋ is the greatest integer at most x. The ceiling ⌈x⌉ is the least integer at least x. Thus ⌊3.7⌋=3, ⌈3.7⌉=4, ⌊−3.7⌋=−4 and ⌈−3.7⌉=−3. At an integer, both return that integer.

For integer n, ⌊x⌋=n exactly when n≤x<n+1, while ⌈x⌉=n exactly when n−1<x≤n. Dropping the decimal digits of a negative number gives the ceiling, not the floor. Ceiling is not nearest-integer rounding: ⌈2.1⌉=3.

Adding an integer shifts either result by that integer: ⌊x+n⌋=⌊x⌋+n and ⌈x+n⌉=⌈x⌉+n. Negation reverses the direction, so ⌊−x⌋=−⌈x⌉. The difference ⌈x⌉−⌊x⌋ is 0 at integers and 1 elsewhere. Floor does not distribute over arbitrary addition: ⌊0.5+0.5⌋=1, whereas ⌊0.5⌋+⌊0.5⌋=0.

Count full containers and required containers

Storing 100 bits in 8-bit bytes requires ⌈100/8⌉=13 bytes. Only ⌊100/8⌋=12 are full. Similarly, sending 500 bytes in packets holding at most 64 bytes takes ⌈500/64⌉=8 packets. The final partly filled container still counts.

As a function ℝ→ℤ, floor is onto: an integer maps to itself. It is not injective because ⌊0.2⌋=⌊0.7⌋=0. Likewise, n↦⌈n/2⌉ on the positive integers is onto but merges inputs 1 and 2.

Prove a floor identity by cases

Write x=n+ε, where n=⌊x⌋ and 0≤ε<1. To prove

⌊2x⌋=⌊x⌋+⌊x+1/2⌋,

split at ε=1/2. Below that point, 0≤2ε<1, so the left side is 2n and ⌊x+1/2⌋=n. At or above it, 1≤2ε<2, so the left side is 2n+1 and the shifted floor is n+1. The equality holds in both cases, including the boundary.

Encode membership and count binary digits

The characteristic function χA ⁣:U→{0,1} is 1 on members of A and 0 elsewhere. Every subset gives one such function, and each such function identifies its subset of 1-valued inputs. For a finite universe in a fixed order, these values form its membership bit string.

The exponential function x↦2x maps ℝ bijectively onto (0,∞); its inverse is log⁡2. A positive integer n has ⌊log⁡2n⌋+1 binary digits. Indeed, 2k≤n<2k+1 means the highest binary place is 2k, so positions 0 through k require k+1 digits. For 100, the logarithm is about 6.64, giving 7 digits: 11001002.

Key Takeaways

  • Floor rounds toward the smaller integer; ceiling toward the larger integer.
  • Use ceiling for containers required and floor for completely filled containers.
  • Integer shifts commute with floor and ceiling; arbitrary real additions do not.
  • Floor proofs can split the fractional part into intervals.
  • A characteristic function encodes membership as 0 or 1.
  • A positive integer has ⌊log⁡2n⌋+1 binary digits.
4

Sequences and sums

A sequence records values in a specified order, and a sum combines selected terms. The starting index controls which value comes first and how many terms are included. You will move between formulas and recurrences, read sigma notation as repeated addition, and choose a formula that matches the pattern of a sum. Pairing and cancellation explain why several useful formulas work and make boundary errors easier to spot.

4.1 Terms, formulas and recurrence rules

A sequence is a function whose inputs are consecutive integers, usually starting at 0 or 1. The index names a position, and an is the value at that position. For an=1/n with n≥1, the first terms are 1,1/2,1/3,1/4,….

Add a difference or multiply by a ratio

An arithmetic progression adds a fixed difference d. With first term a at index 0, its formula is an=a+nd. With a=−1 and d=4, it starts −1,3,7,11,…. If the first term instead has index 1, write an=a+(n−1)d. Substituting the starting index should always give the stated first term.

A geometric progression multiplies by a fixed ratio r. Starting at index 0, an=arn. For a=3 and r=2, the terms are 3,6,12,24,…. The ratio may be negative: a=1 and r=−1 give 1,−1,1,−1,…. A constant difference identifies arithmetic behavior; a constant ratio between nonzero consecutive terms identifies geometric behavior.

Build terms from earlier terms

A recurrence relation specifies later terms using earlier ones. It needs initial conditions to fix the starting values. The rule an=an−1+3 could start from any number. Adding a0=2 fixes the sequence 2,5,8,11,….

Its closed formula is an=2+3n, which gives the value without computing the preceding terms. Check the initial condition: 2+3(0)=2. Check the recurrence: 2+3(n−1)+3=2+3n. These checks show that the formula obeys both parts of the definition.

A second-order rule needs two starting terms. The Fibonacci sequence has f0=0, f1=1 and fn=fn−1+fn−2 for n≥2. It begins 0,1,1,2,3,5,8,13,….

A culture starting with 1,000 cells and doubling each hour satisfies P0=1,000 and Pn=2Pn−1. Therefore Pn=1,000⋅2n, giving P5=32,000 after five hours.

Recognize a pattern without assuming uniqueness

Differences, ratios and familiar powers help suggest formulas. Squares suggest n2; the terms 1,3,7,15,31 suggest 2n−1 for n≥1. A finite prefix does not determine an infinite sequence, however. Starting with 1,2,4, the rule an=2n−1 gives 8 next, while an=n(n−1)/2+1 gives 7. A pattern-based guess remains a conjecture until it follows from the definition, often by induction.

Treat strings as finite sequences

A string over an alphabet Σ is a finite sequence of symbols from it. The bit string 0110 has length 4 over {0,1}. Order and repetition matter: 0110 differs from 0101, and its two 1s occupy different positions.

The empty string λ has length 0; another common symbol is ε. The set Σ∗ contains every finite string over the alphabet, including the empty one. A string is one ordered object; a set of strings is a collection of such objects.

Key Takeaways

  • An index gives a position; the term is its value.
  • Arithmetic progressions add a fixed difference; geometric progressions multiply by a fixed ratio.
  • A recurrence needs enough initial conditions to determine its terms.
  • A closed formula must match both the starting values and the recurrence.
  • A finite prefix can fit more than one rule.
  • Strings are finite sequences, including the empty string of length 0.

4.2 Reading and rewriting sigma notation

The notation ∑j=mnaj means add the terms am+am+1+⋯+an. The lower and upper limits are included. When m≤n, there are n−m+1 terms.

Expand before calculating

For example, ∑j=15j2=1+4+9+16+25=55. The index j is a placeholder: using i or k instead leaves the sum unchanged if every occurrence is renamed. It has no assigned value outside the sum.

Limits may start at 0 or a negative integer. An empty sum, whose lower limit exceeds its upper limit, is 0. This is the neutral starting value for repeated addition, like a running total before any items are added. From 3 through 10 there are 8 indices, not 7: both endpoints contribute.

Split and combine sums

Linearity permits constants to move outside and sums to split termwise:

∑j=mn(caj+bj)=c∑j=mnaj+∑j=mnbj.

A constant added n times gives ∑j=1nc=nc. Products do not separate in the same way. For j=1,2, ∑j⋅j=1+4=5, whereas multiplying the two separate sums gives (1+2)(1+2)=9 because it includes cross terms.

A split must include each term once:

∑j=1naj=∑j=1kaj+∑j=k+1naj.

To keep the squares from 50 through 100, subtract only those through 49:

∑k=50100k2=∑k=1100k2−∑k=149k2=338,350−40,425=297,925.

Subtracting through 50 would remove the first wanted term.

Shift the expression and both limits

With k=j−1, the sum ∑j=15j2 becomes ∑k=04(k+1)2. At the first index, both expressions contribute 1. At the last, both contribute 25. Changing only the limits or only the expression would describe different terms.

Read nested sums and products

In a double sum, evaluate the inner sum for each outer index. For

∑i=14∑j=13ij,

the inner sum is i(1+2+3)=6i. Summing over the outer index gives 6(1+2+3+4)=60. If the inner upper limit is i, the number of terms changes with the outer index: ∑i=1n∑j=1i1=∑i=1ni. This counts the number of inner-loop executions in a triangular nested loop.

A sum can also run over a set. For S={0,2,4}, ∑s∈Ss2=20. Product notation replaces addition with multiplication: ∏j=1naj=a1a2⋯an. Thus n!=∏j=1nj and ∏j=14j=24. An empty product is 1, the neutral value for multiplication; in particular, 0!=1.

Key Takeaways

  • Inclusive limits from m through n give n−m+1 terms.
  • An empty sum is 0 and an empty product is 1.
  • Linearity separates added terms and constant factors, not arbitrary products.
  • When shifting an index, change the expression and both endpoints together.
  • A double sum evaluates its inner sum for each outer index.

4.3 Closed formulas and cancellation

A useful sum formula depends on the pattern and on the number of terms. First identify whether the terms grow by addition, multiplication or a difference that cancels.

Arithmetic sums and powers

The first positive integers satisfy ∑k=1nk=n(n+1)/2. To see why, write the sum forward and backward. Each paired position adds to n+1, and there are n pairs. Twice the sum is therefore n(n+1). For n=100, the sum is 5,050.

Any arithmetic series equals the number of terms times the average of its endpoints. For 7+10+13+⋯+52, the step is 3, so there are (52−7)/3+1=16 terms. The sum is 16(7+52)/2=472.

Two other standard formulas are

∑k=1nk2=n(n+1)(2n+1)6,∑k=1nk3=(n(n+1)2)2.

For n=10, they give 385 and 3,025. These formulas sum powers of individual terms; cubing a sum is a different operation.

Linearity and subtraction extend the formulas. For example, ∑k=120(3k−2)=3(210)−2(20)=590. Also ∑k=1120k=210−55=155. The subtracted part stops at 10, preserving the term 11.

Geometric sums

For r≠1,

∑j=0narj=a(rn+1−1)r−1.

To derive it, call the sum S and multiply by r. Subtract S from rS. All middle terms cancel, leaving rS−S=arn+1−a. Dividing by r−1 gives the formula. The exponent n+1 is the number of terms because the indices start at 0. If r=1, division would fail; each term is simply a, giving (n+1)a.

Thus ∑j=092j=210−1=1,023 and ∑j=053⋅2j=3(64−1)=189.

Telescoping sums

A telescoping sum cancels adjacent terms. In ∑k=1n(ak−ak−1), every middle value appears once positively and once negatively, leaving an−a0.

Since 1/(k(k+1))=1/k−1/(k+1),

∑k=1n1k(k+1)=(1−1/2)+(1/2−1/3)+⋯+(1/n−1/(n+1))=1−1n+1.

For n=99 the result is 99/100. Writing the first and last terms makes the surviving endpoints visible.

Infinite geometric series

When ∣r∣<1, the term rn+1 tends to 0, giving ∑j=0∞arj=a/(1−r). For example, 1+1/2+1/4+⋯=2. If ∣r∣≥1 and a≠0, there is no finite sum.

Repeating decimals can be evaluated with this idea: 0.333…=(3/10)/(1−1/10)=1/3. Similarly, 0.999…=1, which explains why a real number can have two decimal expansions.

A few successful numerical checks support a formula but do not prove it for all indices. Pairing and cancellation are direct proofs; many other sum formulas are proved by induction.

Key Takeaways

  • An arithmetic sum is its term count times the mean of its endpoint terms.
  • The finite geometric formula needs r≠1; when r=1, count the equal terms.
  • Sums of squares and cubes have different closed formulas.
  • Telescoping leaves the uncanceled boundary terms.
  • An infinite geometric series with nonzero first term has a finite sum exactly when ∣r∣<1.
  • Checking finitely many cases is not a proof for every index.
5

Comparing infinite sizes

For finite sets, counting elements decides their size. Infinite sets require a different test: can their elements be matched without repeats or omissions? Some sets that seem much larger still admit such a matching, including the integers and rationals. Other sets defeat every proposed list. You will build complete enumerations and then use diagonal arguments to show why no enumeration can reach every real number or every subset of the natural numbers.

5.1 Match elements to compare cardinalities

Sets have the same cardinality when a bijection matches their elements. For finite sets this agrees with counting. For infinite sets it gives a precise meaning to “same size” without finishing a count.

Use the right function test

Write ∣A∣=∣B∣ when some bijection A→B exists. Its inverse gives a bijection back, and composing bijections shows that equal cardinality passes through an intermediate set.

The statement ∣A∣≤∣B∣ means there is an injection A→B. It fits distinct elements of A into distinct places in B, possibly leaving places unused. Strict inequality ∣A∣<∣B∣ additionally requires that no bijection exists. For instance, inclusion gives an injection ℕ→ℝ, but that alone does not prove strict inequality.

An infinite set can match a proper subset

The function f(n)=2n bijects ℕ with its even elements. Distinct inputs remain distinct, and every even natural number 2k is reached by k. The odd numbers left outside the target subset do not prevent this matching.

Hilbert's hotel makes the same idea visible. Its rooms are numbered 1,2,3,… and all are occupied. Move the guest in room n to room n+1. Every old guest still has a room, no two collide, and room 1 becomes free. There is no final room whose guest would be pushed out.

A shift n↦n+1 bijects ℕ with ℤ+. The integers can also be matched with ℕ by

f(n)={n/2n even,−(n+1)/2n odd.

The outputs are 0,−1,1,−2,2,…. Every nonnegative integer comes from an even input, and every negative integer from an odd input, with no repetitions.

Intervals need not differ in cardinality

The map x↦2x bijects (0,1) with (0,2). More generally, x↦a+(b−a)x bijects (0,1) with (a,b) for a<b. The inverse is y↦(y−a)/(b−a). Length and cardinality measure different features.

Even the whole real line has the same cardinality as (0,1): x↦tan⁡(πx−π/2) is a bijection. The inner expression runs through (−π/2,π/2), where tangent is strictly increasing and reaches every real value.

Two injections can replace one explicit bijection

The Schröder–Bernstein theorem says that injections A→B and B→A imply ∣A∣=∣B∣. Neither injection must be onto.

For example, inclusion injects (0,1) into (0,1]. In the reverse direction, x↦x/2 injects (0,1] into (0,1), with image (0,1/2]. The theorem establishes equal cardinality without an explicit bijection.

Failure of one proposed map does not establish different sizes. Inclusion ℕ→ℤ misses the negatives, yet the alternating-sign construction succeeds. Conversely, being infinite does not by itself guarantee equal cardinality: a proof still needs an appropriate matching or theorem.

Key Takeaways

  • Equal cardinality means that some bijection exists.
  • An injection establishes a non-strict cardinality comparison.
  • An infinite set can match a proper subset of itself.
  • Injections in both directions establish equal size by Schröder–Bernstein.
  • One failed bijection candidate does not rule out every bijection.

5.2 Complete lists of countable sets

A set is countable when it is finite or can be matched bijectively with ℕ. An infinite countable set is countably infinite, with cardinality ℵ0, read “aleph null.” A set that is not countable is uncountable. Some texts reserve “countable” for the infinite case; here finite sets are included.

Every element needs a finite position

An infinite set is countable exactly when its elements can be listed as a1,a2,a3,… with every element appearing at a finite position. Repetitions may be skipped to obtain a bijective list.

The integers have the list 0,1,−1,2,−2,…. Listing all nonnegative integers “and then the negatives” fails: the first part never ends. The odd positive integers also form a complete list through the bijection n↦2n−1 from ℤ+.

Visit a grid by finite diagonals

For positive integer pairs, list by increasing i+j:

(1,1);(1,2),(2,1);(1,3),(2,2),(3,1);…

Every diagonal is finite, and a pair (i,j) lies on the diagonal with sum i+j. Only finitely many pairs precede it. Listing an entire infinite row first would never reach the second row.

An explicit alternative is the Cantor pairing function on nonnegative integers:

π(i,j)=(i+j)(i+j+1)2+j.

For i+j=s, its outputs run from s(s+1)/2 through s(s+1)/2+s, one for each value of j. The next diagonal starts at (s+1)(s+2)/2, exactly one more than the previous endpoint. Thus the diagonals fill the natural numbers without gaps or collisions.

Enumerate fractions and strings

A positive rational can be represented as p/q with positive integers p,q. Visit the pair grid by diagonals and skip fractions not in lowest terms. The list begins 1,1/2,2,1/3,3,1/4,2/3,3/2,4,…. Every rational's reduced pair appears at a finite point, and skipping duplicates preserves that fact. Include 0 and alternate positive and negative entries to list all of ℚ.

The set of finite strings over a finite alphabet is countable too. Order strings by length, then alphabetically within each length. For binary strings this gives λ,0,1,00,01,10,11,000,…. Each length contributes finitely many strings, so any specified finite string is reached. Pure alphabetical order can get stuck at λ,0,00,000,… and never reach 1. Programs are finite strings over finite alphabets, so there are countably many possible programs in a programming language.

Reuse countability results

Every subset of a countable set is countable. Two countable lists can be interleaved to list their union, skipping duplicates. Two countable factors give a countable Cartesian product by diagonal traversal. A countable union of countable sets is countable as well: arrange their lists in rows and visit entries diagonally. Skip positions beyond the end of a finite row and every position in an empty row.

The rationals are dense—another rational lies between any two distinct rationals—yet countable. Density concerns gaps in an ordering; countability concerns the existence of a complete list.

Key Takeaways

  • Countable includes finite sets; countably infinite means cardinality ℵ0.
  • A valid infinite list reaches each element after finitely many positions.
  • Finite diagonals enumerate pairs without becoming trapped in one row.
  • Reduced fractions and length-ordered finite strings admit complete lists.
  • Subsets, finite products and countable unions preserve countability.
  • Density does not imply uncountability.

5.3 Diagonal arguments and larger infinities

A diagonal proof defeats an arbitrary proposed complete list by constructing an object that it misses. The constructed object must belong to the very set the list claims to cover.

A real number outside every proposed list

Suppose all reals in (0,1) could be listed as r1,r2,…. Write their decimal digits as ri=0.di1di2…. Construct r=0.d1d2… by choosing di=4 if dii≠4 and di=5 if dii=4.

The new number is in (0,1). For every row i, it differs from ri at digit i. Therefore it is absent from the entire list, contradicting completeness. Since the proposed list was arbitrary, no list works: (0,1) and hence ℝ are uncountable.

For example, diagonal digits 1,6,4,0 produce the prefix 0.4454…. The full construction continues through every row; the first four digits alone do not determine the missing number.

Choosing only 4 and 5 avoids an important decimal issue. Numbers such as 0.5000…=0.4999… have two expansions. A number with only 4s and 5s has a unique expansion, so the digit differences really establish unequal numbers. A careless “add 1” rule can also produce an invalid digit at 9.

Why the same claim fails for rationals

Diagonalizing against a list of rational numbers still constructs a real number, but need not construct a rational one. Being absent from that list would then be expected, not contradictory. For positive integers, an endless digit string need not be an integer at all. Checking that the constructed object stays in the target set is essential.

The irrationals are uncountable. Otherwise their union with the countable rationals would make ℝ countable, contradicting the diagonal proof.

Every power set is larger than its set

Cantor's theorem states ∣A∣<∣𝒫(A)∣ for every set A. The singleton map a↦{a} is injective, giving the non-strict comparison. To rule out surjectivity of any f ⁣:A→𝒫(A), define

D={a∈A∣a∉f(a)}.

This is a subset of A, so an onto function would have f(d)=D for some d∈A. If d∈D, its defining rule says d∉f(d)=D. If d∉D, that rule says d∈f(d)=D. Both possibilities contradict themselves. Thus no function of this form is onto, and no bijection exists.

For finite sets the theorem agrees with n<2n. For the naturals it proves that 𝒫(ℕ) is uncountable. Repeating the construction gives ∣ℕ∣<∣𝒫(ℕ)∣<∣𝒫(𝒫(ℕ))∣<⋯.

Finite programs and infinite output choices

Every subset of ℕ corresponds to its characteristic function ℕ→{0,1}, an infinite bit string. Flipping bit i of row i constructs an infinite bit string absent from any proposed list. These functions are therefore uncountable.

Programs, however, form a countable set of finite strings. Each program computes at most one total function of this kind. Consequently, some functions ℕ→{0,1} are uncomputable: no program computes them. This is an existence argument, not a claim that a particular displayed function is uncomputable.

Key Takeaways

  • A diagonal argument constructs an object missing from an arbitrary proposed complete list.
  • The constructed object must belong to the target set.
  • The 4-or-5 digit rule avoids duplicate decimal representations.
  • Cantor proves that every set has strictly smaller cardinality than its power set.
  • The reals, irrationals and infinite binary strings are uncountable.
  • Countably many finite programs cannot compute all uncountably many binary-valued functions.

Sets and Functions examples

5 Walkthroughs

1

Build and combine sets

15 steps
Follow membership from braces and subsets to products, regions and membership bits.
  1. 1
    IntroductionDecide which objects belong

    A set gives a precise membership test: an object either belongs or does not. We will start by reading its elements, then build subsets and ordered pairs before combining collections.

    Keep track of the kind of object each expression describes. A number, a singleton containing that number, and a pair using it in one coordinate play different roles even when the same symbol appears.

  2. 2
    ExplanationRead the outer braces

    In A={2,{2,6},∅}, the outer elements are 2, the set containing 2 and 6, and the empty set. Thus ∣A∣=3.

    The inner set counts as one object. It does not place 6 directly in A, so 6∉A. Likewise, adding a repeated 2 to the roster would not add a new element. Sets preserve distinct membership, not the number of written entries.

  3. 3
    ExampleTurn a property into a roster

    Consider S={n∈ℤ∣n2<10}. The allowed integers run from −3 to 3 because 32=9<10 but 42=16>10.

    Therefore S={−3,−2,−1,0,1,2,3}. Include both signs because they give the same square. Include 0 because the inequality allows its square; the domain ℤ determines that we list integers, not all real values between the endpoints.

  4. 4
    ChallengeCount nested objects

    Let T={5,5,{5},∅}. What is its cardinality, and does {5} belong to it?

    ---reveal---

    ∣T∣=3 because its distinct elements are 5, the singleton containing 5, and the empty set. Yes, {5}∈T: that entire set is explicitly listed as an element. Repeating the number 5 does not create a fourth element.

  5. 5
    ExplanationTest all elements of a subset

    The statement S⊆T checks every element of S against membership in T. For S={2,6} and T={2,4,6}, both checks pass, so the inclusion holds.

    It is proper because 4 belongs to T but not to S. Equality is allowed by ⊆; proper containment additionally requires a difference. Membership, such as 2∈T, checks a single object instead.

  6. 6
    ExampleList every subset once

    For E={r,s}, each element can be included or excluded. The four resulting subsets are ∅, {r}, {s} and {r,s}.

    These four sets are the elements of 𝒫(E). Notice that r∈E while {r}∈𝒫(E). The empty subset must be included: choosing neither original element is one valid choice.

  7. 7
    ChallengeSeparate an element from a subset

    Let D={1,{1}}. Are {1}∈D and {1}⊆D both true?

    ---reveal---

    Yes. The first statement is true because the singleton is listed as an outer element. The second is true because its only element, 1, also belongs to D. The same two symbols can satisfy both relations, but the reasons come from different membership checks.

  8. 8
    ExampleChoose the two coordinates

    Let A={a,b} and B={7,9}. Fix a first coordinate and try every allowed second coordinate:

    A×B={(a,7),(a,9),(b,7),(b,9)}.

    The product has 2⋅2=4 elements. Each pair has a letter first and a number second. Reversing the factors produces pairs with a number first, so equal counts do not imply equal product sets.

  9. 9
    ChallengeCount a product after an intersection

    Let P={u,v,w}, Q={2,3,4} and R={1,4}. What is P×(Q∩R)?

    ---reveal---

    The second coordinate must be 4, the sole member of Q∩R. The product is {(u,4),(v,4),(w,4)} with three elements. Multiplying the sizes of P and all of Q would include pairs whose second coordinates fail the intersection condition.

  10. 10
    ExplanationChoose an overlap rule

    For A={1,3,5} and B={3,5,7}, union gives {1,3,5,7} and intersection gives {3,5}.

    The union keeps the overlap because its “or” means at least one set. The symmetric difference removes that overlap, leaving {1,7}. In a two-circle Venn diagram, these are respectively all of both circles, only their shared lens, and the two nonoverlapping parts.

  11. 11
    ExampleFind the complement inside a universe

    Fix U={1,2,3,4,5,6,7,8} and A={1,3,5}. The complement is A‾={2,4,6,7,8}.

    A complement scans the whole stated universe and keeps the elements outside the set. Difference scans only the first set: if B={3,5,7}, then A−B={1}. Thus A−B=A∩B‾, while B‾ can contain many elements outside A.

  12. 12
    ConnectionRead operations as bit tests

    In universe order (1,2,3,4), let A have string 1010 and B string 0110. Bitwise OR gives 1110 for the union; AND gives 0010 for the intersection.

    XOR gives 1100 for membership in exactly one set. Flipping 1010 gives 0101 for the complement of A. Each position has a fixed meaning, so the universe order must stay unchanged across both input strings and the result.

  13. 13
    ExampleRemove a double count

    In a group of 48, there are 28 members in A, 23 in B and 9 in both. Adding the separate totals gives 51 because the nine shared members appear twice.

    Subtract one copy of the overlap: ∣A∪B∣=28+23−9=42. The number outside both is then 48−42=6. These are two different regions: first find the union, then subtract it from the universe.

  14. 14
    ChallengeCombine subsets with counts

    A universe has 64 elements. Sets A and B have sizes 35 and 27, and their intersection has 11 elements. How many elements are in exactly one set, and how many subsets does that collection have?

    ---reveal---

    The union has 35+27−11=51 elements. Remove its shared part to keep exactly-one membership: 51−11=40. This subset therefore has 240 subsets. Union counts the shared elements once; symmetric difference removes them entirely.

  15. 15
    RecapKeep the object and the test clear

    Read braces at the outer level before counting elements. Subset statements test every element of the first set, while power sets collect all possible subsets. Products preserve coordinate roles.

    For operations, decide whether the condition is “at least one,” “both,” “first only,” or “exactly one.” A stated universe completes a complement test. The same tests work on Venn regions and fixed-order membership bits.

2

Prove a set equation

10 steps
Turn membership conditions into complete identities and use counterexamples to reject false claims.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionAn equation about every element
  2. 2
    ExampleFactor a shared set
  3. 3
    Key InsightComplement reverses the connective
  4. 4
    ChallengeSimplify a nested complement
  5. 5
    ExplanationWrite a reversible membership chain
  6. 6
    ExampleUse a hypothesis at the decisive step
  7. 7
    TipTest every membership row
  8. 8
    ChallengeFind the error in a proof
  9. 9
    ChallengeProve a conditional equality
  10. 10
    RecapChoose evidence that covers the claim
3

Follow inputs through functions

18 steps
Classify assignments, compose and invert them, then apply floor, ceiling and membership functions.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionTrack inputs and allowed targets
  2. 2
    ExplanationA function needs one value per input
  3. 3
    ExampleFollow a subset backward
  4. 4
    ChallengeCheck a proposed target set
  5. 5
    ExplanationLook for collisions and missed values
  6. 6
    ExampleProve a linear map is one-to-one
  7. 7
    ExampleFind an input for an arbitrary target
  8. 8
    ChallengeChange the input set
  9. 9
    ExampleCompose without reversing order
  10. 10
    ExplanationUndo the whole assignment
  11. 11
    Key InsightReverse the order when undoing
  12. 12
    ChallengeRestrict a domain before inverting
  13. 13
    ExplanationUse the number line for floor
  14. 14
    ExampleInclude the partly filled block
  15. 15
    ConnectionEncode a subset as a function
  16. 16
    ChallengeCount positions in a binary representation
  17. 17
    ChallengeA bijection through a smaller image
  18. 18
    RecapCheck the sets before the formula
4

Read sequences and evaluate sums

15 steps
Track index starts, rewrite sums and use pairing or cancellation to evaluate them.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionKeep the index and value separate
  2. 2
    ExplanationChoose the starting exponent
  3. 3
    ExampleGenerate terms from a recurrence
  4. 4
    ChallengeTest an index convention
  5. 5
    ExampleExpand all included indices
  6. 6
    TipShift expression and endpoints together
  7. 7
    ChallengeRead a nested loop as a sum
  8. 8
    ExamplePair the first and last terms
  9. 9
    ExplanationCancel a shifted geometric sum
  10. 10
    ExampleKeep only the boundary terms
  11. 11
    Key InsightAn infinite sum needs a shrinking tail
  12. 12
    ChallengeChoose the formula that matches the series
  13. 13
    ConnectionSubtract the unwanted prefix
  14. 14
    ChallengeCombine linearity with range subtraction
  15. 15
    RecapMatch the formula to the pattern
5

Build lists and defeat lists

16 steps
Compare infinite sets by mappings, enumerate countable objects and follow two diagonal proofs.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionSize without finishing a count
  2. 2
    ExampleMatch naturals with a proper subset
  3. 3
    AnalogyMove every guest one room
  4. 4
    ChallengeCompare intervals with two injections
  5. 5
    ExplanationA list must reach every element
  6. 6
    ExampleVisit pairs on finite diagonals
  7. 7
    ConnectionFractions inherit the pair listing
  8. 8
    ChallengeList strings without getting stuck
  9. 9
    ExplanationAssume a real-number list is complete
  10. 10
    ExampleChange the diagonal digits
  11. 11
    ChallengeKeep the constructed object in the set
  12. 12
    ExplanationConstruct a subset an onto map misses
  13. 13
    Key InsightPower sets give strictly larger sizes
  14. 14
    ConnectionFinite descriptions versus infinite strings
  15. 15
    ChallengeRemove a countable part
  16. 16
    RecapConstruct a matching or defeat every list

Sets and Functions practice questions

50 Practice Questions in 5 sets

Set 1: Changing domains and following formulas10 Practice Questions

Question 1 of 10

Which roster equals {z∈ℤ∣1<z2≤16}?
  1. {2,3,4}
  2. {−3,−2,2,3}
  3. {−4,−3,−2,−1,1,2,3,4}
  4. {−4,−3,−2,2,3,4}
Show answerHide answer
Answer: D
The square must be greater than 1 and at most 16, so the allowed integer magnitudes are 2, 3 and 4. Both positive and negative signs work. Excluding both signs of 4 incorrectly treats the upper inequality as strict, while including both signs of 1 ignores the strict lower inequality.

Question 2 of 10

Let S={∅,{u}}. Which statement is true?
  1. {∅}⊆S
  2. u∈S
  3. {u}⊆S
  4. {∅}∈S
Show answerHide answer
Answer: A
The only element of the singleton containing the empty set is the empty set itself, which is listed in S. By contrast, the singleton containing u is not a subset of S because u itself is not listed. Being an element of an element does not automatically make u an element of the outer set.

Question 3 of 10

A table for three sets compares two set expressions and finds a mismatch when A=0,B=1,C=0. What does that establish?
  1. The expressions are unequal for all sets.
  2. The expressions are unequal for some sets.
  3. The expressions agree whenever A is empty.
  4. The expressions agree if all eight rows are used.
Show answerHide answer
Answer: B
The mismatching row is a membership pattern on which the expressions differ, so a universe with an element in B alone supplies a counterexample. One mismatch disproves a universal identity. It does not establish inequality for every choice of sets, since other membership patterns may give matching results.

Question 4 of 10

Let f ⁣:ℤ→ℤ satisfy f(n)=n2−2. What is f−1({2,7})?
  1. {−3,−2,2,3}
  2. {2,3}
  3. {0,5,47}
  4. {−2,2}
Show answerHide answer
Answer: A
The target values require squares of 4 or 9, so the matching integer inputs are both signs of 2 and 3. A preimage collects all matching inputs even when the function is not injective. Keeping only the positive roots discards two valid inputs without any domain restriction allowing that.

Question 5 of 10

What is ⌊−6.2⌋+⌈−6.2⌉?
  1. −12
  2. −14
  3. −13
  4. 13
Show answerHide answer
Answer: C
The greatest integer at most negative 6.2 is negative 7, and the least integer at least it is negative 6. Their sum is negative 13. Dropping the decimal digits for both values would give negative 12, but that truncation rule does not compute floor for a negative noninteger.

Question 6 of 10

A geometric sequence has b1=7 and bn+1=−2bn. Which formula matches it?
  1. bn=7(−2)n
  2. bn=7−2(n−1)
  3. bn=−14(−2)n−1
  4. bn=7(−2)n−1
Show answerHide answer
Answer: D
The first term requires exponent 0 at n equal to 1, and each index increase must multiply the value by negative 2. The formula with exponent n has the correct ratio but starts at negative 14. An arithmetic formula with common difference negative 2 would add a fixed amount instead of multiplying.

Question 7 of 10

What is the sum 6+10+14+⋯+42?
  1. 216
  2. 240
  3. 264
  4. 480
Show answerHide answer
Answer: B
The common difference is 4, so the term count is the difference of the endpoints divided by 4, plus 1: ten terms. Their mean is 24, giving 240. The value 216 uses nine terms and loses an endpoint; both 6 and 42 belong in the arithmetic series.

Question 8 of 10

Let A=(0,3] and B=(0,3). What establishes that they have equal cardinality?
  1. Inclusion A ← B and the map A → B, x ↦ x/2.
  2. Inclusion A ← B and the map A → B, x ↦ x+1.
  3. Inclusion A → B and the map B → A, x ↦ x/2.
  4. Inclusion A ← B alone, since it misses one point.
Show answerHide answer
Answer: A
Inclusion injects B into A, and halving injects A into B because its image is the interval from 0 excluded to 1.5 included. Schröder–Bernstein then gives equal cardinality. Shifting by 1 does not map all of A into B, and inclusion alone establishes only a non-strict size comparison.

Question 9 of 10

An alphabet has symbols a, b and c. Which ordering reaches every finite string at a finite position?
  1. All strings beginning with a, then b, then c.
  2. All lengths of a alone, then strings containing b.
  3. By length, then alphabetically within each length.
  4. Ordinary alphabetical order without length groups.
Show answerHide answer
Answer: C
Each fixed length has finitely many strings, so only finitely many entries precede any specified finite string in the length ordering. Listing every a-starting string first gets trapped in an infinite block. Pure alphabetical order has the same problem with a, aa, aaa and so on before it reaches b.

Question 10 of 10

Let X be the set of irrationals in (2,5). Which argument correctly proves X uncountable?
  1. X is uncountable because every pair of its points has another point between.
  2. If X were countable, adjoining the rational points would make (2,5) countable.
  3. X is uncountable because removing any infinite subset preserves uncountability.
  4. X is uncountable because its members have infinitely many decimal digits.
Show answerHide answer
Answer: B
The interval is bijective with the uncountable unit interval, while its rational points form a subset of the countable rationals. If X were countable too, their union would be countable, a contradiction. Density does not prove uncountability: the rational points also lie densely in this interval.
Set 2: Elements, assignments and first calculations10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

Let A={7,{7,8},7,∅}. What is ∣A∣?
  1. 2
  2. 3
  3. 4
  4. 5
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

Let T={p,q,r,s,t}. How many elements does 𝒫(T) have?
  1. 10
  2. 25
  3. 32
  4. 31
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

Let A={m,n} and B={4,9}. Which pair belongs to B×A?
  1. (9,m)
  2. (m,9)
  3. (4,9)
  4. (m,n)
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

Of 56 participants, 31 use a text editor, 29 use a notebook and 12 use both. How many use neither?
  1. 4
  2. 16
  3. 20
  4. 8
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

Which expression always equals A∩(A∪B)?
  1. B
  2. A
  3. A∩B
  4. A∪B
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

A function from a five-element set to a five-element set has range of size four. How is it classified?
  1. Injective and surjective.
  2. Injective but not surjective.
  3. Neither injective nor surjective.
  4. Surjective but not injective.
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

For which real c is f ⁣:[c,∞)→[0,∞), f(x)=(x−4)2, bijective?
  1. c=4
  2. c=0
  3. c=3
  4. c=5
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

A sequence satisfies a0=5 and an=an−1−4 for n≥1. What is a3?
  1. −3
  2. −11
  3. 1
  4. −7
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

What is ∑j=−21(j+3)?
  1. 6
  2. 10
  3. 9
  4. 12
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

Which function is a bijection from ℕ onto {3,6,9,12,…}?
  1. f(n)=3n+3
  2. f(n)=3n
  3. f(n)=n+3
  4. f(n)=3n+6
Show answerHide answer

Save this lesson to see this answer.

Set 3: Membership proofs and complete enumerations10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

The Cantor pairing function is π(i,j)=(i+j)(i+j+1)/2+j on ℕ2. Which pair maps to 13?
  1. (1,3)
  2. (3,1)
  3. (2,2)
  4. (0,4)
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

How many terms are included in ∑k=617k3?
  1. 11
  2. 17
  3. 12
  4. 18
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

Let A={2,5,8}, B={v,w} and C={w,x,y}. What is ∣A×(B∩C)∣?
  1. 6
  2. 9
  3. 3
  4. 12
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

In the fixed universe order (a,b,c,d,e), subsets A and B have bit strings 10110 and 01101. What represents A∩B?
  1. 11111
  2. 00100
  3. 11011
  4. 10010
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

Which expression always equals A∪B‾‾?
  1. A‾∪B
  2. A∩B‾
  3. A‾∩B‾
  4. A‾∩B
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

Assume (A∩C)⊆B and A⊆B∪C. Which conclusion must follow?
  1. A⊆B
  2. B⊆A
  3. A⊆C
  4. C⊆B
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

Let f ⁣:{a,b,c,d}→{1,2,3,4} map a and c to 2, b to 4, and d to 1. What is f({a,c,d})?
  1. {1,2,4}
  2. {1,2}
  3. {2,2,1} with size 3
  4. {a,c}
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

Let f ⁣:ℕ→ℤ map even n to n/2+2 and odd n to (3−n)/2. What proves f bijective?
  1. Targets y≥2 use n=2y; targets y<2 use n=3−2y, uniquely.
  2. Targets y≥2 use n=2(y−2); targets y<2 use n=2y−3, uniquely.
  3. Targets y≥2 use n=2(y−2); targets y<2 use n=5−2y, uniquely.
  4. Targets y≥2 use n=2(y−2); targets y<2 use n=3−2y, uniquely.
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

Let f ⁣:ℝ→ℝ be f(x)=4x−5 and g(x)=3x+2. Which formula gives (f∘g)−1(y)?
  1. y−312
  2. y+512−2
  3. y−23+54
  4. 112y+3
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

For an arbitrary f ⁣:ℕ→𝒫(ℕ), set D={n∣n∉f(n)}. Why can D not equal f(k) for any k?
  1. D would have to contain every natural number and also be empty.
  2. The sets D and f(k) would have different finite cardinalities.
  3. Membership of k in D would be equivalent to its nonmembership in D.
  4. The index k would have to be a subset of D instead of an element.
Show answerHide answer

Save this lesson to see this answer.

Set 4: Boundary cases and several-step reasoning10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

Which set has exactly one element?
  1. {∅}
  2. ∅
  3. {0,∅}
  4. {∅,{∅}}
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

Let A={2,4} and B={2,4,6}. How many elements belong to 𝒫(B)−𝒫(A)?
  1. 2
  2. 6
  3. 4
  4. 8
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

Finite nonempty sets satisfy A×B=B×A and ∣A×B∣=49. What must be true?
  1. A≠B and ∣A∣=7
  2. A=B and ∣A∣=49
  3. A≠B and ∣B∣=1
  4. A=B and ∣A∣=7
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

Which expression simplifies (A∪B)∩(A∪B‾)?
  1. B
  2. A
  3. U
  4. A∩B
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

Let f ⁣:ℤ→ℤ be f(n)=an+b, with integers a and b. Which condition makes f bijective?
  1. a∈{−1,1}, b∈ℤ
  2. a≠0, b∈ℤ
  3. a∈{−2,2}, b∈ℤ
  4. a=0, b∈ℤ
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

A file has 1,025 bits and storage blocks hold 32 bits each. How many blocks are required?
  1. 31
  2. 32
  3. 33
  4. 34
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

A sequence has a0=3, a1=2 and an=2an−1+an−2 for n≥2. What is a4?
  1. 17
  2. 39
  3. 40
  4. 99
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

What is ∑k=48(2k2−3k)?
  1. 286
  2. 322
  3. 470
  4. 290
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

A proof finds that h ⁣:ℕ→ℤ, h(n)=n, is not onto. What conclusion follows?
  1. This map fails, while another bijection may exist.
  2. The integers have strictly larger cardinality than the naturals.
  3. No injection from the integers to the naturals exists.
  4. The naturals and integers cannot be compared by functions.
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

Let X={(S,n)∣S⊆ℕ, n∈ℕ}. Which argument proves X uncountable?
  1. Every element has two entries, so X is as large as the real plane.
  2. The map S ↦ (S,0) injects the uncountable power set into X.
  3. Both factors are infinite, so their product is always uncountable.
  4. A diagonal listing of both factors would enumerate all of X.
Show answerHide answer

Save this lesson to see this answer.

Set 5: Transfer across sets, functions and infinity10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

Of 84 records, 46 carry tag A and 39 carry tag B. Exactly 17 carry neither tag. How many carry both?
  1. 1
  2. 18
  3. 22
  4. 28
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

For arbitrary sets, what condition is equivalent to A−B=A−C?
  1. B=C
  2. B∩C=∅
  3. A⊆B∩C
  4. A∩B=A∩C
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

A function f on a set A satisfies f(S∩T)=f(S)∩f(T) for every pair of subsets S,T of A. Which property must f have?
  1. Injectivity.
  2. Surjectivity.
  3. Constancy.
  4. Finite range.
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

On ℝ, let f(x)=5x−2 and g(x)=x+4. What is (f∘g)(−1)?
  1. −3
  2. 17
  3. 13
  4. 7
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

Let g ⁣:A→B and f ⁣:B→C, with f∘g bijective. Which properties are forced?
  1. g is surjective and f is injective.
  2. Both f and g must be bijective.
  3. Both f and g must be surjective.
  4. g is injective and f is surjective.
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

How many binary digits are needed to represent the positive integer 256?
  1. 8
  2. 9
  3. 10
  4. 16
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

With k=j+2, which sum equals ∑j=04(3j+1)?
  1. ∑k=26(3k−5)
  2. ∑k=26(3k+1)
  3. ∑k=04(3k−5)
  4. ∑k=26(3k+7)
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

What is ∑k=261/(k(k+1))+∑j=0∞3(1/4)j?
  1. 347
  2. 5514
  3. 6114
  4. 5914
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

Let X be the set of all finite sequences of integers, allowing every finite length. Which argument proves X countable?
  1. Finite integer sequences form a finite union of countably infinite sets.
  2. Every fixed-length block is finite, so their countable union is countable.
  3. Length-first ordering works because each length block can be completely listed before the next.
  4. Each fixed-length block is a finite product of countable sets, and there are countably many lengths.
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

Why can no programming language with finite programs over a finite alphabet compute every total function ℕ→{0,1}?
  1. Programs are countable, binary-valued functions are uncountable, and each program specifies at most one.
  2. Programs and binary-valued functions are countable, but some programs specify multiple functions.
  3. Programs are uncountable, binary-valued functions are countable, and one program must be omitted.
  4. Programs are countable, and each finite program can handle only finitely many distinct input values.
Show answerHide answer

Save this lesson to see this answer.

Stuck on your own question? Homework Help

Key Terms

84 Key Terms, each with its definition

A

Absorption law
An absorption law removes a redundant intersection inside a union, or a redundant union inside an intersection, with the same set.
The absorption law reduces A∪(A∩B) to A because the added part is already inside it.
Algebraic proof
An algebraic proof of a set identity transforms one expression into the other through equalities justified by established set laws.
An algebraic proof can simplify A∩(B∪B‾) by complement and identity laws.
Arithmetic progression
An arithmetic progression is a sequence in which each successive term is obtained by adding the same fixed common difference.
The arithmetic progression 8,5,2,−1,… has common difference −3.
Arithmetic series
An arithmetic series is a sum of terms from an arithmetic progression, equal to the term count times the average of its endpoint terms.
The arithmetic series 4+7+10+13 has four terms with mean 8.5, so its sum is 34.
Associativity
Associativity means that regrouping three compatible operations does not change the result while the order of the operations remains fixed.
Associativity of composition makes h∘(g∘f) equal to (h∘g)∘f.

B

Base-2 logarithm
The base-2 logarithm of a positive number is the exponent to which 2 must be raised to obtain that number, reversing the exponential map.
The base-2 logarithm of 32 is 5, so 32 needs six binary digits including position zero.
Bijective function
A bijective function is both injective and surjective, matching every codomain element with exactly one input from its domain.
The shift n↦n+1 is a bijective function from the naturals to the positive integers.
Bit string
A bit string is a finite sequence of 0s and 1s; in a fixed finite universe, each position can record membership of one element.
In universe order (a,b,c), the bit string 101 represents the subset {a,c}.

C

Cantor pairing function
The Cantor pairing function bijects pairs of natural numbers with natural numbers using π(i,j)=(i+j)(i+j+1)/2+j.
The Cantor pairing function sends (0,2) to 5, giving that ordered pair a unique natural-number index.
Cantor's theorem
Cantor's theorem states that every set has strictly smaller cardinality than its power set, because no map onto all its subsets exists.
Cantor's theorem proves that 𝒫(ℕ) is uncountable and its own power set is larger again.
Cardinality
Cardinality measures set size, using an element count for finite sets and comparison by bijections or injections for infinite sets.
The naturals and even naturals have equal cardinality because n↦2n matches them bijectively.
Cartesian product
A Cartesian product is the set of all ordered combinations that choose one coordinate from each specified factor set.
The Cartesian product {a,b}×{3} consists of the two pairs (a,3) and (b,3).
Ceiling
The ceiling of a real number is the least integer no smaller than it, moving upward on the number line when the input is not an integer.
The ceiling of 8.02 is 9, so a load equal to 8.02 full container capacities needs one extra container beyond eight, nine in all.
Characteristic function
A characteristic function records membership of a subset by returning 1 on that subset and 0 on other elements of the universe.
The characteristic function of the even integers returns 1 at 8 and 0 at 9.
Closed formula
A closed formula expresses a sequence term directly in its index without requiring earlier terms to be computed first.
The closed formula an=4+5n gives a20 directly as 104.
Codomain
The codomain of a function is its declared target set, containing every actual output but possibly also elements never reached.
For integer squaring declared ℤ→ℤ, the codomain includes −1 even though it is not reached.
Complement
The complement of a set consists of all elements in a fixed universal set that do not belong to the set being complemented.
With universe {1,2,3,4}, the complement of {2,4} is {1,3}.
Composition
Composition combines functions by applying an inner function first and then applying an outer function to the resulting value.
The composition f∘g evaluates f(g(x)), so the output of g must be an allowed input to f.
Constant function
A constant function assigns the same output to every input, so it cannot be injective when its domain has at least two elements.
A constant function from ℤ to {7} is onto but has many repeated outputs.
Coordinate
A coordinate is an entry in a specified position of an ordered pair or tuple, chosen from the set assigned to that position.
The second coordinate of (p,8) is 8, so this pair requires 8 in the second factor set.
Countable set
A countable set is finite or has the same cardinality as the natural numbers; the infinite case admits a complete sequential listing.
The rationals form a countable set even though a rational lies between any two distinct rationals.
Countably infinite set
A countably infinite set has a bijection with the natural numbers and cardinality ℵ0, so it is countable but not finite.
The integers form a countably infinite set through the list 0,1,−1,2,−2,….
Counterexample
A counterexample is a permitted case in which a general claim fails, sufficient by itself to disprove a universal identity.
The sets A=∅ and B={1} give a counterexample to A∪B=A.

D

De Morgan's law
De Morgan's law moves a complement through a union or intersection by complementing the inputs and switching the operation.
De Morgan's law turns the complement of A∩B into A‾∪B‾.
Density
Density of an ordered number set means that another member lies between any two distinct members; it does not decide countability.
The density of the rationals is compatible with their countability, since a complete list still exists.
Diagonal argument
A diagonal argument constructs an object that differs from entry i of a proposed list at its ith feature, defeating the claim of completeness.
A diagonal argument for infinite bit strings flips each row's diagonal bit to form a missing string.
Disjoint sets
Disjoint sets are sets with no shared elements, meaning that their intersection is the empty set.
The odd integers and the even integers are disjoint sets, so their intersection is empty.
Distributive law
A distributive law rewrites union across intersection or intersection across union, preserving every membership condition.
The distributive law rewrites A∩(B∪C) as (A∩B)∪(A∩C).
Domain
The domain of a function is the set of allowed inputs, every one of which must receive a value for the function to be total.
The domain of x↦1/x must exclude 0 when the outputs are real numbers.
Double inclusion
Double inclusion is a proof of set equality that establishes each set as a subset of the other, ruling out extra elements on either side.
A double inclusion proof of X=Y separately shows X⊆Y and Y⊆X.
Double sum
A double sum adds terms over two indices, evaluating an inner sum for each permitted value of the outer index.
The double sum ∑i=13∑j=1i1 counts rows of one, two and three entries.

E

Element
An element is an object belonging to a set; it may be a number, a symbol or another set treated as one object.
The set {6,{6,9}} has two elements: a number and a set.
Element argument
An element argument proves containment or equality by following an arbitrary element through the relevant definitions and logical steps.
An element argument for A∩B⊆A begins with any member of the intersection.
Empty set
The empty set is the unique set with no elements, written ∅ or with an empty pair of braces.
The empty set solves {x∈ℝ∣x2=−4} because no real square is negative.
Empty sum
An empty sum is a sum over no index values and has value 0, the neutral value for adding further terms.
The empty sum ∑j=54aj equals 0 because its lower limit exceeds its upper limit.
Enumeration
An enumeration is a listing that reaches every element of its target set at some finite position, with repetitions removable if needed.
A diagonal enumeration of positive integer pairs reaches (2,1) instead of remaining in the first row forever.

F

Floor
The floor of a real number is the greatest integer no larger than it, moving downward on the number line when the input is not an integer.
The floor of −5.1 is −6 because −5 lies above the input and cannot be used.
Function
A function assigns each element of its domain exactly one value in its codomain; separate inputs may still share an output.
Squaring defines a function on the integers even though both −3 and 3 produce the value 9.

G

Geometric progression
A geometric progression is a sequence of the form a,ar,ar2,… in which each step multiplies by a fixed common ratio.
The geometric progression 5,−10,20,−40,… has common ratio −2.
Geometric series
A geometric series is a sum whose terms follow a geometric progression, with consecutive terms obtained by multiplying by a fixed ratio.
The geometric series 2+6+18+54 has ratio 3 and four terms, giving a sum of 80.
Graph
The graph of a function is the set of pairs consisting of each domain element and its assigned output, with each first coordinate used once.
The graph of f(x)=x+1 contains the pair (3,4) but no second pair starting with 3.

H

Hilbert's hotel
Hilbert's hotel is a model with infinitely many numbered rooms illustrating how a full countably infinite set can still admit additional elements.
Hilbert's hotel makes room 1 available by moving each old guest from room n to room n plus 1.

I

Idempotent law
An idempotent law says that combining a set with itself by union or intersection returns the original set without any change.
The idempotent law gives A∩A=A because checking the same membership twice adds no restriction.
Identity function
The identity function on a set maps each element to itself, giving a bijection that leaves a compatible composition unchanged.
The identity function on {p,q} sends p to p and q to q.
Image
The image of an input subset is the set of all outputs reached from that subset, listing repeated output values only once.
For squaring, the image of {−3,3} is {9} because the two inputs share an output.
Index shift
An index shift replaces the summation variable while changing both bounds and the summand to preserve every original term.
The index shift k=j+1 turns ∑j=02j2 into ∑k=13(k−1)2.
Infinite geometric series
An infinite geometric series adds indefinitely many geometric terms and, for a nonzero first term, has a finite sum exactly when the ratio's magnitude is below 1.
The infinite geometric series 3+1.5+0.75+⋯ has ratio one half and sum 6.
Initial condition
An initial condition supplies a starting term needed to determine a sequence defined by a recurrence, with higher-order rules needing more terms.
Fibonacci's recurrence uses the two initial conditions f0=0 and f1=1.
Injective function
An injective function assigns different outputs to different inputs, so any equality of output values forces equality of the original inputs.
The injective function x↦5x−1 on the reals has no pair of distinct inputs sharing an output.
Intersection
The intersection of sets consists of the elements belonging to every one of them; for two sets, it is their shared part.
The intersection of {a,b} and {b,c} is the singleton {b}.
Inverse function
An inverse function reverses a bijection, assigning each codomain element the unique domain element that originally produced it.
The inverse function of x↦2x+5 on the reals is y↦(y−5)/2.
Invertible function
An invertible function has an inverse on its full codomain, which requires both unique preimages and a preimage for every target.
Squaring becomes an invertible function when its domain and codomain are both restricted to nonnegative reals.

L

Linearity
Linearity of summation permits added expressions to be separated into sums and constant factors to be moved outside a sum.
Linearity rewrites ∑(3aj+bj) as 3∑aj+∑bj over matching index ranges.

M

Membership table
A membership table lists every combination of belonging or not belonging to the original sets and evaluates set expressions row by row.
A membership table for three sets has eight rows, allowing two expression columns to be compared fully.

O

One-to-one correspondence
A one-to-one correspondence is a bijective pairing between sets that matches every element on each side with exactly one on the other.
The map n↦n+1 gives a one-to-one correspondence from ℕ to ℤ+.
Ordered pair
An ordered pair is a two-entry object whose positions matter; equality requires its first and second coordinates to agree separately.
The ordered pair (2,7) differs from (7,2) even though the same numbers occur.

P

Partial function
A partial function assigns at most one output to each allowed input but may leave some inputs without a defined value.
Division on all real inputs gives a partial function when its zero-divisor input is left undefined.
Power set
The power set of a set is the collection of all its subsets, including the empty subset and the original set itself.
The power set of {r,s} has four elements, each of which is a subset of {r,s}.
Preimage
The preimage of a target subset is the set of all allowed inputs whose outputs lie in that subset, whether or not an inverse function exists.
The preimage of {25} under integer squaring is {−5,5}.
Product notation
Product notation uses a capital pi to multiply indexed terms over a stated range, with an empty product assigned value 1.
Product notation expresses factorial as n!=∏j=1nj, including 0!=1.
Proper subset
A proper subset is a subset different from its containing set, so at least one element of the larger set is absent from it.
The set {a} is a proper subset of {a,b} because it lacks b.

R

Range
The range of a function is the set of values it actually takes over all allowed inputs, forming a subset of its codomain.
The range of real squaring is [0,∞) even if the declared codomain is all real numbers.
Recurrence relation
A recurrence relation specifies terms through earlier terms, requiring initial conditions to select the sequence it describes.
The recurrence relation an=an−1+6 together with a0=1 gives 1,7,13,….
Roster notation
Roster notation describes a set by listing its elements inside braces, with an ellipsis permitted when a pattern is clear.
The roster notation {2,4,6,…,20} lists the positive even integers up to 20.

S

Schröder–Bernstein theorem
The Schröder–Bernstein theorem states that injections in both directions between two sets guarantee a bijection and therefore equal cardinality.
The Schröder–Bernstein theorem compares open and half-open intervals using inclusion and scaling injections.
Sequence
A sequence is a function on consecutive integer indices, with each term value assigned to a specified position and repetitions allowed.
The sequence an=2n for n≥0 begins 0,2,4,6,….
Set
A set is an unordered collection of distinct objects, so changing their listing order or repeating an object does not change the collection.
The set {2,5,2} equals {5,2} because each contains the same two numbers.
Set difference
A set difference keeps elements of the first set that do not belong to the second set, so exchanging the two sets can change the result.
The set difference {2,4,6}−{4,8} leaves {2,6}.
Set identity
A set identity is an equation between set expressions that holds for all sets allowed by its stated universe and conditions.
The equation A∪A=A is a set identity because repeating a set introduces no new members.
Set-builder notation
Set-builder notation describes all elements of a specified set that satisfy a given property, using a vertical bar or colon for “such that.”
The set-builder notation {n∈ℤ∣n2=9} selects both −3 and 3.
Strictly increasing function
A strictly increasing function gives a larger output whenever its input increases, preventing distinct inputs from having equal values.
The cube map on the reals is a strictly increasing function and is therefore injective.
String
A string is a finite ordered sequence of symbols chosen from an alphabet, with its length equal to the number of symbol positions.
The string 1001 has length four over the binary alphabet, despite using only two different symbols.
Subset
A subset of a set is another set whose every element belongs to it; the two sets may be equal, and the empty set is always permitted.
The even integers form a subset of the integers because each even integer is an integer.
Summation index
A summation index is a local placeholder that runs through the allowed values in a sum, selecting each term to be added.
The summation index j takes the values 2, 3 and 4 in ∑j=24j2.
Surjective function
A surjective function reaches every element of its declared codomain, making its range equal to that entire target set.
Squaring is a surjective function from the reals to the nonnegative reals because every target has a square root.
Symmetric difference
The symmetric difference of two sets contains elements belonging to exactly one of them, excluding their shared elements.
The symmetric difference of {a,b} and {b,c} is {a,c}.

T

Telescoping sum
A telescoping sum has intermediate contributions that cancel in positive and negative pairs, leaving only uncanceled boundary terms.
The telescoping sum ∑k=1n(1/k−1/(k+1)) leaves 1−1/(n+1).
Tuple
A tuple is an ordered sequence of a specified number of entries, with repetitions allowed and each position carrying its own role.
The tuple (5,5,1) has three positions even though two of its entries have equal values.

U

Uncomputable function
An uncomputable function is a mathematical input-output assignment for which no program computes the required output for every allowed input.
Some binary-valued functions on the naturals are uncomputable functions because there are more of them than programs.
Uncountable set
An uncountable set is a set that is neither finite nor bijective with the natural numbers, so no sequence lists all its elements.
The real interval (0,1) is an uncountable set despite having finite geometric length.
Union
The union of sets consists of elements belonging to at least one of them, including elements shared by two or more of the sets.
The union of {1,3} and {3,5} is {1,3,5}, with the shared 3 included once.
Universal set
A universal set is the collection of all objects under consideration in a particular context, fixing the possible elements for complements.
Using the integers as the universal set makes 0 a member of the complement of ℤ+.

V

Vacuous truth
A vacuous truth is a universally quantified claim with no possible counterexample because no object satisfies its starting condition.
The inclusion ∅⊆A is a vacuous truth because there is no starting element to test.
Venn diagram
A Venn diagram represents sets as regions and displays the possible combinations of membership so operations can be shown by shading.
A two-set Venn diagram puts elements in the overlap when they belong to both sets.

About this lesson

By StudeliReport a mistake

Make your own Study Materials

Turn your notes, slides and documents into Study Guides, Practice Questions, Flashcards and 6 more tools.

Get Started