Skip to main content

Discrete Mathematics - Functions


Function assigns to each element of a set, exactly one element of a related set. Functions find their application in various fields like representation of the computational complexity of algorithms, counting objects, study of sequences and strings, to name a few. The third and final chapter of this part highlights the important aspects of functions.

Function - Definition

A function or mapping (Defined as f:XY) is a relationship from elements of one set X to elements of another set Y (X and Y are non-empty sets). X is called Domain and Y is called Codomain of function ‘f’.
Function ‘f’ is a relation on X and Y such that for each xX, there exists a unique yY such that (x,y)R. ‘x’ is called pre-image and ‘y’ is called image of function f.
A function can be one to one or many to one but not one to many.

Injective / One-to-one function

A function f:AB is injective or one-to-one function if for every bB, there exists at most one aA such that f(s)=t.
This means a function f is injective if a1a2 implies f(a1)f(a2).

Example

  • f:NN,f(x)=5x is injective.
  • f:NN,f(x)=x2 is injective.
  • f:RR,f(x)=x2 is not injective as (x)2=x2

Surjective / Onto function

A function f:AB is surjective (onto) if the image of f equals its range. Equivalently, for every bB, there exists some aA such that f(a)=b. This means that for any y in B, there exists some x in A such that y=f(x).

Example

  • f:NN,f(x)=x+2 is surjective.
  • f:RR,f(x)=x2 is not surjective since we cannot find a real number whose square is negative.

Bijective / One-to-one Correspondent

A function f:AB is bijective or one-to-one correspondent if and only if f is both injective and surjective.

Problem

Prove that a function f:RR defined by f(x)=2x3 is a bijective function.
Explanation − We have to prove this function is both injective and surjective.
If f(x1)=f(x2), then 2x13=2x23 and it implies that x1=x2.
Hence, f is injective.
Here, 2x3=y
So, x=(y+5)/3 which belongs to R and f(x)=y.
Hence, f is surjective.
Since f is both surjective and injective, we can say f is bijective.

Inverse of a Function

The inverse of a one-to-one corresponding function f:AB, is the function g:BA, holding the following property −
f(x)=yg(y)=x
The function f is called invertible, if its inverse function g exists.

Example

  • A Function f:ZZ,f(x)=x+5, is invertible since it has the inverse function g:ZZ,g(x)=x5.
  • A Function f:ZZ,f(x)=x2 is not invertiable since this is not one-to-one as (x)2=x2.

Composition of Functions

Two functions f:AB and g:BC can be composed to give a composition gof. This is a function from A to C defined by (gof)(x)=g(f(x))

Example

Let f(x)=x+2 and g(x)=2x+1, find (fog)(x) and (gof)(x).

Solution

(fog)(x)=f(g(x))=f(2x+1)=2x+1+2=2x+3
(gof)(x)=g(f(x))=g(x+2)=2(x+2)+1=2x+5
Hence, (fog)(x)(gof)(x)

Some Facts about Composition

  • If f and g are one-to-one then the function (gof) is also one-to-one.
  • If f and g are onto then the function (gof) is also onto.
  • Composition always holds associative property but does not hold commutative property.

Comments

Popular posts from this blog

Discrete Mathematics - Rules of Inference

To deduce new statements from the statements whose truth that we already know,  Rules of Inference  are used. What are Rules of Inference for? Mathematical logic is often used for logical proofs. Proofs are valid arguments that determine the truth values of mathematical statements. An argument is a sequence of statements. The last statement is the conclusion and all its preceding statements are called premises (or hypothesis). The symbol “ ∴ ∴ ”, (read therefore) is placed before the conclusion. A valid argument is one where the conclusion follows from the truth values of the premises. Rules of Inference provide the templates or guidelines for constructing valid arguments from the statements that we already have. Table of Rules of Inference Rule of Inference Name Rule of Inference Name P ∴ P ∨ Q P ∴ P ∨ Q Addition P ∨ Q ¬ P ∴ Q P ∨ Q ¬ P ∴ Q Disjunctive Syllogism P Q ∴ P ∧ Q P Q ∴ P ∧ Q Conjunction P → Q Q → R ∴ P → R P → Q Q → R ∴ P → R Hypothet

5 best private search engines and why you need to use them.

5 best private search engines and why you need to use them  By:  Boniyeamin laju   ▪   May 31, 2019   ▪ 3 minute read 5 best private search engines and why you need to use  Normal browsers like Google and Bing are designed to track users’ activities and profile their online behavior. The primary reason for this is to create advertisements that will be attractive to the user. However, there-there is always the concern of  personal information being compromised  due to security breaches, state surveillance, and unauthorized data sharing. Fortunately,  private search engines  can help keep your private information safe. Simply put, Private Search Engines, also known as PSE, uses proxy and encrypted search request to  hide your personal information  from anyone looking to misuse your information. Below you will find more information about what a PSE is, how it works, and where to find the best private search engines on the internet

Discrete Mathematics - Propositional Logic

The rules of mathematical logic specify methods of reasoning mathematical statements. Greek philosopher, Aristotle, was the pioneer of logical reasoning. Logical reasoning provides the theoretical base for many areas of mathematics and consequently computer science. It has many practical applications in computer science like design of computing machines, artificial intelligence, definition of data structures for programming languages etc. Propositional Logic  is concerned with statements to which the truth values, “true” and “false”, can be assigned. The purpose is to analyze these statements either individually or in a composite manner. Prepositional Logic – Definition A proposition is a collection of declarative statements that has either a truth value "true” or a truth value "false". A propositional consists of propositional variables and connectives. We denote the propositional variables by capital letters (A, B, etc). The connectives connect the propositi