<?xml version="1.0" encoding="UTF-8"?>
<quiz>
  <question type="description">
    <name>
      <text>2.3.11 (Domain and range)</text>
    </name>
    <questiontext format="html">
      <text><![CDATA[<h1>Domain and Range</h1>

<p>We have seen that a function is simply any rule that assigns a particular output to each given input.&nbsp; Typically both the input and output of a function is a number, and in this case a function may be expressible by means of a formula. For example, the formulae 
\[
f(x) =x^2 +1 ,\quad f(x) = \frac{d}{dx}\left(2x + \sin(x)\right), \quad f(x) = 2
\]
each defines a certain function.&nbsp; However,&nbsp; a function like
\[
f(x) = \begin{cases}-1 &amp; x \leq 2\\ 0 &amp; 2&lt; x &lt; 3 \\ 1 &amp; x \geq 3\end{cases}
\]
is also a perfectly good function, despite the fact it is not written as one neat expression.</p>

<p>The <b>domain</b> of a function is the set of values on which it is defined, i.e. all those numbers the function can take as an input.&nbsp; If this is not otherwise specified, then it is all those values for which the function makes sense. In particular, it is the set of values which the variable on the horizontal axis on a graph can take (usually labelled \(x\)). For example, the domain of the function \(f(x) = \frac{1}{x}\) is all non-zero numbers: zero is excluded because division by zero is undefined.&nbsp; Similarly, the domain of the function \(f(x) =\ln(x)\) is all positive numbers, since we cannot take the logarithm of a negative number or of zero, we will discuss this more in week 4.</p>
<br>
<p>The <b>range</b> of a function is all those values which the function produces as an output. In particular, it is the set of values the variable on the vertical axis can take (usually labelled \(y\)). For example, the range of the constant function \(f(x) = 0\) is just the number \(0\), and the range of the function \(f(x) = x^2 + 1\) is all those numbers greater than or equal to \(1\).</p> 
<br>
<p>Domains and ranges are very important when discussing functions. In fact they may affect whether a relation is a function at all. For example the function \(f(x) = \sqrt{x}\) is a function if we consider its range to be the positive real numbers. However, if we also consider the negative real numbers in its range, then the input \(x = 5\) for example would have two outputs \(y = 5\) and \(y = -5\), therefore it would no longer be a function. In fact this is why we <i>define</i> the symbol \(\sqrt{\cdot}\) to be the positive square root only - to ensure we are dealing with a function.</p>


<br>
<h3>Sets and intervals</h3>

<p>In order to state the precise domain and range of functions, it becomes necessary to have notation for statements like 'the positive real numbers'. We do this by way of sets and intervals.</p>
<br>
<p>An <b>interval</b> is a connected subset of the number line \(\mathbb{R}\).</p>
<p>An interval is <b>closed</b> if both its endpoints are included in it.</p>
<p>An interval is <b>open</b> if both its endpoints are excluded from it.</p>
<p>An interval is <b>half-open</b> if one of its endpoints is included in it.</p>
<br>
<p>Intervals are shorthand for certain sets and we often use the following notation</p>
<br>
<p>\([a,b]\) is the closed interval \(\{x : a \leq x \leq b\}\).</p>
<p>\([a,b)\) is the half open interval \(\{x : a \leq x &lt; b\}\).</p>
<p>\((a,b]\) is the half open interval \(\{x : a &lt; x \leq b\}\).</p>
<p>\((a,b)\) is the open interval \(\{x : a &lt; x &lt; b\}\).</p>
<br>
<p>We may also have to deal with intervals with \(\infty\), think of the previous statement 'for all positive real numbers', this means all of the positive numbers going to infinity. Fortunately we can write this as an infinite interval as \((0, \infty)\). Similarly we write the interval of all negative real numbers as \((-\infty,0)\). Note that these intervals have no defined endpoint on the side where we write infinity. Therefore closed intervals such as \([0,\infty]\) make no sense.</p>
<p>Sometimes we use the symbols \(\cap\) and \(\cup\) which mean <b>union</b> and <b>intersection</b> respectively. For sets \(A,B\) we define <i>union</i> of \(A\) and \(B\) to be
\[
A \cup B = \{x : x \in A \mbox{ or } x \in B\}.
\]
For sets \(A,B\) we define the <i>intersection</i> of \(A\) and \(B\) to be
\[
A \cup B = \{x : x \in A \mbox{ and } x \in B\}.
\] 
For example let \(A = [1,4]\) and \(B = [2,5]\), then
\[
A \cup B = [1,5] \qquad \mbox{ and } \qquad A \cap B = [2,4].
\]</p>]]></text>
<file name="graph of root x-1.svg" path="/" encoding="base64">[encoded data, 31092 characters]</file>
<file name="graph of sin(1-x).svg" path="/" encoding="base64">[encoded data, 95848 characters]</file>
    </questiontext>
    <generalfeedback format="html">
      <text/>
    </generalfeedback>
    <defaultgrade>0</defaultgrade>
    <penalty>0</penalty>
    <hidden>0</hidden>
    <idnumber/>
  </question>
</quiz>
