+ The Oktave Forum » Technical » Science and Mathematics » Optimization Theory (Moderator: sanket)
|-+ Calculus: Function
Username:
Password:

Pages: [1]
Topic Tools  
Read August 14, 2008, 11:49:36 pm #0
sanket

Calculus: Function

A function (map, transformation) can be seen as a black box that produces exactly one output for every input that it takes. In other words, it maps a value (called the argument) from an input set to a single value in the output set. The set of inputs over which the function is defined (i.e. the set of values for which the the function produces an output) is called the domain of the function. The set of outputs that the function produces is called the range (or image)of the function.

It is important to note that a function always returns a unique value. Now, there are some operations that produce more than one output. For example, the square root function produces 2 outputs for every input. So, in case we want to define a 'function' for such operations, we have to define them such that they produce a single output for every input. In this particular case, we define the square root function in terms of the absolute value of the output (another function). (We'll have more to say about both these functions when we talk about piecewise functions.)

Now, there is another thing called the codomain of the function which is a little more involved. Actually, the domain and the codomain occur as part of the function's definition. They are the source and destination. For example, we can have a function such as f: R --> R, which means f maps values from the domain of real numbers to the codomain of real numbers. However, the range itself depends on what f is. The range is a subset of the codomain. Let's say f = x^2. Here, the codomain is real numbers, but the range is only positive real numbers.

Depending on how a function covers the domain and codomain, there are different kinds of them. When the range is the same as the codomain, i.e. when every value in the codomain is a possible output value of at least one input argument to the function, the function is called a surjective function or an onto function. When a function maps a distinct argument to a distinct value, it's called an injection or an one to one function (the function need not cover the whole codomain). When a function is both injective and surjective, it's called a bijective function.

One would like a hash function to be injective, so that hash collision does not happen. (Hash collision is when more than one input argument corresponds to the same output value.)
Offline  
Read August 15, 2008, 03:17:00 am #1
sri

Re: Calculus: Function

It is important to note that a function always returns a unique value. Now, there are some operations that produce more than one output. For example, the square root function produces 2 outputs for every input. So, in case we want to define a 'function' for such operations, we have to define them such that they produce a single output for every input. In this particular case, we define the square root function in terms of the absolute value of the output (another function). (We'll have more to say about both these functions when we talk about piecewise functions.)

There is another way to represent this. Think of the square root as a function not as R+ -> R+, but as a function from R+ -> R+ x R-. Here R+ is the set of all positive real numbers and R- is the set of all negative real numbers. The output of the function is a single ordered pair belonging to R+ x R-, and then sqrt has all the same characteristics as any other function.
Offline  
Pages: [1]
Jump to: