Cardinality of a Set (original) (raw)

Last Updated : 8 Aug, 2025

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

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:

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:

Cardinality of a Countable Set

A set is countable if:

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).

Cardinality of an Uncountable Set

A set is uncountable if:

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

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 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 |

**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)}.

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

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

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

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:

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)