This repository has been archived by the owner on May 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 863
/
range_of_a_function.html
157 lines (141 loc) · 7.28 KB
/
range_of_a_function.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<!DOCTYPE html>
<html data-require="math graphie expressions">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Range of a function</title>
<script src="../khan-exercise.js"></script>
</head>
<body>
<div class="exercise">
<div class="problems">
<div id="quadratic">
<div class="vars">
<var id="A" data-ensure="A !== 1">randRangeNonZero(-4, 4)</var>
<var id="B">randRangeNonZero(-4, 4)</var>
</div>
<p class="problem"><code>f(x) = <var>expr(["+", ["*", A, ["^", "x", 2]], B])</var></code></p>
<p class="question">What is the range of <code>f(x)</code>?</p>
<p class="solution" data-type="multiple">
<code>\{\, y \in \RR \mid y</code>
<span class="sol" data-choices="['', '<', '>', '≤', '≥', '≠']" data-type="list">
<var>A > 0 ? "≥" : "≤"</var>
</span>
<span class="sol short40" data-forms="integer, decimal"><var>B</var></span>
<code>\,\}</code>
</p>
<div class="hints" data-apply="appendContents">
<p id="prehint" data-apply="remove"></p>
</div>
</div>
<div id="quadratic-random-hole">
<div class="vars">
<var id="A" data-ensure="A !== 1">randRangeNonZero(-4, 4)</var>
<var id="B" data-ensure="abs( 3 * A + B ) < 10">randRangeNonZero(-4, 4)</var>
<var id="HOLE" data-ensure="abs( A * HOLE * HOLE + B ) < 10">randRangeNonZero( -4, 4 )</var>
<var id="IF">$._("if")</var>
<var id="OTHERWISE">$._("otherwise")</var>
</div>
<p class="problem"><code>f(x) = \begin{cases}
<var>3 * A + B</var> & \text{<var>IF</var> } x = <var>HOLE</var> \\
<var>expr(["+", ["*", A, ["^", "x", 2]], B])</var> & \text{<var>OTHERWISE</var>}
\end{cases}</code></p>
<p class="question">What is the range of <code>f(x)</code>?</p>
<p class="solution" data-type="multiple">
<code>\{\, y \in \RR \mid y</code>
<span class="sol" data-choices="['', '<', '>', '≤', '≥', '≠']" data-type="list">
<var>A > 0 ? "≥" : "≤"</var>
</span>
<span class="sol short40"><var>B</var></span>
<code>\,\}</code>
</p>
<div class="hints" data-apply="appendContents">
<p id="prehint">First consider the behavior for <code>x \ne <var>HOLE</var></code>.</p>
<div id="posthint">
<p>If <code>x = <var>HOLE</var></code>, then <code>f(x) = <var>3 * A + B</var></code>, but the range does not change.</p>
<div class="graphie" data-update="grid">
circle( [HOLE, 3 * A + B], 3 / 20, {
fill: "red",
stroke: "none"
} );
circle( [HOLE, A * HOLE * HOLE + B], 3 / 20, {
fill: "#fff",
stroke: "red"
} );
</div>
</div>
</div>
</div>
<div id="quadratic-zero-hole" data-type="quadratic-random-hole">
<div class="vars">
<var id="HOLE">0</var>
</div>
<p class="solution" data-type="multiple">
<code>\{\, y \in \RR \mid y</code>
<span class="sol" data-choices="['', '<', '>', '≤', '≥', '≠']" data-type="list">
<var>A > 0 ? ">" : "<"</var>
</span>
<span class="sol short40"><var>B</var></span>
<code>\,\}</code>
</p>
<div class="hints" data-apply="appendContents">
<p id="prehint">First consider the behavior for <code>x \ne <var>HOLE</var></code>.</p>
<div id="posthint">
<p>If <code>x = <var>HOLE</var></code>, then <code>f(x) = <var>3 * A + B</var></code>, which eliminates <code>f(x) = <var>B</var></code> from the range.</p>
<div class="graphie" data-update="grid">
circle( [HOLE, 3 * A + B], 3 / 20, {
fill: "red",
stroke: "red"
} );
circle( [HOLE, A * HOLE * HOLE + B], 3 / 20, {
fill: "#fff",
stroke: "red"
} );
</div>
</div>
<p data-if="A > 0">The new range is <code>\{\, y \mid y > <var>B</var> \,\}</code>.</p><p data-else="">The new range is <code>\{\, y \mid y < <var>B</var> \,\}</code>.</p>
</div>
</div>
</div>
<div class="hints">
<p id="prehint"></p>
<div>
<div class="graphie" id="grid">
graphInit({
range: 10,
scale: 20,
tickStep: 1,
axisArrows: "<->"
});
style({
stroke: "#6495ED",
arrows: null
})
graph.pl = plot( function( x ) {
return A * pow( x, 2 );
}, [-10, 10], {
stroke: "red",
strokeDasharray: "- "
});
</div>
<p>Consider the range of <code><var>expr(["*", A, ["^", "x", 2]])</var></code>.</p>
</div>
<p data-if="A > 0">The range of <code>x^2</code> is <code>\{\, y \mid y \ge 0 \,\}</code>. Multiplying by <code><var>A</var></code> doesn't change the range.</p>
<p data-else="">The range of <code>x^2</code> is <code>\{\, y \mid y \ge 0 \,\}</code>. Multiplying by <code><var>A</var></code> flips the range to <code>\{\, y \mid y \le 0 \,\}</code>.</p>
<div>
<p>
<span data-if="B > 0">Now add <code><var>abs( B )</var></code>.</span><span data-else="">Now subtract <code><var>abs( B )</var></code>.</span>
<span data-if="A > 0">The range becomes: <code>\{\, y \mid y ≥ <var>B</var> \,\}</code>.</span><span data-else="">The range becomes: <code>\{\, y \mid y ≤ <var>B</var> \,\}</code>.</span>
</p>
<div class="graphie" data-update="grid">
graph.pl.remove();
graph.pl = plot( function( x ) {
return A * pow( x, 2 ) + B;
}, [-10, 10], {
stroke: "red"
});
</div>
</div>
</div>
</div>
</body>
</html>