∑ MockTestKart
⌂

0 0 0
Complete Formula Lesson

Sets, Relations & Functions: Mastering Union, Intersection, Cartesian Products, and Composition

This lesson covers the core formulas for two-set problems, including inclusion-exclusion, finding neither, intersection from totals, Cartesian product sizes, and function composition. You will learn derivations, worked examples, and common traps to solve problems confidently.

On this page
  1. Inclusion-Exclusion Principle for Two Sets
  2. Finding Elements in Neither Set
  3. Rearranged Form: Finding the Intersection
  4. Intersection of Two Sets
  5. Cardinality of a Cartesian Product
  6. Intersection of A×B and B×A
  7. Function Composition
  8. Universal Set and Complement
  9. Worked examples
  10. Common mistakes
  11. Frequently asked questions

Sets, relations, and functions form the language of modern mathematics. In competitive exams, questions often involve counting elements in unions, intersections, or Cartesian products, and evaluating composite functions. This lesson builds from the inclusion-exclusion principle to advanced applications like |(A×B) ∩ (B×A)| = |A∩B|². Each formula is derived, explained, and applied to fully worked examples. By the end, you will know when to use each formula, how to rearrange them, and how to avoid typical mistakes.

Key Formulas for Two Sets
Unionn(A∪B) = n(A) + n(B) - n(A∩B)
Neithern(neither) = Total - n(A∪B)
Intersection from Totaln(A∩B) = n(A) + n(B) + n(neither) - Total
Cartesian Product Size|A×B| = |A| × |B|
Intersection of Products|(A×B) ∩ (B×A)| = |A∩B|²
ConceptFormulaWhen to Use
Union of two setsn(A∪B) = n(A)+n(B)-n(A∩B)Given sizes of A, B, and intersection
Neither in two setsn(neither) = Total - n(A∪B)Given total and union, or all individual counts
Intersection from totaln(A∩B) = n(A)+n(B)+n(neither)-TotalGiven total, n(A), n(B), and n(neither)
Cartesian product size|A×B| = |A|×|B|Counting ordered pairs from two finite sets
Intersection of products|(A×B)∩(B×A)| = |A∩B|²Finding common ordered pairs between A×B and B×A
1Identify the sets and their given sizes.
2Determine which formula connects the knowns and unknowns.
3Substitute values and solve algebraically.
4Check that the result is non-negative and within bounds.
5For function composition, evaluate inner function first.

Inclusion-Exclusion Principle for Two Sets

The inclusion-exclusion principle corrects for double-counting when adding the sizes of two sets. If you simply add n(A) and n(B), elements in both sets are counted twice. Subtracting n(A∩B) once gives the correct number in the union. This formula is the foundation for all two-set word problems. It applies to any finite sets A and B within a universal set. The variables are counts (non-negative integers). The formula is symmetric in A and B, so order does not matter.

  • Use when you know the sizes of A, B, and their intersection, and need the union.
  • The intersection can be empty, making n(A∪B) = n(A) + n(B).
  • Always ensure counts are consistent with the universal set size.
n(A∪B) = n(A) + n(B) - n(A∩B)

Finding Elements in Neither Set

In a universal set U, the number of elements that belong to neither A nor B is the total number of elements minus the number in the union. This is because every element either belongs to A∪B or does not. The formula combines the total count with inclusion-exclusion. It is useful when the problem gives total population and asks for those outside both categories. The result must be non-negative and cannot exceed the total.

  • Total = n(A∪B) + n(neither A nor B).
  • Substitute n(A∪B) from inclusion-exclusion to get the expanded form.
  • Check that n(neither) is not negative; if it is, the given data is inconsistent.
n(neither A nor B) = Total - [n(A) + n(B) - n(A∩B)]

Rearranged Form: Finding the Intersection

When the total, the sizes of A and B, and the number in neither are known, you can solve for the intersection. Starting from Total = n(A∪B) + n(neither) and substituting n(A∪B) = n(A)+n(B)-n(A∩B), rearrange to isolate n(A∩B). This form is handy for survey problems where the overlap is unknown. It is algebraically equivalent to the inclusion-exclusion principle. Always verify that the computed intersection does not exceed the smaller of n(A) and n(B).

  • Use when total, n(A), n(B), and n(neither) are given.
  • The formula is n(A∩B) = n(A) + n(B) + n(neither) - Total.
  • If the result is negative, the data is inconsistent.
n(A∩B) = n(A) + n(B) + n(neither) - Total

Intersection of Two Sets

The intersection A∩B contains exactly the elements that are in both A and B. It is a set, not a number, but its size n(A∩B) is often needed. The definition is straightforward: x ∈ A∩B if and only if x ∈ A and x ∈ B. This concept is used in all two-set counting formulas. When sets are given in roster form, list common elements. When given as conditions, solve the conditions simultaneously.

  • A∩B = {x : x ∈ A and x ∈ B}.
  • If A and B are disjoint, A∩B = ∅ and n(A∩B)=0.
  • The intersection is commutative: A∩B = B∩A.
A ∩ B = {x : x ∈ A and x ∈ B}

Cardinality of a Cartesian Product

The Cartesian product A×B is the set of all ordered pairs (a,b) where a ∈ A and b ∈ B. For finite sets, the number of such pairs is the product of the sizes of A and B. This is because for each of the |A| choices of the first coordinate, there are |B| choices for the second. The formula is simple but powerful, and it extends to more than two sets. It is used in combinatorics and probability.

  • |A×B| = |A| × |B|.
  • Order matters: A×B and B×A are different unless A=B.
  • If either set is empty, the product has 0 elements.
|A × B| = |A| × |B|

Intersection of A×B and B×A

The intersection (A×B) ∩ (B×A) consists of ordered pairs (x,y) such that (x,y) ∈ A×B and (x,y) ∈ B×A. This requires x ∈ A and y ∈ B, and also x ∈ B and y ∈ A. Therefore, both x and y must belong to A∩B. So the intersection is exactly (A∩B) × (A∩B). Its cardinality is |A∩B|². This formula is useful in advanced set theory problems.

  • |(A×B) ∩ (B×A)| = |A∩B|².
  • The result is always a perfect square.
  • If A and B are disjoint, the intersection is empty.
|(A×B) ∩ (B×A)| = |A ∩ B|²

Function Composition

Given two functions f and g, the composite function f(g(x)) means apply g first, then apply f to the result. The domain of f(g(x)) consists of all x in the domain of g such that g(x) is in the domain of f. For polynomial functions, the domain is usually all real numbers. To evaluate, substitute the expression for g(x) into f. This is not the same as g(f(x)) in general; composition is not commutative.

  • f(g(x)) is read as 'f of g of x'.
  • Evaluate from the inside out: first g(x), then f of that result.
  • f(g(x)) ≠ g(f(x)) in most cases.
f(g(x)) = f applied to g(x)

Universal Set and Complement

The universal set U contains all elements under consideration. The complement of a set A, denoted A', is the set of elements in U that are not in A. For two sets, (A∪B)' is the set of elements in U that are in neither A nor B. This connects to the 'neither' count: n((A∪B)') = n(neither A nor B). When U is finite, n(A') = n(U) - n(A). This is used in problems like finding (A∪B)' from roster sets.

  • A' = {x ∈ U : x ∉ A}.
  • (A∪B)' = A' ∩ B' (De Morgan's Law).
  • n((A∪B)') = Total - n(A∪B).
n(A') = n(U) - n(A)

Worked examples

In a group of 100 people, 60 like tea, 50 like coffee, and 30 like both. How many people like neither tea nor coffee?
Show solution

Let T = tea, C = coffee. n(T)=60, n(C)=50, n(T∩C)=30. Total=100.

First find n(T∪C) = 60+50-30 = 80. Then n(neither) = Total - n(T∪C) = 100 - 80 = 20.

20
In a class of 60 students, 40 like cricket, 30 like football, and 10 like neither. How many students like both cricket and football?
Show solution

Let C = cricket, F = football. n(C)=40, n(F)=30, n(neither)=10, Total=60.

Use n(C∩F) = n(C)+n(F)+n(neither)-Total = 40+30+10-60 = 20.

20
If U = {1,2,3,...,10}, A = {1,3,5,7,9}, and B = {2,3,5,7}, what is (A ∪ B)'?
Show solution

First find A∪B = {1,2,3,5,7,9}. Then (A∪B)' = U \ (A∪B) = {4,6,8,10}.

{4,6,8,10}
If A = {1,2,3}, B = {2,3,4}, then the number of elements in (A×B) ∩ (B×A) is:
Show solution

A∩B = {2,3}, so |A∩B| = 2. Then |(A×B) ∩ (B×A)| = |A∩B|² = 2² = 4.

4
In a class of 40 students, 25 play cricket and 20 play football, and 10 play both. How many play neither game?
Show solution

n(C)=25, n(F)=20, n(C∩F)=10. n(C∪F)=25+20-10=35. n(neither)=40-35=5.

5
If A = {1,2,3} and B = {2,3,4}, what is the number of elements in A × B?
Show solution

|A|=3, |B|=3. |A×B| = 3×3 = 9.

9
If f(x) = 2x + 3 and g(x) = x², what is the value of f(g(2))?
Show solution

First compute g(2) = 2² = 4. Then f(g(2)) = f(4) = 2(4)+3 = 8+3 = 11.

11
In a class of 80 students, 50 passed in Mathematics, 40 passed in Science, and 30 passed in both. How many students failed in both subjects?
Show solution

n(M)=50, n(S)=40, n(M∩S)=30. n(M∪S)=50+40-30=60. Failed both = Total - n(M∪S) = 80-60=20.

20

Common mistakes

  • Forgetting to subtract the intersection when finding the union, leading to double-counting.
  • Mixing up the formula for 'neither' with the formula for 'intersection' when rearranging.
  • Assuming that |A×B| = |A| + |B| instead of the product.
  • Evaluating f(g(x)) as g(f(x)) or applying f first instead of g first.
  • Ignoring the universal set when finding complements, leading to incorrect elements.
  • Using the formula for two sets when there are three sets, which requires a different inclusion-exclusion expansion.

Frequently asked questions

What is the inclusion-exclusion principle for two sets?

It states that n(A∪B) = n(A) + n(B) - n(A∩B). This corrects for double-counting elements that are in both sets. It is used whenever you need the total number of elements in at least one of two sets.

How do I find the number of elements in neither set?

Subtract the union from the total: n(neither) = Total - n(A∪B). If you don't know the union, first compute it using inclusion-exclusion. The result must be between 0 and the total.

Can I find the intersection if I know the total, n(A), n(B), and n(neither)?

Yes, use n(A∩B) = n(A) + n(B) + n(neither) - Total. This is derived by combining Total = n(A∪B) + n(neither) with the inclusion-exclusion formula. Always check that the intersection is not larger than the smaller set.

What is the formula for the number of elements in A×B?

For finite sets, |A×B| = |A| × |B|. This is because each element of A can be paired with each element of B. The order matters, so A×B and B×A are different sets unless A=B.

How do I compute |(A×B) ∩ (B×A)|?

It equals |A∩B|². The intersection consists of ordered pairs (x,y) where both x and y are in A∩B. So the number of such pairs is the square of the number of common elements.

What is f(g(2)) if f(x)=2x+3 and g(x)=x²?

First compute g(2)=2²=4. Then f(g(2))=f(4)=2(4)+3=11. Always evaluate the inner function first. Composition is not commutative, so f(g(x)) is generally not equal to g(f(x)).