What's the difference between a partial function and a relation?

1k Views Asked by At

My understanding of a partial function is that it is one which only maps a subset of some set $A$ to another set $B$ (where $B$ could be $A$). On the Wikipedia page, the below image is given as an example of an injective partial function (from $X$ to $Y$).

example partial function

This just looks to me like a plain relation, $\{(2, d), (3, c)\}$. What is particular about a partial function that differentiates it from a regular relation? When would you use each term?

1

There are 1 best solutions below

1
On BEST ANSWER

A partial function is like a function except that it is allowed to not assign an output on some inputs.

Given sets $A$ and $B$, a partial function $f:A\to B$ is a relation $f\subseteq A\times B$, where we write $f(x)=y$ instead of $a \; f \; y$, satisfying:

$\forall x\in A$,$y,y' \in B \;\;\; f(x)=y \land f(x)=y' \implies y=y'$.

In other words, the value that a partial function associates to any given input $x\in A$ is uniquely determined by $x$, but the partial function may also not associate anything with $x$.

In yet other words, a partial function $f:A\to B$ is the same thing as a subset $A'\subseteq A$ and an ordinary function $f':A'\to B$.