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
710 lines
29 KiB
HTML
710 lines
29 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en"><!-- #BeginTemplate "/Templates/Main.dwt" --><!-- DW6 -->
|
||
|
||
<!-- Mirrored from www.mathsisfun.com/sets/function.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 29 Oct 2022 00:48:48 GMT -->
|
||
<head>
|
||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||
|
||
<!-- #BeginEditable "doctitle" -->
|
||
<title>What is a Function</title>
|
||
<style type="text/css">
|
||
<!--
|
||
.style1 {font-weight: bold}
|
||
-->
|
||
</style><!-- #EndEditable -->
|
||
<meta name="keywords" content="math, maths, mathematics, school, homework, education">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
|
||
<meta name="HandheldFriendly" content="true">
|
||
<meta name="referrer" content="always">
|
||
<link rel="preload" href="../images/style/font-champ-bold.ttf" as="font" type="font/ttf" crossorigin="">
|
||
<link rel="preload" href="../style4.css" as="style">
|
||
<link rel="preload" href="../main4.js" as="script">
|
||
<link rel="stylesheet" href="../style4.css">
|
||
<script src="../main4.js" defer="defer"></script>
|
||
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||
<script async="" src="https://www.googletagmanager.com/gtag/js?id=UA-29771508-1"></script>
|
||
<script>
|
||
window.dataLayer = window.dataLayer || [];
|
||
function gtag(){dataLayer.push(arguments);}
|
||
gtag('js', new Date());
|
||
gtag('config', 'UA-29771508-1');
|
||
</script>
|
||
</head>
|
||
|
||
<body id="bodybg">
|
||
|
||
<div id="stt"></div>
|
||
<div id="adTop"></div>
|
||
<header>
|
||
<div id="hdr"></div>
|
||
<div id="tran"></div>
|
||
<div id="adHide"></div>
|
||
<div id="cookOK"></div>
|
||
</header>
|
||
|
||
<div class="mid">
|
||
|
||
<nav>
|
||
<div id="menuWide" class="menu"></div>
|
||
<div id="logo"><a href="../index.html"><img src="../images/style/logo.svg" alt="Math is Fun"></a></div>
|
||
|
||
<div id="search" role="search"></div>
|
||
<div id="linkto"></div>
|
||
|
||
<div id="menuSlim" class="menu"></div>
|
||
<div id="menuTiny" class="menu"></div>
|
||
</nav>
|
||
|
||
<div id="extra"></div>
|
||
|
||
<article id="content" role="main">
|
||
|
||
<!-- #BeginEditable "Body" -->
|
||
|
||
|
||
<h1 class="center">What is a Function?</h1>
|
||
|
||
<p class="center"><span class="larger">A function relates an input to an output.</span></p>
|
||
<p style="float:left; margin: 0 10px 5px 0;"><img src="images/function-cogs.svg" alt="function cogs" height="137" width="200"></p>
|
||
<p><br></p>
|
||
<p>It is like a machine that has an input and an output.</p>
|
||
<p>And the output is related somehow to the input.</p>
|
||
<div style="clear:both">
|
||
</div>
|
||
<div class="simple">
|
||
|
||
<table style="border: 0; margin:auto;">
|
||
<tbody>
|
||
<tr>
|
||
<td class="huge"> f(x) </td>
|
||
<td>
|
||
<p>"<b>f(x) = ...</b> " is the classic way of writing a function.<br>
|
||
And there are other ways, as you will see!</p> </td>
|
||
</tr>
|
||
</tbody></table>
|
||
</div>
|
||
|
||
|
||
<h2>Input, Relationship, Output</h2>
|
||
|
||
<p>We will see many ways to think about functions, but there are always three main parts:</p>
|
||
<ul>
|
||
<li>The input</li>
|
||
<li>The relationship</li>
|
||
<li>The output</li>
|
||
</ul>
|
||
|
||
<div class="example">
|
||
|
||
<h3>Example: "Multiply by 2" is a very simple function.</h3>
|
||
<p>Here are the three parts:</p>
|
||
<div class="center">
|
||
|
||
<table align="center" cellpadding="5" border="1">
|
||
<tbody>
|
||
<tr>
|
||
<th align="center">Input</th>
|
||
<th align="center"><b><i>Relationship</i></b></th>
|
||
<th align="center">Output</th>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align:center;">0</td>
|
||
<td style="text-align:center;">× 2</td>
|
||
<td style="text-align:center;">0</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align:center;">1</td>
|
||
<td style="text-align:center;">× 2</td>
|
||
<td style="text-align:center;">2</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align:center;">7</td>
|
||
<td style="text-align:center;">× 2</td>
|
||
<td style="text-align:center;">14</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align:center;">10</td>
|
||
<td style="text-align:center;">× 2</td>
|
||
<td style="text-align:center;">20</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align:center;">...</td>
|
||
<td style="text-align:center;">...</td>
|
||
<td style="text-align:center;">...</td>
|
||
</tr>
|
||
</tbody></table>
|
||
</div>
|
||
<p>For an input of 50, what is the output?</p>
|
||
</div>
|
||
|
||
|
||
<h2>Some Examples of Functions</h2>
|
||
|
||
<ul>
|
||
<div class="bigul">
|
||
<li><b>x<sup>2</sup></b> (squaring) is a function</li>
|
||
<li><b>x<sup>3</sup>+1</b> is also a function</li>
|
||
<li><a href="../sine-cosine-tangent.html">Sine, Cosine and Tangent</a> are functions used in trigonometry</li>
|
||
<li>and there are lots more!</li>
|
||
</div>
|
||
</ul>
|
||
<p>But we are not going to look at specific functions ...<br>
|
||
<span class="indent50px">... instead we will look at the <b>general idea</b> of a function.</span></p>
|
||
|
||
|
||
<h2>Names</h2>
|
||
|
||
<p>First, it is useful to give a function a <b>name</b>.</p>
|
||
<p>The most common name is "<i><b>f</b></i>", but we can have other names like "<i><b>g</b></i>" ... or even "<i><b>marmalade</b></i>" if we want.</p>
|
||
<p>But let's use "f":</p>
|
||
<p class="center"><img src="images/function-fx-x2.svg" alt="f(x) = x^2" height="92" width="381"></p>
|
||
<p class="center larger">We say <i>"f of x equals x squared"</i></p>
|
||
<p>what goes <b>into</b> the function is put inside parentheses () after the name of the function:</p>
|
||
<p class="center larger">So <b><i>f(x)</i></b> shows us the function is called "<b><i>f</i></b>", and "<b><i>x</i></b>" goes <b>in</b></p>
|
||
<p>And we usually see what a function does with the input:</p>
|
||
<p class="center larger"><b><i>f(x) = x<sup>2</sup></i></b> shows us that function "<i><b>f</b></i>" takes "<i><b>x</b></i>" and squares it.</p>
|
||
<p class="center"> </p>
|
||
|
||
<div class="example">
|
||
<p>Example: with <b>f(x) = x<sup>2</sup></b>:</p>
|
||
<ul>
|
||
<li>an input of 4</li>
|
||
<li>becomes an output of 16.</li>
|
||
</ul>
|
||
<p class="center">In fact we can write<b> f(4) = 16</b>.</p>
|
||
</div>
|
||
<p> </p>
|
||
|
||
|
||
<h2>The "x" is Just a Place-Holder!</h2>
|
||
|
||
<p>Don't get too concerned about "x", it is just there to show us where the input goes and what happens to it.</p>
|
||
<p>It could be anything!</p>
|
||
<div class="center80">
|
||
<p>So this function:</p>
|
||
<p class="center larger">f(x) = 1 - x + x<sup>2</sup></p>
|
||
<p>Is the same function as:</p>
|
||
<ul>
|
||
<li>f(q) = 1 - q + q<sup>2</sup></li>
|
||
<li>h(A) = 1 - A + A<sup>2</sup></li>
|
||
<li>w(θ) = 1 - θ + θ<sup>2</sup></li>
|
||
</ul>
|
||
<p>The variable (x, q, A, etc) is just there so we know where to put the values:</p>
|
||
<p class="center"><span class="larger">f(<b>2</b>) = 1 - <b>2</b> + <b>2</b><sup>2</sup> = 3</span></p>
|
||
</div>
|
||
<p> </p>
|
||
|
||
|
||
<h2>Sometimes There is No Function Name</h2>
|
||
|
||
<p>Sometimes a function has no name, and we see something like:</p>
|
||
<p class="center larger">y = x<sup>2</sup></p>
|
||
<p>But there is still:</p>
|
||
<ul>
|
||
<li>an input (x)</li>
|
||
<li>a relationship (squaring)</li>
|
||
<li>and an output (y)</li>
|
||
</ul>
|
||
|
||
|
||
<h2>Relating</h2>
|
||
|
||
<p>At the top we said that a function was <b>like</b> a machine. But a function doesn't really have belts or cogs or any moving parts - and it doesn't actually destroy what we put into it!</p>
|
||
<p class="center larger">A function <i><b>relates</b></i> an input to an output.</p>
|
||
<p>Saying "<b>f(4) = 16</b>" is like saying 4 is somehow related to 16. Or 4 → 16</p>
|
||
|
||
<div class="example">
|
||
<p style="float:left; margin: 0 10px 5px 0;"><img src="images/tree.jpg" alt="tree" height="148" width="172"></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 class="center"><b><i>h</i>(age) = age × 20</b></p>
|
||
<p>So, if the age is 10 years, the height is:</p>
|
||
<p class="center"><span class="style1"><i>h</i>(10) = 10 × 20 = 200 cm</span></p>
|
||
<p>Here are some example values:</p>
|
||
<div class="center">
|
||
|
||
<table align="center" cellpadding="5" border="1">
|
||
<tbody>
|
||
<tr>
|
||
<th align="center">age</th>
|
||
<th align="center"><b><i>h</i>(age) = age × 20</b></th>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align:center;">0</td>
|
||
<td style="text-align:center;">0</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align:center;">1</td>
|
||
<td style="text-align:center;">20</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align:center;">3.2</td>
|
||
<td style="text-align:center;">64</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align:center;">15</td>
|
||
<td style="text-align:center;">300</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align:center;">...</td>
|
||
<td style="text-align:center;">...</td>
|
||
</tr>
|
||
</tbody></table>
|
||
</div>
|
||
</div>
|
||
<p> </p>
|
||
|
||
|
||
<h2>What Types of Things Do Functions Process?</h2>
|
||
|
||
<div class="indent50px">
|
||
<p class="larger"><i>"Numbers"</i> seems an obvious answer, but ...</p>
|
||
</div>
|
||
|
||
<table align="center" width="90%" border="0">
|
||
<tbody>
|
||
<tr>
|
||
<td width="11%" valign="top"><br>
|
||
</td>
|
||
<td width="89%">
|
||
<p>... <b>which</b> numbers?</p>
|
||
<p>For example, the tree-height function <b><i>h</i>(age) = age×20</b> makes no sense for an age less than zero.</p></td>
|
||
</tr>
|
||
<tr>
|
||
<td width="11%"><br>
|
||
</td>
|
||
<td width="89%"> ... it could also be letters ("A"→"B"), or ID codes ("A6309"→"Pass") or stranger things. </td>
|
||
</tr>
|
||
</tbody></table>
|
||
<p>So we need something <b>more powerful</b>, and that is where <a href="sets-introduction.html">sets</a> come in:</p>
|
||
<div class="simple">
|
||
|
||
<table style="border: 0; margin:auto;">
|
||
<tbody>
|
||
<tr>
|
||
<td><img src="images/various-reals.svg" alt="various real numbers" height="61" width="115"></td>
|
||
<td valign="middle">
|
||
|
||
<h3>A set is a collection of things.</h3>
|
||
<p>Here are some examples:</p>
|
||
<div class="indent50px">
|
||
<ul>
|
||
<li>Set of even numbers: {..., -4, -2, 0, 2, 4, ...}</li>
|
||
<li>Set of clothes: {"hat","shirt",...}</li>
|
||
<li>Set of prime numbers: {2, 3, 5, 7, 11, 13, 17, ...}</li>
|
||
<li>Positive multiples of 3 that are less than 10: {3, 6, 9}</li>
|
||
</ul>
|
||
</div> </td>
|
||
</tr>
|
||
</tbody></table>
|
||
</div>
|
||
<p>Each individual <b>thing in the set</b> (such as "4" or "hat") is called a <b>member</b>, or <b>element</b>.</p>
|
||
<p>So, a function takes <b>elements of a set</b>, and gives back <b>elements of a set</b>.</p>
|
||
|
||
|
||
<h2>A Function is Special</h2>
|
||
|
||
<p>But a function has <b>special rules</b>:</p>
|
||
<ul>
|
||
<li>It must work for <b>every</b> possible input value</li>
|
||
<li>And it has only <b>one relationship</b> for each input value</li>
|
||
</ul>
|
||
<p>This can be said in one definition:</p>
|
||
<div class="def">
|
||
<p style="float:left; margin: 0 10px 5px 0;"><img src="images/function-sets.svg" alt="function sets X to Y" height="157" width="253"></p>
|
||
|
||
<h3 class="center">Formal Definition of a Function</h3>
|
||
<p class="center larger">A function relates <b>each element</b> of a set<br>
|
||
with <b>exactly one</b> element of another
|
||
set<br>
|
||
(possibly the same set).</p>
|
||
</div>
|
||
<p> </p>
|
||
|
||
|
||
<h2>The Two Important Things!</h2>
|
||
|
||
<table style="border: 0; margin:auto;">
|
||
<tbody>
|
||
<tr>
|
||
<td align="center" width="50" valign="top">
|
||
<p class="larger">1.</p></td>
|
||
<td style="width:550px;">
|
||
<p><span class="larger">"...each element..."</span> means that every element in <b>X</b> is related to some element in <b>Y</b>.</p>
|
||
<p>We say that the function <i><b>covers</b></i> <b>X</b> (relates every element of it).</p>
|
||
<p>(But some elements of <b>Y</b> might not be related to at all, which is fine.)</p></td>
|
||
</tr>
|
||
</tbody></table>
|
||
|
||
<table style="border: 0; margin:auto;">
|
||
<tbody>
|
||
<tr>
|
||
<td align="center" width="50" valign="top">
|
||
<p class="larger">2.</p></td>
|
||
<td style="width:550px;">
|
||
<p><span class="larger">"...exactly one..."</span> means that a function is <i><b>single valued</b></i>. It will not give back 2 or more results for the same input.</p>
|
||
<p class="center large">So "f(2) = 7 <b>or</b> 9" is not right!</p></td>
|
||
</tr>
|
||
</tbody></table>
|
||
|
||
<table style="border: 0; margin:auto;">
|
||
<tbody>
|
||
<tr style="text-align:center;">
|
||
<td colspan="3">
|
||
<p>"One-to-many" is <b>not</b> allowed, but "many-to-one" <b>is</b> allowed:</p></td>
|
||
</tr>
|
||
<tr style="text-align:center;">
|
||
<td><img src="images/function-sets-1-2.gif" alt="function" height="119" width="175"></td>
|
||
<td style="width:40px;"> </td>
|
||
<td><img src="images/function-sets-2-1.gif" alt="function" height="126" width="203"></td>
|
||
</tr>
|
||
<tr style="text-align:center;">
|
||
<td>(one-to-many)</td>
|
||
<td> </td>
|
||
<td>(many-to-one)</td>
|
||
</tr>
|
||
<tr style="text-align:center;">
|
||
<td>This is <b>NOT</b> OK in a function</td>
|
||
<td style="width:40px;"> </td>
|
||
<td>But this <b>is</b> OK in a function</td>
|
||
</tr>
|
||
</tbody></table>
|
||
<p>When a relationship does <b>not</b> follow those two rules then it is <b>not a function</b> ... it is still a <b>relationship</b>, just not a function.</p>
|
||
|
||
<div class="example">
|
||
|
||
<h3>Example: The relationship x → x<sup>2</sup></h3>
|
||
<p class="center"><img src="images/function-sets-x2.svg" alt="function " height="157" width="253"></p>
|
||
<p class="center">Could also be written as a table:</p>
|
||
<div class="center">
|
||
|
||
<table align="center" border="1">
|
||
<tbody>
|
||
<tr>
|
||
<th align="center" width="70">X: x</th>
|
||
<th align="center" width="70">Y: x<sup>2</sup></th>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align:center;">3</td>
|
||
<td style="text-align:center;">9</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align:center;">1</td>
|
||
<td style="text-align:center;">1</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align:center;">0</td>
|
||
<td style="text-align:center;">0</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align:center;">4</td>
|
||
<td style="text-align:center;">16</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align:center;">-4</td>
|
||
<td style="text-align:center;">16</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align:center;">...</td>
|
||
<td style="text-align:center;">...</td>
|
||
</tr>
|
||
</tbody></table> </div><br>
|
||
<p><b>It is a function</b>, because:</p>
|
||
<ul>
|
||
<li>Every element in X is related to Y</li>
|
||
<li>No element in X has two or more relationships</li>
|
||
</ul>
|
||
<p>So it follows the rules.</p>
|
||
<p>(Notice how both <b>4</b> and <b>-4</b> relate to <b>16</b>, which is allowed.)</p>
|
||
</div>
|
||
|
||
<div class="example">
|
||
|
||
<h3>Example: This relationship is <b>not</b> a function:</h3>
|
||
<p class="center"><img src="images/relation-not-function.svg" alt="function " height="157" width="253"></p>
|
||
<p>It is a <b>relationship</b>, but it is <b>not a function</b>, for these reasons:</p>
|
||
<ul>
|
||
<li>Value "3" in X has no relation in Y</li>
|
||
<li>Value "4" in X has no relation in Y</li>
|
||
<li>Value "5" is related to more than one value in Y</li>
|
||
</ul>
|
||
<p>(But the fact that "6" in Y has no relationship does not matter)</p>
|
||
</div>
|
||
<p> </p>
|
||
<p style="float:left; margin: 0 30px 5px 0;"><img src="images/vertical-line-test.svg" alt="function not single valued" height="177" width="230"></p>
|
||
|
||
|
||
<h2>Vertical Line Test</h2>
|
||
|
||
<p>On a graph, the idea of <b>single valued</b> means that no vertical line ever crosses more than one value.</p>
|
||
<p>If it <b>crosses more than once</b> it is still a valid curve, but is <b>not a function</b>.</p>
|
||
<p class="center80">Some types of functions have stricter rules, to find out more you can read <a href="injective-surjective-bijective.html">Injective, Surjective and Bijective</a></p>
|
||
|
||
|
||
<h2>Infinitely Many</h2>
|
||
|
||
<p>My examples have just a few values, but functions usually work on sets with infinitely many elements.</p>
|
||
|
||
<div class="example">
|
||
|
||
<h3>Example: y = x<sup>3</sup></h3>
|
||
<ul>
|
||
<li>The input set "X" is all <a href="../numbers/real-numbers.html">Real Numbers</a></li>
|
||
<li>The output set "Y" is also all the Real Numbers</li>
|
||
</ul>
|
||
<p>We can't show ALL the values, so here are just a few examples:</p>
|
||
|
||
<table align="center" border="1">
|
||
<tbody>
|
||
<tr>
|
||
<th align="center" width="90">X: x</th>
|
||
<th align="center" width="90">Y: x<sup>3</sup></th>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align:center; width:90px;">-2</td>
|
||
<td style="text-align:center; width:90px;">-8</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align:center; width:90px;">-0.1</td>
|
||
<td style="text-align:center; width:90px;">-0.001</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align:center; width:90px;">0</td>
|
||
<td style="text-align:center; width:90px;">0</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align:center; width:90px;">1.1</td>
|
||
<td style="text-align:center; width:90px;">1.331</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align:center; width:90px;">3</td>
|
||
<td style="text-align:center; width:90px;">27</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align:center; width:90px;">and so on...</td>
|
||
<td style="text-align:center; width:90px;">and so on...</td>
|
||
</tr>
|
||
</tbody></table>
|
||
<p> </p>
|
||
</div>
|
||
|
||
|
||
<h2>Domain, Codomain and Range</h2>
|
||
|
||
<p>In our examples above</p>
|
||
<ul>
|
||
<li>the set "X" is called the <b>Domain</b>,</li>
|
||
<li>the set "Y" is called the <b>Codomain</b>, and</li>
|
||
<li>the set of elements that get pointed to in Y (the actual values produced by the function) is called the <b>Range</b>.</li>
|
||
</ul>
|
||
<p>We have a special page on <a href="domain-range-codomain.html">Domain, Range and Codomain</a> if you want to know more.</p>
|
||
|
||
|
||
<h2>So Many Names!</h2>
|
||
|
||
<p>Functions have been used in mathematics for a very long time, and lots of different names and ways of writing functions have come about.</p>
|
||
<p>Here are some common terms you should get familiar with:</p>
|
||
<p class="center"><img src="images/function-parts.svg" alt="Function Parts" height="245" width="579"></p>
|
||
|
||
<div class="example">
|
||
|
||
<h3>Example: <b>z = 2u<sup>3</sup></b>:</h3>
|
||
<ul>
|
||
<li>"u" could be called the "independent variable"</li>
|
||
<li>"z" could be called the "dependent variable" (it <b>depends on</b> the value of u)</li>
|
||
</ul>
|
||
</div>
|
||
|
||
<div class="example">
|
||
|
||
<h3>Example: <b>f(4) = 16</b>:</h3>
|
||
<ul>
|
||
<li>"4" could be called the "argument"</li>
|
||
<li>"16" could be called the "value of the function"</li>
|
||
</ul>
|
||
</div>
|
||
|
||
<div class="example">
|
||
|
||
<h3>Example: <b>h(year) = 20 × year</b>:</h3>
|
||
<p class="center"><img src="images/parameter.svg" alt="eq" height="180" width="395"></p>
|
||
<ul>
|
||
<li>h() is the function</li>
|
||
<li>"year" could be called the "argument", or the "variable"</li></ul>
|
||
<p class="words"><i>For <b>software </b>"year" is called the parameter, and the value given to the parameter is called the variable!</i></p>
|
||
<ul>
|
||
|
||
</ul>
|
||
</div>
|
||
<p>We often call a function "f(x)" when in fact the function is really "f"</p>
|
||
|
||
|
||
<h2>Ordered Pairs</h2>
|
||
|
||
<p>And here is another way to think about functions:</p>
|
||
<p class="center larger">Write the input and output of a function as an "ordered pair", such as (4,16).</p>
|
||
<p>They are called <b>ordered</b> pairs because the input always comes first, and the output second:</p>
|
||
<p class="center"><span class="larger">(input, output)</span></p>
|
||
<p>So it looks like this:</p>
|
||
<p class="center"><span class="larger">( <b>x</b>, <b>f(x)</b> )</span></p>
|
||
|
||
<div class="example">
|
||
<p>Example:</p>
|
||
<p class="center"><b>(4,16)</b> means that the function takes in "4" and gives out "16"</p>
|
||
</div>
|
||
|
||
<h3>Set of Ordered Pairs</h3>
|
||
<p>A function can then be defined as a <b>set</b> of ordered pairs:</p>
|
||
|
||
<div class="example">
|
||
<p>Example: <b>{(2,4), (3,5), (7,3)}</b> is a function that says</p>
|
||
<p class="center">"2 is related to 4", "3 is related to 5" and "7 is related 3".</p>
|
||
<p>Also, notice that:</p>
|
||
<ul>
|
||
<li>the domain is <b>{2,3,7}</b> (the input values)</li>
|
||
<li>and the range is <b>{4,5,3}</b> (the output values)</li>
|
||
</ul>
|
||
</div>
|
||
<p>But the function has to be <b>single valued</b>, so we also say</p>
|
||
<p class="center larger">"if it contains (a, b) and (a, c), then b must equal c"</p>
|
||
<p>Which is just a way of saying that an input of "a" cannot produce two different results.</p>
|
||
|
||
<div class="example">
|
||
<p>Example: {(<b>2</b>,<b>4</b>), (<b>2</b>,<b>5</b>), (7,3)} is <b>not</b> a function because {2,4} and {2,5} means that 2 could be related to 4 <b>or</b> 5.</p>
|
||
<p>In other words it is not a function because it is <b>not single valued</b></p>
|
||
</div>
|
||
|
||
<h3> </h3>
|
||
<p style="float:left; margin: 0 10px 5px 0;"><a href="../data/cartesian-coordinates-interactive.html"><img src="../data/images/interactive-cartesian-coordinates.gif" alt="interactive-cartesian-coordinates" height="150" width="150"></a></p>
|
||
|
||
<h3>A Benefit of Ordered Pairs</h3>
|
||
<p>We can graph them...</p>
|
||
<p>... because they are also <a href="../data/cartesian-coordinates.html">coordinates</a>!</p>
|
||
<p>So a set of coordinates is also a function (if they follow
|
||
the rules above, that is)</p>
|
||
<p> </p>
|
||
|
||
|
||
<h2>A Function Can be in Pieces</h2>
|
||
|
||
<p>We can create functions that behave differently depending on the input value</p>
|
||
|
||
<div class="example">
|
||
|
||
<h3>Example: A function with two pieces:</h3>
|
||
<ul>
|
||
<li>when x is less than 0, it gives 5,</li>
|
||
<li>when x is 0 or more it gives x<sup>2</sup></li>
|
||
</ul>
|
||
<div class="center">
|
||
|
||
<table style="border: 0;">
|
||
<tbody>
|
||
<tr>
|
||
<td><img src="images/function-piecewise-c.gif" alt="Piecewise Function" height="189" width="176"> </td>
|
||
<td style="width:20px;"> </td>
|
||
<td>Here are some example values:<br>
|
||
<table align="center" border="1">
|
||
<tbody>
|
||
<tr>
|
||
<th align="center" width="50">x</th>
|
||
<th align="center" width="50">y</th>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align:center;">-3</td>
|
||
<td style="text-align:center;">5</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align:center;">-1</td>
|
||
<td style="text-align:center;">5</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align:center;">0</td>
|
||
<td style="text-align:center;">0</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align:center;">2</td>
|
||
<td style="text-align:center;">4</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align:center;">4</td>
|
||
<td style="text-align:center;">16</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align:center;">...</td>
|
||
<td style="text-align:center;">...</td>
|
||
</tr>
|
||
</tbody></table></td>
|
||
</tr>
|
||
</tbody></table>
|
||
</div>
|
||
</div>
|
||
<p>Read more at <a href="functions-piecewise.html">Piecewise Functions</a>.</p>
|
||
|
||
|
||
<h2>Explicit vs Implicit</h2>
|
||
|
||
<p>One last topic: the terms "explicit" and "implicit".</p>
|
||
<p><b>Explicit</b> is when the function shows us how to go directly from x to y, such as:</p>
|
||
<div class="center80">
|
||
<p class="center larger">y = x<sup>3</sup> − 3</p>
|
||
<p class="center"><i>When we know x, we can find y</i></p>
|
||
</div>
|
||
<p>That is the classic <span class="larger">y = f(x)</span> style that we often work with.</p>
|
||
<p><b>Implicit</b> is when it is <b>not</b> given directly such as:</p>
|
||
<div class="center80">
|
||
<p class="center"><span class="larger">x<sup>2</sup> − 3xy + y<sup>3 </sup>= 0</span></p>
|
||
<p class="center"><i>When we know x, how do we find y?</i></p>
|
||
</div>
|
||
<p>It may be hard (or impossible!) to go directly from x to y.</p>
|
||
<p class="words">"Implicit" comes from "implied", in other words shown <b>indirectly</b>.</p>
|
||
|
||
|
||
<h2>Graphing</h2>
|
||
|
||
<ul>
|
||
<li>The <a href="../data/function-grapher.html">Function Grapher</a> can only handle explicit functions,</li>
|
||
<li>The <a href="../data/grapher-equation.html">Equation Grapher</a> can handle both types (but takes a little longer, and sometimes gets it wrong).</li>
|
||
</ul>
|
||
|
||
|
||
<h2>Conclusion</h2>
|
||
|
||
<div class="bigul">
|
||
<ul>
|
||
<li>a function <b>relates</b> inputs to outputs</li>
|
||
<li>a function takes elements from a set (the <b>domain</b>) and relates them to elements in a set (the <b>codomain</b>).</li>
|
||
<li>all the outputs (the actual values related to) are together called the <b>range</b></li>
|
||
<li>a function is a <b>special</b> type of relation where:
|
||
|
||
<ul>
|
||
<li><b>every element</b> in the domain is included, and</li>
|
||
<li>any input produces <b>only one output</b> (not this <b>or</b> that)</li>
|
||
</ul></li>
|
||
<li>an input and its matching output are together called an <b>ordered pair</b></li>
|
||
<li>so a function can also be seen as a <b>set of ordered pairs</b></li>
|
||
</ul>
|
||
</div>
|
||
<p> </p>
|
||
<div class="questions">5571, 5572, 535, 5207, 5301, 1173, 7281, 533, 8414, 8430</div>
|
||
|
||
<div class="related">
|
||
<a href="injective-surjective-bijective.html">Injective, Surjective and Bijective</a>
|
||
<a href="domain-range-codomain.html">Domain, Range and Codomain</a>
|
||
<a href="sets-introduction.html">Introduction to Sets</a>
|
||
<a href="index.html">Sets Index</a>
|
||
</div>
|
||
<!-- #EndEditable -->
|
||
|
||
</article>
|
||
|
||
<div id="adend" class="centerfull noprint"></div>
|
||
<footer id="footer" class="centerfull noprint"></footer>
|
||
<div id="copyrt">Copyright © 2022 Rod Pierce</div>
|
||
|
||
</div>
|
||
|
||
|
||
|
||
</body><!-- #EndTemplate -->
|
||
<!-- Mirrored from www.mathsisfun.com/sets/function.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 29 Oct 2022 00:48:50 GMT -->
|
||
</html> |