A Partial Function is a Function that is not defined for all Elements in its Input Set.
References
- (Wikipedia, 2009) http://en.wikipedia.org/wiki/Partial_function
- In mathematics, a partial function from X to Y is a function f: X' → Y, where X' is a subset of X. It generalizes the concept of a function by not forcing f to map every element of X to an element of Y (only some subset X^\prime \subseteq X). If X' = X, then f is called a total function and is equivalent to a function. Partial functions are often used when the exact domain, X' , is not known (e.g. many functions in computability theory).
- Specifically, we will say that for any x \in X, either:
- f(x) = y \in Y (it is defined as a single element in Y) or
- f(x) is undefined.
- For example we can consider the square root function restricted to the integers
- g: \mathbb{Z} \to \mathbb{Z}
- g(n) = \sqrt{n}
- Thus g(n) is only defined for n which are perfect squares (i.e. 0, 1, 4, 9, 16, ...). So, g(25) = 5, but g(26) is undefined.