Onto and one-to-one functions

Onto and one-to-one are both terms used to describe functions in mathematics. An onto function (also called a surjective function) is a function in which every element in the range is mapped to by at least one element in the domain. In other words, for every element y in the range, there exists at least…