Domain and Codomain (#22535)

* Domain and Codomain

Brief explanation of Domain and Codomain along with an example

* fix: added front matter back to file
pull/23000/head^2
KevinMDuarte 2018-11-25 01:56:20 +01:00 committed by Randell Dawson
parent 9cea2d56a5
commit 8a0548acef
1 changed files with 22 additions and 1 deletions

View File

@ -1,12 +1,33 @@
---
title: Domain and Codomain
---
## Domain and Codomain
### Domain
The domain of a function defines what input values are valid for that specific function. Any value picked outside of that domain is undefined for that function
Example:
Have a look at the function f(x) = 1/x. Here x can be any real number, except for 0 since we would have 1 divided by 0 and we all know that division by zero is not allowed.
Sometimes, we define a subdomain for a function to limit the application of the function to only the desired cases. For example let's say we take the same function as above f(x) = 1/x, but we are only interested in the decreasing part of the function. In that case we would define our subdomain as only the positive numbers, 0 not included since 0 is not part of the domain.
### Codomain
Very similar to the domain, the codomain defines a range of valid results for a function. The codomain is in other words, the domain of all the images of a given function.
Example:
If we look at the function f(x) = 1/x , we can say that the codomain is the set of all the real numbers, except for 0 since there exists no input for this function that would output 0 as a result.
<!--
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/mathematics/functions/domain-and-codomain/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
-->
<!--
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
-->
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information: