Open In App

Cardinality of a Set

Last Updated : 08 Aug, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

A set is a collection of distinct objects, considered as a whole. These objects are called the elements or members of the set. For example, the set of natural numbers less than 5 can be written as {1, 2, 3, 4}.

The number of elements in the set or a measure of its size is known as the cardinality of a set

number_of_elements_present_in_a_set_4
Cardinality of Set
  • It can be finite or infinite.
  • It is denoted by: |A| or card(A)
  • For example, the set {1, 2, 3, 4, 5} has a cardinality of 5. 

Cardinality is a crucial concept in set theory and mathematics due to its broad applications and significance across various disciplines. Cardinality is important in various fields, including cryptocurrency and financial markets.

Examples of Cardinality of a Set

Some other examples include:

  • If A = {a, b, c, d, e}, then n(A) (or) |A| = 5
  • If P = {Sun, Mon, Tue, Wed, Thu, Fri, Sat}, then n(P) (or) |P| = 7

Cardinality of Different Sets

Some of the common sets with cardinality are:

Cardinality of a Finite Set

Cardinality of a finite set refers to the number of elements in the set. If a set S is finite, its cardinality is simply the count of distinct elements within the set.

The total number in the set is known as the cardinality of a power set.

For example: If A = {1, 2, 3, 4, 5}, then |A| = 5.

Cardinality of an Infinite Set

A set is countably infinite if its elements can be put into a one-to-one correspondence with the natural numbers N = {1, 2, 3, . . . }. This means that you can list the elements of the set in a sequence (even if the sequence goes on forever).

The cardinality of a countably infinite set is denoted by ℵ0.

Examples:

  • Natural Numbers: The set of natural numbers N={1, 2, 3, . . .} is countably infinite.
  • Integers: The set of integers Z={. . . ,−2, −1, 0, 1, 2, . . . } is countably infinite because you can list them in a sequence like 0, 1, −1, 2, −2, . . .
  • Rational Numbers: The set of rational numbers Q = {a/b ∣ a,b ∈ Z, b ≠ 0} is countably infinite, though it's less obvious. The rationals can be arranged in a sequence by arranging fractions by their sum of numerator and denominator.

Cardinality of a Countable Set

A set is countable if:

  • It is finite
  • It is infinite, but you can list its elements one by one (like 1st, 2nd, 3rd, …), meaning there's a bijection with natural numbers N.

If a set is countable and infinite, it is known as a countably infinite set. Examples include the sets of natural numbers (ℕ), integers (ℤ), and rational numbers (Q).

  • For a finite countable set, its cardinality is simply the number of elements it contains.
  • However, for an infinite countable set, its cardinality is the same as that of the natural numbers.

Cardinality of an Uncountable Set

A set is uncountable if:

  • It is infinite, and
  • Its elements cannot be listed (not even in an infinite list like a1, a2, a3.

If a set is uncountable, it is infinite and its elements cannot be listed in sequence; it is called an uncountably infinite set.

  • For an uncountable set, its elements cannot be listed in a sequence.
  • The cardinality of an uncountable set is greater than that of the natural numbers.

Cardinality of a Power Set

Power Set of a set S is the set of all possible subsets of S, including the empty set and S itself.

If a set A has n elements, then the cardinality of its power set is equal to 2n, which is the number of subsets of the set A.

If a set S has n elements, the power set P(S) will have 2n elements. This is because each element in S can either be included in or excluded from a subset, leading to 2n possible subsets.

For any finite set S with n elements: ∣P(S)∣ = 2n

Consider the set S = {a, b}.

Subsets of S are:

  • {} (the empty set)
  • {a}
  • {b}
  • {a, b}

The power set P(S) is {{}, {a}, {b}, {a, b}}

Since S has 2 elements, the cardinality of the power set P(S) is 22 = 4.

Cardinality of Cartesian Products

The Cartesian product of two sets A and B, denoted by A × B, is the set of all ordered pairs (a, b) where a ∈ A and b ∈ B.

The cardinality of the Cartesian product A x B is the total number of ordered pairs formed from A and B. It is given by:

| A x B | =| A | x | B |

  • Where |A| and |B| are cardinalities of sets A and B.

Finite Set Example: If A = {1, 2} and B = {x, y, z}, then A × B = {(1, x), (1, y), (1, z), (2, x), (2, y), (2, z)}, so ∣A × B∣ = 6.

Infinte Set Example: If A = {1, 2,3,4,........} and B = {10,20,30,........}, then |A × B| = {(1, 10), (1, 20), (1, 30),...........,(2, 10), (2, 20), (2, 30)}.

  • If A and B are two disjoint sets, then

n(A U B) = n(A) + n (B).

  • For any two sets A and B,

n (A U B) = n(A) + n (B) - n (A ∩ B).

This is popularly known as the "inclusion-exclusion principle".

  • For any three sets A, B, and C,

n(A U B U C) = n (A) + n(B) + n(C) - n(A ∩ B) - n(B ∩ C) - n(C ∩ A) + n (A ∩ B ∩ C).

Applications of Cardinality in Computer Science

Some of the common applications of cardinality are:

  • Cardinality is used in database management to optimize queries by determining the number of unique records in a dataset.
  • Cardinality is used in designing and optimizing databases.
  • Cardinality is used to compare the size of input sets and the complexity of algorithms.
  • Cardinality plays a crucial role in cryptography, especially in the design of cryptographic keys.

Solved Questions on Cardinality of a Set

Question 1: Let A={1, 2, 3, 4, 5}. What is the cardinality of set A?

Solution:

The cardinality of set A is the number of elements in the set, i.e., ∣A∣=5

Question 2: Given two sets B = {a, b, c} and C = {d, e, f, g}, what is the cardinality of the union B∪C?

Solution:

B∪C = {a, b, c, d, e, f, g}

The cardinality of B∪C is i.e., ∣B∪C∣ = 7

Question 3: Let D = {2, 4, 6} and E = {1, 2, 3, 4, 5, 6}. Find the cardinality of D∩E.

Solution:

D∩E = {2, 4, 6}

The cardinality of D∩E is:

∣D∩E∣=3

Question 4: Consider the set F = {x ∣ x is an integer and −3 ≤ x ≤ 3}. What is the cardinality of set F?

Solution:

F = {−3, −2, −1, 0, 1, 2, 3}

The cardinality of F is ∣F∣ = 7

Question 5: Let G = {Monday, Tuesday, Wednesday,  Thursday, Friday, Saturday, Sunday}. Find the cardinality of set G.

Solution:

The cardinality of set G is:

∣G∣=7

Question 6: Suppose H = {} is an empty set. What is the cardinality of set H?

Solution:

The cardinality of the empty set is always zero i.e., ∣H∣=0

Practice Questions on Cardinality of a Set

Problem: For each Question below, determine the cardinality of the given set.

Question 1: I = {10, 20, 30, 40}.

Question 2: J = {a, b, c, d, e}.

Question 3: K = {x ∣ x is an even number between 1 and 10}.

Question 4: L = {z ∣ z is a vowel in the English alphabet}.

Question 5: M = {n ∣ n is a prime number less than 10}.

Question 6: N = {r, s, t, u, v, w, x, y, z}.

Question 7: O = {p ∣ p is a positive integer less than 4}.

Question 8: P = {}.

Question 9: Q = {1, 1, 2, 2, 3, 3}.

Question 10: R = {y ∣ y is an integer and −2 ≤ y ≤ 2}.

Answer key

1: ∣I∣ = 4
2: ∣J∣ = 5
3: ∣K∣ = 4
4: ∣L∣ = 5
5: ∣M∣ = 4 (Prime numbers less than 10 are 2, 3, 5, 7)
6: ∣N∣ = 9
7: ∣O∣ = 3 (Positive integers less than 4 are 1, 2, 3)
8: ∣P∣ = 0 (Empty set)
9: ∣Q∣ = 3 (Unique elements are 1, 2, 3)
10: ∣R∣ = 5 (Set includes integers -2, -1, 0, 1, 2)


Similar Reads