Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

72 lines (66 sloc) 4.111 kB
<!DOCTYPE html>
<html data-require="math">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Evaluating logarithms 2</title>
<script data-main="../local-only/main.js" src="../local-only/require.js"></script>
</head>
<body>
<div class="exercise">
<div class="problems">
<div id="integral">
<div class="vars" data-ensure="ABS_NUM &lt; 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">
<code>\large{\log_{<var>BASE</var>}} <var>EXP &lt; 0 ? "\\left(" + NUM_STR + "\\right)" : NUM_STR</var> = \text{?}</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="">
<span data-if="EXP < 0" data-unwrap="">
In this case, <code><var>BASE</var>^{<var>EXP</var>} = <var>NUM_STR</var></code>,
so <code>\log_{<var>BASE</var>} \left(<var>NUM_STR</var>\right) = <var>EXP</var></code>.
</span>
<span data-else="" data-unwrap="">In this case, <code><var>BASE</var>^{<var>EXP</var>} = <var>NUM_STR</var></code>,
so <code>\log_{<var>BASE</var>} <var>NUM_STR</var> = <var>EXP</var></code>.
</span>
</p>
</div>
</div>
<div id="root">
<div class="vars" data-ensure="NUM &lt; 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"><code>\large{\log_{<var>NUM</var>}} <var>BASE</var> = \text{?}</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 data-if="EXP === 2">
That is, <code>\sqrt{<var>NUM</var>} = <var>NUM</var>^{1/<var>EXP</var>} = <var>BASE</var></code>.
</p>
<p data-else="">That is, <code>\sqrt[<var>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.