Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 86 lines (68 sloc) 3.177 kb
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
<!DOCTYPE html>
<html data-require="math math-format exponents">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Negative exponents</title>
    <script data-main="../local-only/main.js" src="../local-only/require.js"></script>

    <script type="text/javascript">
        /* Find a rational base and an integer exponent such that the calculation is
* reasonable. */
        function pickRationalBaseIntegerExponent() {
            var base_neg_prob = .5;
            var exp_neg_prob = .75;
            var base_rat_prob = .75;

            var base_neg = KhanUtil.random() < base_neg_prob;
            var base_n = KhanUtil.randRange( 1, 10 );
            var base_d;
            while ( base_d === undefined || base_n === base_d ) {
                base_d = KhanUtil.randRangeWeighted( 1, 10, 1, 1 - base_rat_prob );
            }

            var exp_neg = KhanUtil.random() < exp_neg_prob;
            var max_exp = Math.min( KhanUtil.maxReasonableExp( base_n ),
                KhanUtil.maxReasonableExp( base_d ) );
            var min_exp = exp_neg ? 1 : 2;
            var exp = KhanUtil.randRange( min_exp, max_exp );

            var sol_n = Math.round( Math.pow( exp_neg ? base_d : base_n, exp ) );
            var sol_d = Math.round( Math.pow( exp_neg ? base_n : base_d, exp ) );

            return {
                base_n: base_n,
                base_d: base_d,
                exp: exp * ( exp_neg ? -1 : 1 ),
                sol_n: sol_n,
                sol_d: sol_d
            };
        }
    </script>
</head>
<body>
    <div class="exercise">
        <div class="problems">
            <div>
                <div class="vars">
                    <var id="VALS">pickRationalBaseIntegerExponent()</var>

                    <var id="BASE_N">VALS.base_n</var>
                    <var id="BASE_D">VALS.base_d</var>

                    <var id="EXP_NEG">VALS.exp &lt; 0</var>
                    <var id="EXP_SIGN">EXP_NEG ? "-" : ""</var>
                    <var id="EXP">abs( VALS.exp )</var>

                    <var id="BASEF_N">EXP_NEG ? BASE_D : BASE_N</var>
                    <var id="BASEF_D">EXP_NEG ? BASE_N : BASE_D</var>

                    <var id="SOL_N">VALS.sol_n</var>
                    <var id="SOL_D">VALS.sol_d</var>
                </div>

                <p class="question"><code>\Large <var>fracParens( BASE_N, BASE_D )</var>^{<var>EXP_SIGN+EXP</var>} = \text{?}</code></p>
                <p class="solution"><var>SOL_N / SOL_D</var></p>

                <div class="hints">

                    <div data-if="abs( EXP ) > 1" data-unwrap="">

                        <p data-if="EXP_NEG"><code>= <var>fracParens( BASEF_N, BASEF_D )</var>^{<var>EXP</var>}</code></p>

                        <div data-each="expandFractionExponent( BASEF_N, BASEF_D, EXP ) as v" data-unwrap="">
                            <p><code>= <var>v</var></code></p>
                        </div>

                    </div>

                    <p data-else=""><code>= <var>frac( SOL_N, SOL_D )</var></code></p>

                </div>
            </div>
        </div>
    </div>
</body>
</html>
Something went wrong with that request. Please try again.