Countable Set

Last Updated : 20 Aug, 2025

A countable set is one that has the same cardinality (size) as the set of natural numbers, which is denoted by N (or often expressed as 0, 1, 2, 3,... in set theory).

A set is countable if its elements have a one-to-one mapping with natural numbers.

In the theory of computation and mathematics, a given set S is called countable if and only if either of the following two conditions holds:

S is finite.
OR
There exists a bijection or one-to-one correspondence between the elements of set S and the set of all natural numbers N. In other words, the cardinality of set S is the same as the cardinality of N.

Methods to Determine Countability of a Set

To prove whether the given set is countable or not, we have two methods, such as:

  • Using Formal Definition
  • Using Alternate Definition

Using Formal Definition

This is the most formal method to prove whether a given set is countable or not. Follow the steps mentioned below:

  • If the given set is finite, that means it is already countable by definition.
  • If the given set is infinite, then try to create a one-to-one function between the given set and the set of all natural numbers, N.

Example

For example lets take the set of binary strings of finite length. The set of binary strings of finite length simply means all the finite length strings over the alphabet Σ = {0, 1} or in other words Σ*. In this article we are going to prove that Σ* is countable.

The given set is infinite. So according to the definition we have to create a one-to-one function between Σ* and N. Let's define a function between Σ* and N.

w is a finite length binary string such that, w ∈ Σ*
length of w = n

f(w) = 1 n=0
f(w) = 2ⁿ + decimal_representation(w)

f(w) is a one-to-one function from Σ* → N, because,

  • For every two distinct w1, w2 ∈ Σ* we have a different value of f(w). That means f(w) is injective.
  • For every natural number x ∈ N, we have some w ∈ Σ* for which f(w) = x. That means f(w) is surjective.

Let us consider the following diagrammatic representation:

Countable-Set-method-1-(1)

f(w) : Σ* → N

Using an Alternate Definition

Now, as you can see from the first proof, it is not always easy to come up with a one-to-one function from a given set S to N. So now we are going to use a more informal and easier alternative definition to prove a given set is countable or not.

Alternate Definition: A given set S is countable if and only if for all n ∈ N, we can assign an empty or non-empty finite subset of S such that every element of S is covered at least once in the entire mapping.

Example :

Let's take the same example of the set of binary strings of finite length as before and see how much easier our lives have become this time.

All we have to do is assign a finite subset of Σ* to each n ∈ N, such that all the elements of Σ* is covered at least once.

To each n ∈ N we are going to assign the subset of Σ* that consists of the strings of length n. There are exactly 2ⁿ strings of length n. Which is finite.

  • 1 → {λ, 0, 1} empty string and all the strings of length 1, We are taking the empty string with 1 as it was being left out.
  • 2 → {00, 01, 10, 11} All the strings of length 2
  • 3 → {000, 001, 010, 011, 100, 101, 110, 111} All the strings of length 3
  • n → All the strings of length n

In this way we will be able to cover all the elements of Σ* at least once. Therefore Σ* is finite.

Countable-Set-method-2
Comment

Explore