I'm still confused on what a partial function is.

If I have a domain and codomain of integers from $-10^6$ to $10^6$, what are some partial functions that work with this domain and codomain? What are some that don't?

I know for example that $x^2$ is not a function within these restrictions because if I put in $10^6$, I get $10^{12}$ out, which is out of my interval.

If someone could describe in layman's terms some partial functions and what makes them partial that would be very helpful.


The fact that the square of $10^6$ lays outside the co-domain actually makes $x^2$ a fine example of a partial function: apparently we cannot define the function value for all of the objects in the domain, and thus the function is a partial function.

For an alternative example, take $f(x)=x+1$ which will be defined for all numbers in the domain except for $10^6$, for which the function is undefined. This function is therefore also a partial function.

  • $\begingroup$ Okay so I'm working on a programming assignment that does this. I am inputting into a function all integer values from the domain of x. If I get a number back that is outside the codomain, the function is still a partial function? So it doesn't matter what I get as output? Or does at least one of the outputs have to be defined for the whole function to be a partial function? $\endgroup$ – Coder117 May 1 '17 at 1:27
  • $\begingroup$ The only valid outputs of a function are those in the codomain. If you would get an output outside that codomain, then it means you do not have a valid output for the function, therefore the function does not have an output for one of its inputs, and is therefore partial. $\endgroup$ – ConMan May 1 '17 at 1:30
  • $\begingroup$ So if all the outputs I get are not in the codomain, is the function still partial? $\endgroup$ – Coder117 May 1 '17 at 1:48
  • $\begingroup$ @Coder117 You never get an output that is not in the codomain. So, for my example of $f(x)=x+1$, $f(10^6)$ is not defined, i.e. There is no output in that case ... Which is exactly what makes it a partial function. $\endgroup$ – Bram28 May 1 '17 at 1:58
  • $\begingroup$ I understand what you are saying, but is it possible to have a function where no matter what I put in for x, I never get an output that fits within my codomain? If so, is that function a partial function? Or not at all? For example is f(x) = x + 10^12 + 1 a partial function even though when I put in my lower bound of my domain f(-10^6) I still get out 10^6 + 1 which is not in my codomain? $\endgroup$ – Coder117 May 1 '17 at 2:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.