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
175 lines
8.4 KiB
HTML
175 lines
8.4 KiB
HTML
<!doctype html>
|
|
<html lang="en"><!-- #BeginTemplate "../Templates/Advanced.dwt" --><!-- DW6 -->
|
|
|
|
<!-- Mirrored from www.mathsisfun.com/sets/functions-piecewise.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 29 Oct 2022 01:00:40 GMT -->
|
|
<head>
|
|
<!-- #BeginEditable "doctitle" -->
|
|
<title>Piecewise Functions</title>
|
|
<meta name="Description" content="Math explained in easy language, plus puzzles, games, quizzes, worksheets and a forum. For K-12 kids, teachers and parents." />
|
|
<!-- #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))' />
|
|
<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">Piecewise Functions</h1>
|
|
<h2>A Function Can be in Pieces</h2>
|
|
<p>We can create functions that behave differently based on the input (x) value.</p>
|
|
<p align="center"><img src="images/function-piecewise-a.gif" alt="Piecewise Function" width="243" height="192" /></p>
|
|
<p align="center" class="larger">A function made up of 3 pieces</p>
|
|
<p> </p>
|
|
<div class="example">
|
|
<h3>Example: </h3>
|
|
<ul>
|
|
<li>when x is less than 2, it gives <b>x<sup>2</sup></b>, </li>
|
|
<li>when x is exactly 2 it gives <b>6</b></li>
|
|
<li>when x is more than 2 and less than or equal to 6 it gives the line <b>10-x</b></li>
|
|
</ul>
|
|
<p>It looks like this:</p>
|
|
<p align="center"><img src="images/function-piecewise-b.gif" alt="Piecewise Function" width="211" height="195" /></p>
|
|
<p align="center">(a solid dot means "including",
|
|
<br /> an open dot means "not including")</p>
|
|
<p align="center"> </p>
|
|
<p>And this is how we write it:</p>
|
|
<p align="center"><img src="images/function-piecewise-b1.gif" alt="Piecewise Function" width="355" height="104" /></p>
|
|
<p>The <a href="domain-range-codomain.html">Domain</a> (all the values that can go into the function) is all <a href="../numbers/real-numbers.html">Real Numbers</a> up to and including 6, which we can write like this:</p>
|
|
<p align="center"><span class="large">Dom(f) = (-∞, 6] </span>(using <a href="intervals.html">Interval Notation</a>)</p>
|
|
<p align="center"><span class="large">Dom(f) = <span class="large">{x <img src="../images/symbols/member-of-sm.gif" alt="member of" width="14" height="19" style="vertical-align:middle;" /> <img src="../images/symbols/set-r.svg" alt="Reals" height="16" style="vertical-align:middle;" /> | x ≤ 6}</span> </span>(using <a href="set-builder-notation.html">Set Builder Notation</a>) </p>
|
|
<p>And here are some example values:</p>
|
|
<div align="center">
|
|
<table width="30%" border="1" align="center">
|
|
<tr>
|
|
<th align="center">X</th>
|
|
<th align="center">Y</th>
|
|
</tr>
|
|
<tr>
|
|
<td align="center">−4</td>
|
|
<td align="center">16</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center">−2</td>
|
|
<td align="center">4</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center">0</td>
|
|
<td align="center">0</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center">1</td>
|
|
<td align="center">1</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center">2</td>
|
|
<td align="center">6</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center">3</td>
|
|
<td align="center">7</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<p> </p>
|
|
<div class="example">
|
|
<h3>Example: Here is another piecewise function: </h3>
|
|
<p class="center"><img src="../calculus/images/continuous-jump-fn.gif" width="223" height="77" alt="continuous jump fn h(x) = 2 if x<=1, x if x>1" /></p>
|
|
<table border="0" align="center">
|
|
<tr>
|
|
<td>which looks like:</td>
|
|
<td> </td>
|
|
<td><img src="../calculus/images/continuous-jump-graph.gif" width="178" height="159" alt="continuous jump graph h(x)" /></td>
|
|
</tr>
|
|
</table>
|
|
<p><span class="larger">What is h(−1)?</span></p>
|
|
<p class="so">x is ≤ 1, so we use h(x) = 2, so <b>h(−1) = 2</b></p>
|
|
<p><span class="larger">What is h(1)?</span></p>
|
|
<p class="so">x is ≤ 1, so we use h(x) = 2, so <b>h(1) = 2</b></p>
|
|
<p><span class="larger">What is h(4)?</span></p>
|
|
<p class="so">x is > 1, so we use h(x) = x, so <b>h(4) = 4</b> </p>
|
|
</div>
|
|
<p>Piecewise functions let us make functions that do anything we want!</p>
|
|
<div class="example">
|
|
<h3>Example: A Doctor's fee is based on the length of time.</h3>
|
|
<ul>
|
|
<li>Up to 6 minutes costs $50</li>
|
|
<li>Over 6 and up to 15 minutes costs $80</li>
|
|
<li>Over 15 minutes costs $80 plus $5 per minute above 15 minutes</li>
|
|
</ul>
|
|
<p>Which we can write like this:</p>
|
|
<p class="center"><img src="images/function-piecewise-d.gif" width="499" height="108" alt="function piecewise f(t)=50 if t<=6, 80 if t>6 and t<=15, 80 + 5(t-15) if t>15" /></p>
|
|
<p> </p>
|
|
<p>You visit for 12 minutes, what is the fee? <span class="hide">$80</span></p>
|
|
<p>You visit for 20 minutes, what is the fee? <span class="hide">$80+$5(20-15) = $105</span></p>
|
|
|
|
</div>
|
|
<h2>The Absolute Value Function</h2>
|
|
<p>The <a href="function-absolute-value.html">Absolute Value Function</a> is a famous Piecewise Function.</p>
|
|
<p>It has two pieces:</p>
|
|
<ul>
|
|
<li>below zero: <b>-x</b></li>
|
|
<li>from 0 onwards: <b>x</b></li>
|
|
</ul>
|
|
<p align="center"><img src="images/function-absolute.svg" alt="Absolute Value function" /></p>
|
|
<p align="center"><span class="larger">f(x) = |x|</span></p>
|
|
<p align="center"><img src="images/function-absolute-b.gif" alt="Absolute Value function" width="285" height="72" /></p>
|
|
<h2>The Floor Function</h2>
|
|
<p>The <a href="function-floor-ceiling.html">Floor Function</a> is a very special piecewise function. It has an infinite number of pieces:</p>
|
|
<p align="center"><img src="images/function-floor-graph.svg" alt="Floor function" /></p>
|
|
<p align="center" class="larger">The Floor Function</p>
|
|
<p> </p>
|
|
<div class="related"><a href="function.html">What is a Function?</a><a href="../algebra/index.html">Algebra 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 © 2017 MathsIsFun.com
|
|
</div>
|
|
|
|
<script type="text/javascript">document.write(getBodyEnd());</script>
|
|
</body>
|
|
<!-- #EndTemplate -->
|
|
<!-- Mirrored from www.mathsisfun.com/sets/functions-piecewise.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 29 Oct 2022 01:00:41 GMT -->
|
|
</html>
|