# Khan/khan-exercises

Summary:
Inspired by the comment:

> The exercises should include negative and fractional logarithms as well, e.g. log(8,2) = 1/3 and log(4,1/64) = -3.

Test Plan: ... looked at hints for all the different cases? Not sure what one writes in a test plan for new exercises.

Reviewers: eater

Reviewed By: eater

Differential Revision: http://phabricator.khanacademy.org/D979
1 parent 13f3664 commit b2c978b00dd1312ecf60bfbcabda6b4c44a9ac49 spicyj committed Dec 13, 2012
Showing with 58 additions and 0 deletions.
1. +58 −0 exercises/logarithms_1.5.html
 @@ -0,0 +1,58 @@ + + + + + Logarithms 1.5 + + + +
+
+
+
+ randRange(2, 16) + randRange(-4, 4) + pow(BASE, abs(EXP)) + + (EXP < 0 + ? "\\dfrac{1}{" + ABS_NUM + "}" + : "" + ABS_NUM) + +
+ +

What is the value of the following logarithm?

+

\log_{BASE} EXP < 0 ? "\\left(" + NUM_STR + "\\right)" : NUM_STR

+

EXP

+ +
+

If b^y = x, then \log_{b} x = y.

+

Therefore, we want to find the value y such that BASE^{y} = NUM_STR.

+

Any number raised to the power 1 is simply itself, so BASE^{1} = BASE and thus \log_{BASE} BASE = 1.

+

Any non-zero number raised to the power 0 is simply 1, so BASE^0 = 1 and thus \log_{BASE} 1 = 0.

+

Any number raised to the power -1 is its reciprocal, so BASE^{-1} = \dfrac{1}{BASE} and thus \log_{BASE} \left(\dfrac{1}{BASE}\right) = -1.

+

In this case, BASE^{EXP} = NUM_STR, so \log_{BASE} EXP < 0 ? "\\left(" + NUM_STR + "\\right)" : NUM_STR = EXP.

+
+
+ +
+
+ randRange(2, 16) + randRange(2, 5) + pow(BASE, EXP) +
+ +

What is the value of the following logarithm?

+

\log_{NUM} BASE

+

1/EXP

+ +
+

If b^y = x, then \log_{b} x = y.

+

Notice that BASE is the ["square", "cube", "fourth", "fifth"][EXP - 2] root of NUM.

+

That is, \sqrtEXP === 2 ? "" : "[" + EXP + "]"{NUM} = NUM^{1/EXP} = BASE.

+

Thus, \log_{NUM} BASE = \dfrac{1}{EXP}.

+
+
+
+
+ +