## Introduction

A **function** was originally the **idealization** of how a varying quantity depends on another quantity. In many cases, we assign a particular element of a second set( which might be the same as the first) to each element of a set.

**For Example**, suppose each student in a class is assigned a letter grade from set **S= { A, B, C, D, F}** and suppose the grades are **A** for **Alina,** **B** for **Ali**, **C **for **Rober**t , **D **for **Noman**, **F** for **Amanda** . This assignment of grades will be shown as follows

An example of a function is above assignment. In **mathematics** and **computer science,** the concept of a **function** is extremely important.In the definition of such **discrete structures** as sequences and strings, for example, **discrete math** functions are utilized.It also shows how long a computer takes to solve problems of a particular size. Many computer programs and subroutines have been designed to calculate function values.**Recursive functions**, which are **self- defined** functions, are used in computer science.

## Function Definition

A function

from a set X to a set Y is afbetween elements of X and elements of Y such thatrelationshipelement of X is related to aeachelement of Y, and is denoteduniquef: X →Y.

The set **X** is called the **domain of f **and

**Y**is called the

**co-domain of**

*f*.In many different ways, functions are **specified**. Sometimes we declare the tasks explicitly. We often provide a formula for defining a function, such as **f(x)= x+ 1**. We used another time to specify a function using a computer program.

## ARROW DIAGRAM OF A FUNCTION

The definition of one function involves the following two properties in the arrow diagram for a function f:

- An arrow comes out of every X element
- No two X elements have two arrows from which two distinct Y elements appear.

**Example:**

Let X = {a,b,c} and Y={1,2,3,4}.

**Define a function ****f**** from X to Y by the arrow diagram **

The above diagram easily fulfills the two requirements of the function, hence a function graph.

**Note that:**

f(a) = 2

f(b) = 4

f(c) = 2

## Functions and Non-Functions

Which of the arrow diagram describes functions from X={a, b, c} to Y={d, a, f, g}

The relation given in the diagram **(a)** is** Not a function** because there is no arrow coming out of 5∈X to any element of Y.

The relation in the diagram **(b)** is** Not a function**, because there are two arrows coming out of 4∈X. i.e.,4∈X is not related to a unique element of Y.

## Range of function

When “

range” is used to mean “codomain“, the image of a functionis already implicitly defined. It is (by definition of image) the subset of the “range” which equalsf{y| there exists anxin the domain offsuch thaty=f(x)}.

When“range” is used to mean “image“, the range of a functionis by definitionf{y| there exists anxin the domain offsuch thaty=f(x)}. In this case, the co-domain offmust not be specified, because any co-domain which contains this image as a subset will work. [Wikipedia]

In both cases, imagef⊆ rangef⊆ co-domainf, with at least one of the containment being equality.

**Note:**

- The function f range is always a subset of the co-domain of f.
- The range of f: X→Y is also called the image of X under f.
- When y = f(x), then x is called the pre-image of y.
- The set of all elements of X, that are related to some y ∈Y is called the inverse image of y.