Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 314 lines (290 sloc) 15.767 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 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 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313
<!DOCTYPE html>
<html data-require="math graphie word-problems stat">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Z-scores 3: Finding areas under the curve with a z-table</title>
    <script src="../khan-exercise.js"></script>
    <style>
        .reading span {
            width: 32px;
            font-size: 11px;
            padding: 5px;
        }
        .reading span:first-child {
            font-weight: bold;
            width: 22px;
            border-right: 2px solid #CCCCCC;
        }
    </style>
</head>
<body>
    <div class="exercise">
    <div class="problems">
        <div>
            <div class="vars">
                <var id="INDEX">randRange(0, 3)</var>
                <var id="STDDEV">[4, 5, 8, 10][INDEX]</var>
                <var id="ZSCORES">
                (function() {
                    var zScores = [];

                    if (STDDEV === 8) {
                        var zDecimal1 = randRange(0, 2) * 2;
                        var zDecimal2 = randRange(zDecimal1 / 2 + 1, 3) * 2;
                    } else {
                        var zDecimal1 = randRange(0, STDDEV - 2);
                        var zDecimal2 = randRange(zDecimal1 + 1, STDDEV - 1);
                    }

                    zScores.push(roundTo(2, randRange(0, 2) + zDecimal1 / STDDEV) * randRangeNonZero(-1, 1));
                    zScores.push(roundTo(2, floorTo(0,
                        abs(zScores[0])) + zDecimal2 / STDDEV) * randRangeNonZero(-1, 1));
                    return sortNumbers(zScores);
                })()
                </var>
                <var id="ROW_INDEX_1">floorTo(0, abs(ZSCORES[0]) * 10) % 10</var>
                <var id="COL_INDEX_1">(roundTo(0, abs(ZSCORES[0]) * 100)) % 10</var>
                <var id="ROW_INDEX_2">floorTo(0, abs(ZSCORES[1]) * 10) % 10</var>
                <var id="COL_INDEX_2">(roundTo(0, abs(ZSCORES[1]) * 100)) % 10</var>
                <var id="MEAN">randRange(95, 99) - STDDEV * 3</var>
                <var id="GRADES">[MEAN + ZSCORES[0] * STDDEV, MEAN + ZSCORES[1] * STDDEV]</var>
                <var id="ROWS">
                (function() {
                    var rowNames = [];
                    for (var i = floorTo(0, abs(ZSCORES[0])); i &lt; (floorTo(0, abs(ZSCORES[0])) + 1); i += 0.1) {
                        rowNames.push(i.toFixed(1));
                    }
                    return rowNames;
                })()
                </var>
                <var id="COLUMNS">[".00", ".01", ".02", ".03", ".04", ".05", ".06", ".07", ".08", ".09"]</var>
                <var id="ZGRID">
                    (function() {
                        var zGrid = [];
                        for (var i = 0; i &lt; ROWS.length; i++) {
                            var zRow = [];
                            for (var j = 0; j &lt; COLUMNS.length; j++) {
                                zRow.push(zScores(roundTo(2,
                                    (floorTo(0, abs(ZSCORES[0])) + i / 10 + j / 100) * 100)).toFixed(4));
                            }
                            zGrid.push(zRow);
                        }
                        return zGrid;
                    })()
                </var>
                <var id="ANSWER">
                    (function() {
                        var a, b;
                        if (ZSCORES[0] &gt;= 0) {
                            a = ZGRID[ROW_INDEX_1][COL_INDEX_1];
                        } else {
                            a = 1 - ZGRID[ROW_INDEX_1][COL_INDEX_1];
                        }
                        if (ZSCORES[1] &gt;= 0) {
                            b = ZGRID[ROW_INDEX_2][COL_INDEX_2];
                        } else {
                            b = 1 - ZGRID[ROW_INDEX_2][COL_INDEX_2];
                        }

                    return roundTo(4, b - a);
                    })()
                </var>
                <var id="HEADER">"z"</var>
            </div>
            <div class="problem">
                The scores on a statewide <var>course( 1 )</var> exam were normally distributed with
                <code>\mu = <var>MEAN</var></code> and <code>\sigma = <var>STDDEV</var></code>.
            </div>
            <p class="question">
                What percentage of test-takers had a grade between <code><var>GRADES[0]</var></code>
                and <code><var>GRADES[1]</var></code> on the exam?
                Use the cumulative z-table provided below. Round to two decimal places.
            </p>
            <div class="fake_header reading">
                <span><var>HEADER</var></span><span data-each="COLUMNS as i, column"><var>column</var></span>
            </div>
            <div class="fake_row reading" data-each="ROWS as i, row">
                <span><var>row</var></span><span data-each="ZGRID[i] as j, zgrid"><var>zgrid</var></span>
            </div>
            <div class="solution" data-forms="percent">
                <span><var>roundTo( 2, ANSWER * 100 )</var></span>
            </div>

            <div class="hints">
                <p>
                    A cumulative z-table shows the probability that a standard normal variable will
                    be <b>less than</b> a certain value <b>(z)</b>.
                </p>
                <p>
                    In order to use the z-table, we first need to determine the
                    <span class="hint_blue">z-scores</span> of the two grades which we were given.
                </p>
                <div>
                    <p>
                        Recall that we can calculate the z-scores by subtracting the
                        <span class="hint_pink">mean <code>(\mu)</code></span> from
                        each exam grade and then dividing by the <span class="hint_green">standard
                        deviation <code>(\sigma)</code></span>.
                    </p>
                    <p data-each="GRADES as index, grade">
                        <code>
                            \large{\quad z \quad = \quad
                            \dfrac{x - \pink{\mu}}{\green{\sigma}}
                            \quad = \quad \dfrac{<var>grade</var> - \pink{<var>MEAN</var>}}{\green{<var>STDDEV</var>}}
                            \quad = \quad <var>ZSCORES[index]</var>}
                        </code>
                    </p>
                </div>
                <div>
                    <p>
                        We can find the percentage of test-takers that earned between
                        <code><var>GRADES[0]</var></code> and <code><var>GRADES[1]</var></code>
                        by finding the area between <code><var>ZSCORES[0]</var></code> and
                        <code><var>ZSCORES[1]</var></code> under the standard normal curve. After
                        looking up these two z-scores in our z-table, subtracting the two table
                        values will provide us with the total area.
                    </p>
                    <div class="graphie" id="grid">
                        init({
                            range: [[-4, 4], [-1.5, 4.7]],
                            scale: [430 / 8, 30]
                        });

                        style({ stroke: "#bbb" }, function() {
                            line([-3.5, 0], [3.5, 0]);
                        });

                        graph.pdf = function(x) {
                            return gaussianPDF(0, 1, x) * 4 / gaussianPDF(0, 1, 0) + 0.2;
                        };

                        style({ stroke: BLUE }, function() {
                            plot(graph.pdf, [-3.5, 3.5]);
                        });

                    </div>
                </div>
                <div>
                    <div data-if="ZSCORES[1] < 0"><p>
                        Since the normal curve is symmetrical, the area <b>less than</b>
                        <code><var>ZSCORES[1]</var></code> is equal to the area
                        <b>greater than</b> <code><var>abs( ZSCORES[1] )</var></code>, which can
                        be found by looking up <code><var>abs( ZSCORES[1] )</var></code>
                        on the z-table and subtracting the table value from <code>1</code>, the
                        total area under the curve.
                    </p></div>
                    <p data-if="ZSCORES[1] < 0">
                        <code>1 - <var>ZGRID[ ROW_INDEX_2 ][ COL_INDEX_2 ]</var> =
                        <var>roundTo( 4, 1 - ZGRID[ ROW_INDEX_2 ][ COL_INDEX_2 ] )</var></code>.
                        This value, <code class="hint_blue">
                        <var>roundTo( 4, 1 - ZGRID[ ROW_INDEX_2 ][ COL_INDEX_2 ] )</var></code>,
                        represents the portion of the population that scored lower than
                        <code><var>GRADES[1]</var></code> on the exam.
                    </p>
                    <p data-else>
                        Look up <code><var>ZSCORES[1]</var></code> on the z-table. This value,
                        <code class="hint_blue"> <var>ZGRID[ ROW_INDEX_2 ][ COL_INDEX_2 ]</var></code>,
                        represents the portion of the population that scored lower than
                        <code><var>GRADES[1]</var></code> on the exam.
                    </p>
                    <div class="graphie">
                        var nth = ":nth-child(" + ( COL_INDEX_2 + 2 ) + ")";
                        $( ".fake_row" ).eq( ROW_INDEX_2 ).find( "span" + nth )
                            .css( "background", KhanUtil.BLUE );
                    </div>
                    <div class="graphie" data-update="grid">
                        style({ stroke: "#bbb" }, function() {
                            graph.zLine1 = line([ZSCORES[1], 0], [ZSCORES[1], graph.pdf(ZSCORES[1])]).toBack();
                        });
                        graph.zLabel = label([ZSCORES[1], 0], roundTo(2, ZSCORES[1]), "below", { color: "#bbb" });

                        var step = 1 / 50;
                        blueShape = [];

                        blueShape.push([-3.5, 0]);

                        for (var i = -3.5; i &lt;= ZSCORES[1]; i += step) {
                            blueShape.push([i, graph.pdf(i)]);
                        }

                        blueShape.push([ZSCORES[1], graph.pdf(ZSCORES[1])]);
                        blueShape.push([ZSCORES[1], 0]);
                        blueShape.push([-3.5, 0]);

                        style({ stroke: null, fill: BLUE, opacity: 0.3 }, function() {
                            graph.blueShape = path(blueShape);
                        });
                    </div>
                </div>
                <div>
                    <div data-if="ZSCORES[0] < 0"><p>
                        Since the normal curve is symmetrical, the area <b>less than</b>
                        <code><var>ZSCORES[0]</var></code> is equal to the area
                        <b>greater than</b> <code><var>abs(ZSCORES[0])</var></code>, which can
                        be found by looking up <code><var>abs(ZSCORES[0])</var></code>
                        on the z-table and subtracting the table value from <code>1</code>, the
                        total area under the curve.
                    </p></div>
                    <p data-if="ZSCORES[0] < 0">
                        <code>1 - <var>ZGRID[ROW_INDEX_1][COL_INDEX_1]</var> =
                        <var>roundTo(4, 1 - ZGRID[ROW_INDEX_1][COL_INDEX_1])</var></code>. This value,
                        <code class="hint_orange"><var>roundTo(4, 1 - ZGRID[ROW_INDEX_1][COL_INDEX_1])</var></code>,
                        represents the portion of the population that scored lower than
                        <code><var>GRADES[0]</var></code> on the exam.
                    </p>
                    <p data-else>
                        Look up <code><var>ZSCORES[0]</var></code> on the z-table. This value,
                        <code class="hint_orange"><var>ZGRID[ ROW_INDEX_1 ][ COL_INDEX_1 ]</var></code>,
                        represents the portion of the population that scored lower than
                        <code><var>GRADES[0]</var></code> on the exam.
                    </p>
                    <div class="graphie">
                        var nth = ":nth-child(" + (COL_INDEX_1 + 2) + ")";
                        $(".fake_row").eq(ROW_INDEX_1).find("span" + nth).css("background", ORANGE);
                    </div>
                    <div class="graphie" data-update="grid">
                        style({ stroke: "#bbb" }, function() {
                            graph.zLine2 = line([ZSCORES[0], 0], [ZSCORES[0], graph.pdf(ZSCORES[0])]).toBack();
                        });
                        graph.zLabel.remove();
                        graph.zLabel = label([ZSCORES[0], 0], roundTo(2, ZSCORES[0]), "below", { color: "#bbb" });
                        var step = 1 / 50;
                        graph.blueShape.remove();
                        orangeShape = [];

                        orangeShape.push([-3.5, 0]);

                        for (var i = -3.5; i &lt;= ZSCORES[0]; i += step) {
                            orangeShape.push([i, graph.pdf(i)]);
                        }

                        orangeShape.push([ZSCORES[0], graph.pdf(ZSCORES[0])]);
                        orangeShape.push([ZSCORES[0], 0]);
                        orangeShape.push([-3.5, 0]);

                        style({ stroke: null, fill: ORANGE, opacity: 0.7 }, function() {
                            graph.orangeShape = path(orangeShape);
                        });

                        blueShape = [];

                        blueShape.push([ZSCORES[0], 0]);

                        for (var i = ZSCORES[0]; i &lt;= ZSCORES[1]; i += step) {
                            blueShape.push([i, graph.pdf(i)]);
                        }

                        blueShape.push([ZSCORES[1], graph.pdf(ZSCORES[1])]);
                        blueShape.push([ZSCORES[1], 0]);
                        blueShape.push([ZSCORES[0], 0]);

                        style({ stroke: null, fill: BLUE, opacity: 0.3 }, function() {
                            graph.blueShape = path(blueShape);
                        });
                    </div>
                </div>
                <div>
                    <p>
                        Finally, subtract the two cumulative areas to arrive at our final answer:
                        <code>\blue{<span data-if="ZSCORES[1] < 0">
                            <var>roundTo(4, 1 - ZGRID[ROW_INDEX_2][COL_INDEX_2])</var>
                        </span><span data-else>
                            <var>roundTo(4, ZGRID[ROW_INDEX_2][COL_INDEX_2])</var>
                        </span>} - \orange{<span data-if="ZSCORES[0] < 0">
                            <var>roundTo(4, 1 - ZGRID[ROW_INDEX_1][COL_INDEX_1])</var>
                        </span><span data-else>
                            <var>roundTo(4, ZGRID[ROW_INDEX_1][COL_INDEX_1])</var>
                        </span>} = <var>ANSWER</var></code><br />

                        Thus, <code class="hint_pink"><var>roundTo( 2, ANSWER * 100 )</var>\%</code>
                        of the test-takers scored between <code><var>GRADES[0]</var></code> and
                        <code><var>GRADES[1]</var></code> on the <var>course( 1 )</var> exam.
                    </p>
                    <div class="graphie" data-update="grid">
                        graph.orangeShape.remove();
                        graph.zLabel.remove();
                    </div>
                </div>
            </div>
        </div>
    </div>
    </div>
</body>
</html>
Something went wrong with that request. Please try again.