Surjective Function in Automata Theory



What is a Surjective Function?

Consider there are two sets A and B, A is the domain and B is the codomain. A surjective function, also known as onto function, is a type of function where every element of the codomain (Set B) is mapped by at least one element from the domain (Set A).

In simple terms, a function is onto if all elements of Set B have a corresponding element in Set A.

What is a Surjective Function

Formally we can say a function f from Set A to Set B is said to be onto if each element of Set B is mapped by at least one element of Set A.

Note − In an Onto Function, no element of Set B is left out. Every element in Set B has a pre-image in Set A.

Visualizing Onto Function

Consider the following example to understand the concept better −

  • Set A contains the elements {1, 2, 3, 4}
  • Set B contains the elements {a, b, c, d}

We map the elements as shown in this figure −

Visualizing Onto Functions

In this case, each element of Set B (a, b, c) is mapped by some element of Set A, but d is not pre-image of any element in A. So, this is not an onto function.

Key Concepts: Image and Pre-Image

To fully understand onto functions, it's essential to get the concepts of image and pre-image.

  • The image of an element in Set A under the function f is the corresponding element in Set B. For example − If 1 maps to a, then a is the image of 1.
  • The pre-image is the element in Set A that maps to an element in Set B. For example − If a is the image of 1, then 1 is the pre-image of a.

Let's look at an example to understand the concept of Image and Pre-Image.

  • Set A = {1, 2, 3, 4}
  • Set B = {a, b, c, d}
Key Concepts: Image and Pre-Image

If we map as shown in the figure −

  • Image of 1 is a,
  • Pre-image of a is 1,
  • Pre-image of d is 4.

If every element in Set B has a pre-image, then the function is onto.

Criteria for Surjectivity

For a function to be surjective, it must satisfy this criteria −

  • Every element in Set B must have at least one pre-image in Set A.
  • No element in Set B should be left unmapped. If even one element in Set B does not have a pre-image in Set A, the function is not onto.

Necessary Condition: Size of Sets

If we are considering whether a function from Set A to Set B can be onto, the following condition must hold −

  • The number of elements in Set A must be greater than or equal to the number of elements in Set B.
  • This is a necessary condition, but it is not sufficient on its own. Even if Set A has more elements than Set B, we need to ensure that all elements in Set B are actually mapped by elements in Set A.

Example − If Set A has 4 elements and Set B has 3 elements, we might think the function could be onto. But if one element in Set B does not get mapped, then the function is not onto.

Example: Checking If a Function Is Onto

Let us see the previous image −

  • Set A = {1, 2, 3, 4}
  • Set B = {a, b, c, d}
Example: Checking If a Function Is Onto1

Then, this function is onto because every element of Set B has a pre-image in Set A. However, if we map −

Example: Checking If a Function Is Onto2

Then this function is not onto because d in Set B has no pre-image in Set A. According to the definition, this function fails to be onto.

Surjective Functions and Range

Let us see important characteristic of onto functions is the relationship between the range and the codomain.

Range and Codomain

For an onto function, the range is equal to the codomain. In other words, all elements in the codomain must be part of the range.

  • The range of a function is the set of all images of elements in Set A.
  • The codomain is the set B where the function maps elements from Set A.

Into Function: A Contrast

The into function is the opposite of onto function. In an into function

  • The range is a proper subset of the codomain.
  • Not all elements in the codomain are mapped by elements from the domain.

Example of Into Function

If we have, Set A = {1, 2, 3, 4} and Set B = {a, b, c, d} and map −

Example of Into Function

Then, d in Set B has no pre-image in Set A. The function is not onto but is an into function because the range (a, b, c) is a proper subset of the codomain (a, b, c, d).

Real-World Examples of Surjective Function

Take a look at the following real-world examples of surjective functions −

Example 1: Mathematical Function

Consider the function f(x) = 2x + 1 with domain and codomain as real numbers. For every real number y, there exists a corresponding real number x such that y = 2x + 1. Therefore, this function is onto.

Example 2: Non-Onto Function

Consider f(x) = 2x + 1 where the domain is the set of natural numbers, and the codomain is the set of real numbers. If we pick a real number like 0.5, there is no natural number x such that 2x + 1 equals 0.5. Therefore, this function is not onto.

Conclusion

In this chapter, we covered surjective functions, mainly focusing on their definition, key characteristics, and the difference between onto and into functions. We presented a set of examples to illustrate these concepts clearly. Proceed to the next chapter to learn the concept of bijective functions.

Advertisements