lkarch.org/tools/mathisfun/www.mathsisfun.com/sets/domain-range-codomain.html
Lucas Kent e39465ad2f Changes to be committed:
new file:   Files/flashplayer_32_sa.exe
	new file:   favicon.ico
	new file:   globe.gif
	new file:   imgs/download.png
	new file:   imgs/zuck.jpg
	new file:   index.html
	new file:   other.ico
	new file:   script.js
	new file:   site.webmanifest
	new file:   sitemap.html
	new file:   styles/backround.css
	new file:   styles/border.css
	new file:   styles/fonts/Titillium_Web/OFL.txt
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-Black.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-Bold.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-BoldItalic.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-ExtraLight.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-ExtraLightItalic.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-Italic.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-Light.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-LightItalic.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-Regular.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-SemiBold.ttf
	new file:   styles/fonts/Titillium_Web/TitilliumWeb-SemiBoldItalic.ttf
	new file:   styles/fonts/webfontkit-20221027-163353/generator_config.txt
	new file:   styles/fonts/webfontkit-20221027-163353/specimen_files/grid_12-825-55-15.css
	new file:   styles/fonts/webfontkit-20221027-163353/specimen_files/specimen_stylesheet.css
	new file:   styles/fonts/webfontkit-20221027-163353/stylesheet.css
	new file:   styles/fonts/webfontkit-20221027-163353/titilliumweb-extralight-demo.html
	new file:   styles/fonts/webfontkit-20221027-163353/titilliumweb-extralight-webfont.woff
	new file:   styles/fonts/webfontkit-20221027-163353/titilliumweb-extralight-webfont.woff2
	new file:   styles/fonts/webfontkit-20221027-165950/generator_config.txt
	new file:   styles/fonts/webfontkit-20221027-165950/specimen_files/grid_12-825-55-15.css
	new file:   styles/fonts/webfontkit-20221027-165950/specimen_files/specimen_stylesheet.css
	new file:   styles/fonts/webfontkit-20221027-165950/stylesheet.css
	new file:   styles/fonts/webfontkit-20221027-165950/titilliumweb-bold-demo.html
	new file:   styles/fonts/webfontkit-20221027-165950/titilliumweb-bold-webfont.woff
	new file:   styles/fonts/webfontkit-20221027-165950/titilliumweb-bold-webfont.woff2
	new file:   styles/style.css
	new file:   tools/2048/.gitignore
	new file:   tools/2048/.jshintrc
	new file:   tools/2048/CONTRIBUTING.md
	new file:   tools/2048/LICENSE.txt
	new file:   tools/2048/README.md
	new file:   tools/2048/Rakefile
	new file:   tools/2048/favicon.ico
	new file:   tools/2048/index.html
	new file:   tools/2048/js/animframe_polyfill.js
	new file:   tools/2048/js/application.js
	new file:   tools/2048/js/bind_polyfill.js
	new file:   tools/2048/js/classlist_polyfill.js
	new file:   tools/2048/js/game_manager.js
	new file:   tools/2048/js/grid.js
	new file:   tools/2048/js/html_actuator.js
	new file:   tools/2048/js/keyboard_input_manager.js
	new file:   tools/2048/js/local_storage_manager.js
	new file:   tools/2048/js/tile.js
    new file:   tools/2048/meta/apple-touch-icon.png
	new file:   tools/webretro/cores/neocd_libretro.js
	new file:   tools/webretro/cores/neocd_libretro.wasm
	new file:   tools/webretro/cores/nestopia_libretro.js
	new file:   tools/webretro/cores/nestopia_libretro.wasm
	new file:   tools/webretro/cores/o2em_libretro.js
	new file:   tools/webretro/cores/o2em_libretro.wasm
	new file:   tools/webretro/cores/opera_libretro.js
	new file:   tools/webretro/cores/opera_libretro.wasm
2022-11-02 08:40:01 -04:00

253 lines
14 KiB
HTML

<!doctype html>
<html lang="en"><!-- #BeginTemplate "/Templates/Advanced.dwt" --><!-- DW6 -->
<!-- Mirrored from www.mathsisfun.com/sets/domain-range-codomain.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 29 Oct 2022 00:58:58 GMT -->
<head>
<!-- #BeginEditable "doctitle" -->
<title>Domain, Range and Codomain</title>
<meta name="description" content="Learn about the differences between Domain, Range and Codomain. In its simplest form the domain is all the values that go into a function ... " />
<!-- #EndEditable -->
<meta name="keywords" content="math, maths, mathematics, school, homework, education" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width; initial-scale=1.0; user-scalable=true;" />
<meta name="HandheldFriendly" content="true"/>
<meta http-equiv="pics-label" content='(PICS-1.1 "http://www.classify.org/safesurf/" L gen true for "http://www.mathsisfun.com" r (SS~~000 1))' />
<meta name="referrer" content="always">
<link rel="stylesheet" type="text/css" href="../style3.css" />
<script src="../main3.js" type="text/javascript"></script>
</head>
<body id="bodybg" class="adv">
<div class="bg">
<div id="stt"></div>
<div id="hdr"></div>
<div id="logo"><a href="../index.html"><img src="../images/style/logo.svg" alt="Math is Fun" /></a></div>
<div id="advText">Advanced</div>
<div id="gtran"><script type="text/javascript">document.write(getTrans());</script></div>
<div id="gplus"><script type="text/javascript">document.write(getGPlus());</script></div>
<div id="adTopOuter" class="centerfull noprint">
<div id="adTop">
<script type="text/javascript">document.write(getAdTop());</script>
</div>
</div>
<div id="adHide">
<div id="showAds1"><a href="javascript:showAds()">Show Ads</a></div>
<div id="hideAds1"><a href="javascript:hideAds()">Hide Ads</a><br>
<a href="../about-ads.html">About Ads</a></div>
</div>
<div id="menuWide" class="menu">
<script type="text/javascript">document.write(getMenu(0));</script>
</div>
<div id="linkto">
<div id="linktort"><script type="text/javascript">document.write(getLinks());</script></div>
</div>
<div id="search" role="search"><script type="text/javascript">document.write(getSearch());</script></div>
<div id="menuSlim" class="menu">
<script type="text/javascript">document.write(getMenu(1));</script>
</div>
<div id="menuTiny" class="menu">
<script type="text/javascript">document.write(getMenu(2));</script>
</div>
<div id="extra"></div>
</div>
<div id="content" role="main"><!-- #BeginEditable "Body" -->
<h1 align="center">Domain, Range and Codomain</h1>
<p style="float:left; margin: 0 30px 5px 0;"><img src="images/range-domain-graph.svg" alt="doman and range graph" /></p>
<p>In its simplest form the domain is all the values that go into a function, and the range is all the values that come out.</p>
<p>But in fact they are very important in <b>defining</b> a function. Read on!</p>
<p align="center"><i>Please read &quot;<a href="function.html">What is a Function?</a>&quot; first ...</i></p>
<h2>Functions</h2>
<p class="larger">A function <i><b>relates</b></i> an input to an output:</p>
<div class="example">
<p style="float:left; margin: 0 10px 5px 0;"><img src="images/tree.jpg" width="172" height="148" alt="tree" /></p>
<p>Example: this tree grows 20 cm every year, so the height of the tree is <i><b>related</b></i> to its age using the function <i><b>h</b></i>:</p>
<p align="center"><b><i>h</i>(age) = age &times; 20</b></p>
<p>So, if the age is 10 years, the height is <i>h</i>(10) = 200 cm</p>
<p class="larger">Saying &quot;<b><i>h</i>(10) = 200</b>&quot; is like saying 10 is related to 200. Or 10 &rarr; 200</p>
</div>
<h2>Input and Output</h2>
<p>But not all values may work! </p>
<ul>
<li>The function may not work if we give it the wrong values (such as a negative age), </li>
<li>And knowing the values that can come out (such as always positive) can also help</li>
</ul>
<p>So we need to say all the values that <b>can go into</b> and <b>come out of</b> a function. </p>
<p>This is best done using<b> <a href="sets-introduction.html">Sets</a> ...</b></p>
<div class="simple">
<table width="86%" border="0" align="center">
<tr>
<td width="17%"><img src="images/various-reals.svg" alt="various real numbers" /> </td>
<td width="83%" valign="middle">
<h3>A set is a collection of things, such as numbers. </h3>
<p>Here are some examples:</p>
<div class="indent50px">Set of even numbers: {..., -4, -2, 0, 2, 4, ...}
<br /> Set of odd numbers: {..., -3, -1, 1, 3, ...}
<br /> Set of prime numbers: {2, 3, 5, 7, 11, 13, 17, ...}
<br /> Positive multiples of 3 that are less than 10: {3, 6, 9}</div>
</td>
</tr>
</table>
</div>
<p>In fact, a function is defined in terms of sets:</p>
<table border="0" align="center">
<tr>
<td align="center">
<h2>Formal Definition of a Function</h2>
<h3>A function relates each element of a set<br />
with exactly one element of another
set<br />
(possibly the same set).</h3> </td>
<td align="center"><img src="images/function-sets.svg" alt="function sets X to Y" /></td>
</tr>
</table>
<h2>Domain, Codomain and Range</h2>
<p>There are special names for <b>what can go into</b>, and <b>what can come out</b> of a function:</p>
<table width="92%" border="0" align="center">
<tr>
<td width="60"><img src="../images/style/yes.svg" height="46" class="in" alt="yes" /></td>
<td>What can go <b>into</b> a function is called the <b>Domain</b></td>
</tr>
<tr>
<td width="60"><img src="../images/style/yes.svg" alt="yes" height="46" class="in" /></td>
<td>What <b>may possibly come out</b> of a function is called the <b>Codomain</b></td>
</tr>
<tr>
<td width="60"><img src="../images/style/yes.svg" alt="yes" height="46" class="in" /></td>
<td>What <b>actually comes out</b> of a function is called the <b>Range</b></td>
</tr>
</table>
<div class="example">
<p style="float:right; margin: 0 0 5px 10px;"><img src="images/domain-range-codomain.svg" alt="Domain, Range and Codomain for x to 2x+1" /></p>
<h3>Example </h3>
<p>&bull; The set &quot;A&quot; is the <b>Domain</b>, </p>
<p>&bull; The set &quot;B&quot; is the <b>Codomain</b>, </p>
<p>&bull; And the set of elements that get pointed to in B (the actual values produced by the function) are the <b>Range</b>, also called the Image. </p>
<p>And we have:</p>
<ul>
<li>Domain: {1, 2, 3, 4}</li>
<li>Codomain: {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}</li>
<li>Range: {3, 5, 7, 9}</li>
</ul>
</div>
<h2>Part of the Function</h2>
<p>Now, what comes <b>out</b> <i>(the Range)</i> depends on what we put <b>in</b> <i>(the Domain)</i> ...</p>
<p align="center" class="larger"> ... but <b>WE</b> can define the Domain!</p>
<p>In fact the Domain is an essential part of the function. Change the Domain and we have a different function.</p>
<div class="example">
<p>Example: a simple function like f(x) = x<sup>2</sup> can have the <b>domain</b> (what goes in) of just the counting numbers {1,2,3,...}, and the <b>range</b> will then be the set {1,4,9,...}</p>
<p align="center"><img src="images/range-domain.svg" alt="Domain to Range f(x) = x^2" /></p>
<p>And another function g(x) = x<sup>2</sup> can have the domain of integers {...,-3,-2,-1,0,1,2,3,...}, in which case the range is the set {0,1,4,9,...}</p>
<p align="center"><img src="images/range-domain2.svg" alt="Domain to Range g(x) = x^2" /></p>
</div>
<table width="90%" border="0" align="center">
<tr>
<td width="10%"><img src="../images/style/run.jpg" width="50" height="50" class="in" alt="run" /></td>
<td width="90%">
<p>Even though both functions take the input and square it, they have a <b>different set of inputs</b>, and so give a different set of outputs. </p>
<p>In this case the range of g(x) also includes 0.</p>
</td>
</tr>
<tr>
<td width="10%">&nbsp;</td>
<td width="90%">&nbsp;</td>
</tr>
<tr>
<td width="10%"><img src="../images/style/pencil-paper.gif" width="39" height="35" alt="pencil paper" /></td>
<td width="90%">
<p>Also they will have different properties.</p>
<p>For example f(x) always gives a unique answer, but g(x) can give the same answer with two different inputs (such as <b>g(-2)=4</b>, and also <b>g(2)=4</b>)</p>
</td>
</tr>
</table>
<p>So, the domain is an essential part of the function. </p>
<h2>Does Every Function Have a Domain?</h2>
<p>Yes, but in simpler mathematics we never notice this, because the domain is <b><i>assumed</i></b>:</p>
<ul>
<li>Usually it is assumed to be something like &quot;all numbers that will work&quot;. </li>
<li>Or if we are studying whole numbers, the domain is assumed to be whole numbers. </li>
<li>etc.</li>
</ul>
<p>But in more advanced work we need to be more careful!</p>
<h2>Codomain vs Range</h2>
<p>The Codomain and Range are both on the output side, but are subtly different.</p>
<p>The Codomain is the set of values that could <b>possibly</b> come out. The Codomain is actually <b>part of the definition</b> of the function. </p>
<p>And The Range is the set of values that <b>actually do</b> come out.</p>
<div class="example">
<p>Example: we can define a function <i><b>f(x)=2x</b></i> with a domain and codomain of integers (because we say so). </p>
<p>But by thinking about it we can see that the range (actual output values) is just the <b>even</b> integers.</p>
<p>So the codomain is integers (we defined it that way), but the range is even integers.</p>
</div>
<p>The Range is a subset of the Codomain.</p>
<p><b>Why both?</b> Well, sometimes we don't know the <i><b>exact</b></i> range (because the function may be complicated or not fully known), but we know the set it <i><b>lies in</b></i> (such as integers or reals). So we define the codomain and continue on.</p>
<h2>The Importance of Codomain</h2>
<p>Let me ask you a question: Is <b><i><a href="../algebra/square-root.html">square root</a></i> </b> a function?</p>
<p>If we say the codomain (the possible outputs) is <b>the set of real numbers</b>, then square root is <b>not a function</b>! ... is that a surprise? </p>
<p>The reason is that there could be two answers for one input, for example <b><i>f(9) = 3 </i></b>or<b><i> -3</i></b></p>
<div class="def">
<p>A <a href="function.html">function</a> must be <i><b>single valued</b></i>. It cannot give back 2 or more results for the same input. So &quot;f(9) = 3 <b>or</b> -3&quot; is not right! </p>
</div>
<p>But it can be fixed by simply <b>limiting the codomain</b> to non-negative real numbers.</p>
<div class="def">
<p><span class="huge">&radic;</span>In fact, the radical symbol (like <b>&radic;x</b>) always means the principal (positive) square root, so <b>&radic;x</b> is a function because its codomain is correct.</p>
</div>
<p>So, <b>what we choose for the codomain </b>can actually affect whether something is a <b>function or not.</b> </p>
<p>&nbsp;</p>
<h2>Notation</h2>
<p>Mathematicians don't like writing lots of words when a few symbols will do. So there are ways of saying &quot;the domain is&quot;, &quot;the codomain is&quot;, etc.</p>
<p>This is the neatest way I know:</p>
<table width="90%" border="0" align="center">
<tr>
<td width="29%">
<div align="center"><img src="images/f-n-n.png" width="84" height="20" alt="f : N to N" /></div>
</td>
<td width="71%">
<p>this says that the function &quot;<i><b>f</b></i>&quot; has a domain of &quot;<b>N</b>&quot; (the <a href="../whole-numbers.html">natural numbers</a>), and a codomain of &quot;<b>N</b>&quot; also.</p>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td width="29%">
<div align="center"><img src="images/f-x-x2.png" width="97" height="25" alt="f : x to x^2" />
<br /> <i>or</i>
<br /> <img src="images/f-x-x2b.png" alt="f(x)=x^2" width="82" height="23" /> </div>
</td>
<td width="71%">
<p>and either of these say that the function &quot;f&quot; takes in &quot;x&quot; and returns &quot;x<sup>2</sup>&quot;</p>
</td>
</tr>
</table>
<p>There is also:</p>
<p align="center"><span class="larger">Dom(f)</span> or <span class="larger">Dom f</span> meaning &quot;the domain of the function f&quot;</p>
<p align="center"><span class="larger">Ran(f)</span> or <span class="larger">Ran f</span> meaning &quot;the range of the function f&quot;</p>
<h2>How to Specify Domains and Ranges</h2>
<p>Learn how to specify Domains and Ranges at <a href="set-builder-notation.html">Set Builder Notation</a>.</p>
<p>&nbsp;</p>
<div class="questions">
<script type="text/javascript">
getQ(536, 537, 538, 539, 1174, 1175, 1176, 2341, 2342, 2343);
</script>&nbsp; </div>
<div class="related"> <a href="function.html">What is a Function?</a> <a href="injective-surjective-bijective.html">Injective, Surjective and Bijective</a> <a href="sets-introduction.html">Introduction to Sets</a> <a href="index.html">Sets Index</a> </div>
<!-- #EndEditable --></div>
<div id="adend" class="centerfull noprint">
<script type="text/javascript">document.write(getAdEnd());</script>
</div>
<div id="footer" class="centerfull noprint">
<script type="text/javascript">document.write(getFooter());</script>
</div>
<div id="copyrt">
Copyright &copy; 2018 MathsIsFun.com
</div>
<script type="text/javascript">document.write(getBodyEnd());</script>
</body>
<!-- #EndTemplate -->
<!-- Mirrored from www.mathsisfun.com/sets/domain-range-codomain.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 29 Oct 2022 00:58:59 GMT -->
</html>