Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

59 lines (53 sloc) 3.489 kb
<!DOCTYPE html>
<html data-require="math">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Logarithms 1.5</title>
<script src="../khan-exercise.js"></script>
</head>
<body>
<div class="exercise">
<div class="problems">
<div id="integral">
<div class="vars" data-ensure="ABS_NUM < 1000">
<var id="BASE">randRange(2, 16)</var>
<var id="EXP">randRange(-4, 4)</var>
<var id="ABS_NUM">pow(BASE, abs(EXP))</var>
<var id="NUM_STR">
(EXP &lt; 0
? "\\dfrac{1}{" + ABS_NUM + "}"
: "" + ABS_NUM)
</var>
</div>
<p class="question">What is the value of the following logarithm?</p>
<p><code>\log_{<var>BASE</var>} <var>EXP &lt; 0 ? "\\left(" + NUM_STR + "\\right)" : NUM_STR</var></code></p>
<p class="solution"><var>EXP</var></p>
<div class="hints">
<p>If <code>b^y = x</code>, then <code>\log_{b} x = y</code>.</p>
<p>Therefore, we want to find the value <code>y</code> such that <code><var>BASE</var>^{y} = <var>NUM_STR</var></code>.</p>
<p data-if="EXP === 1">Any number raised to the power <code>1</code> is simply itself, so <code><var>BASE</var>^{1} = <var>BASE</var></code> and thus <code>\log_{<var>BASE</var>} <var>BASE</var> = 1</code>.</p>
<p data-else-if="EXP === 0">Any non-zero number raised to the power <code>0</code> is simply <code>1</code>, so <code><var>BASE</var>^0 = 1</code> and thus <code>\log_{<var>BASE</var>} 1 = 0</code>.</p>
<p data-else-if="EXP === -1">Any number raised to the power <code>-1</code> is its reciprocal, so <code><var>BASE</var>^{-1} = \dfrac{1}{<var>BASE</var>}</code> and thus <code>\log_{<var>BASE</var>} \left(\dfrac{1}{<var>BASE</var>}\right) = -1</code>.</p>
<p data-else>In this case, <code><var>BASE</var>^{<var>EXP</var>} = <var>NUM_STR</var></code>, so <code>\log_{<var>BASE</var>} <var>EXP &lt; 0 ? "\\left(" + NUM_STR + "\\right)" : NUM_STR</var> = <var>EXP</var></code>.</p>
</div>
</div>
<div id="root">
<div class="vars" data-ensure="NUM < 1000">
<var id="BASE">randRange(2, 16)</var>
<var id="EXP">randRange(2, 5)</var>
<var id="NUM">pow(BASE, EXP)</var>
</div>
<p class="question">What is the value of the following logarithm?</p>
<p><code>\log_{<var>NUM</var>} <var>BASE</var></code></p>
<p class="solution"><var>1/EXP</var></p>
<div class="hints">
<p>If <code>b^y = x</code>, then <code>\log_{b} x = y</code>.</p>
<p>Notice that <code><var>BASE</var></code> is the <var>["square", "cube", "fourth", "fifth"][EXP - 2]</var> root of <code><var>NUM</var></code>.</p>
<p>That is, <code>\sqrt<var>EXP === 2 ? "" : "[" + EXP + "]"</var>{<var>NUM</var>} = <var>NUM</var>^{1/<var>EXP</var>} = <var>BASE</var></code>.</p>
<p>Thus, <code>\log_{<var>NUM</var>} <var>BASE</var> = \dfrac{1}{<var>EXP</var>}</code>.</p>
</div>
</div>
</div>
</div>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.