Permalink
Browse files

Add hints for matrix determinant exercises & split up 2x2 and 3x3 int…

…o separate files.

Summary: It is what it is.

Test Plan: Tested locally

Reviewers: eater, alpert

Reviewed By: eater

Differential Revision: http://phabricator.khanacademy.org/D2018
  • Loading branch information...
1 parent 7e20aa4 commit 2654ea6de8f31cb1d7bed014f43918b2cba2fc85 Stephanie H. Chang committed Feb 9, 2013
@@ -2,7 +2,7 @@
<html data-require="math matrix">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>Matrix determinant</title>
+ <title>Determinant of a 2x2 matrix</title>
<script src="../khan-exercise.js"></script>
</head>
<body>
@@ -24,33 +24,42 @@
What is the determinant of <code><var>PRETTY_MAT_ID</var></code>?
</p>
- <div class="hints">
- <div>
- <p>The solution is:</p>
- <code>\text{det}(<var>PRETTY_MAT_ID</var>) = <var>SOLN</var></code>
- </div>
- </div>
-
<div class="solution">
<span class="sol"><var>SOLN</var></span>
</div>
<div class="problems">
- <div id="2x2" data-weight="7">
+ <div>
<div class="vars" data-apply="prependVars">
<var id="DIM">2</var>
+ <var id="HINT_MAT">makeMatrix([["a","b"],["c","d"]])</var>
</div>
- <div class="hints" data-apply="prependContents">
- <div data-video-hint data-youtube-id="OU9sWHk_dlw"></div>
- </div>
- </div>
-
- <div id="3x3" data-weight="1">
- <div class="vars" data-apply="prependVars">
- <var id="DIM">3</var>
- </div>
- <div class="hints" data-apply="prependContents">
- <div data-video-hint data-youtube-id="v4MenooI1J0"></div>
+ <div class="hints">
+ <div>
+ <p>
+ The determinant of a 2x2 matrix can be computed the following way:
+ </p>
+ <p>
+ <code>
+ <var>printSimpleMatrixDet(HINT_MAT)</var>
+ = <var>matrix2x2DetHint(HINT_MAT)</var>
+ </code>
+ </p>
+ </div>
+ <div>
+ <p>In this specific case,</p>
+ <p>
+ <code>
+ <var>printSimpleMatrixDet(MAT)</var>
+ = <var>matrix2x2DetHint(MAT)</var>
+ </code>
+ </p>
+ </div>
+ <div>
+ <code>
+ = <var>SOLN</var>
+ </code>
+ </div>
</div>
</div>
</div>
@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+<html data-require="math matrix">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>Determinant of a 2x2 matrix</title>
+ <script src="../khan-exercise.js"></script>
+</head>
+<body>
+ <div class="exercise">
+
+ <div class="vars">
+ <var id="MAT">makeMatrix(randRange(-2, 5, DIM, DIM))</var>
+ <var id="SOLN">matrixDet(MAT)</var>
+ <var id="PRETTY_MAT_ID">"\\textbf " + randFromArray("ABCDEF")</var>
+ </div>
+
+ <div class="problem">
+ <p>
+ <code><var>PRETTY_MAT_ID</var> = <var>printSimpleMatrix(MAT)</var></code>
+ </p>
+ </div>
+
+ <p class="question">
+ What is the determinant of <code><var>PRETTY_MAT_ID</var></code>?
+ </p>
+
+ <div class="solution">
+ <span class="sol"><var>SOLN</var></span>
+ </div>
+
+ <div class="problems">
+ <div>
+ <div class="vars" data-apply="prependVars">
+ <var id="DIM">2</var>
+ <var id="HINT_MAT">makeMatrix([["a","b"],["c","d"]])</var>
+ </div>
+ <div class="hints">
+ <div>
+ <p>
+ The determinant of a 2x2 matrix can be computed the following way:
+ </p>
+ <p>
+ <code>
+ <var>printSimpleMatrixDet(HINT_MAT)</var>
+ = <var>matrix2x2DetHint(HINT_MAT)</var>
+ </code>
+ </p>
+ </div>
+ <div>
+ <p>In this specific case,</p>
+ <p>
+ <code>
+ <var>printSimpleMatrixDet(MAT)</var>
+ = <var>matrix2x2DetHint(MAT)</var>
+ </code>
+ </p>
+ </div>
+ <div>
+ <code>
+ = <var>SOLN</var>
+ </code>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ </div>
+</body>
+</html>
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<html data-require="math matrix">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>Determinant of a 2x2 matrix</title>
+ <script src="../khan-exercise.js"></script>
+</head>
+<body>
+ <div class="exercise">
+
+ <div class="vars">
+ <var id="MAT">makeMatrix(randRange(-2, 5, DIM, DIM))</var>
+ <var id="SOLN">matrixDet(MAT)</var>
+ <var id="PRETTY_MAT_ID">"\\textbf " + randFromArray("ABCDEF")</var>
+ </div>
+
+ <div class="problem">
+ <p>
+ <code><var>PRETTY_MAT_ID</var> = <var>printSimpleMatrix(MAT)</var></code>
+ </p>
+ </div>
+
+ <p class="question">
+ What is the determinant of <code><var>PRETTY_MAT_ID</var></code>?
+ </p>
+
+ <div class="solution">
+ <span class="sol"><var>SOLN</var></span>
+ </div>
+
+ <div class="problems">
+ <div>
+ <div class="vars" data-apply="prependVars">
+ <var id="DIM">2</var>
+ <var id="HINT_MAT">makeMatrix([["a","b"],["c","d"]])</var>
+ </div>
+ <div class="hints">
+ <div data-video-hint data-youtube-id="OU9sWHk_dlw"></div>
+ <div>
+ <code>
+ det(<var>PRETTY_MAT_ID</var>)
+ = <var>printSimpleMatrixDet(MAT)</var>
+ = <var>SOLN</var>
+ </code>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ </div>
+</body>
+</html>
@@ -0,0 +1,81 @@
+<!DOCTYPE html>
+<html data-require="math matrix">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>Determinant of a 3x3 matrix</title>
+ <script src="../khan-exercise.js"></script>
+</head>
+<body>
+ <div class="exercise">
+
+ <div class="vars">
+ <var id="MAT">makeMatrix(randRange(-2, 5, DIM, DIM))</var>
+ <var id="SOLN">matrixDet(MAT)</var>
+ <var id="PRETTY_MAT_ID">"\\textbf " + randFromArray("ABCDEF")</var>
+ </div>
+
+ <div class="problem">
+ <p>
+ <code><var>PRETTY_MAT_ID</var> = <var>printSimpleMatrix(MAT)</var></code>
+ </p>
+ </div>
+
+ <p class="question">
+ What is the determinant of <code><var>PRETTY_MAT_ID</var></code>?
+ </p>
+
+ <div class="solution">
+ <span class="sol"><var>SOLN</var></span>
+ </div>
+
+ <div class="problems">
+ <div>
+ <div class="vars" data-apply="prependVars">
+ <var id="DIM">3</var>
+ <var id="HINT_MAT">makeMatrix([["a","b","c"],["d","e","f"],["g","h","i"]])</var>
+ </div>
+ <div class="hints">
+ <div>
+ <p>The determinant of any 3x3 matrix can be computed the following way:</p>
+ <p>
+ <code>
+ <var>printSimpleMatrixDet(HINT_MAT)</var>
+ = <var>matrix3x3DetHint(HINT_MAT, true)</var>
+ </code>
+ </p>
+ </div>
+ <div>
+ <p>
+ <code>
+ = <var>matrix3x3DetHint(HINT_MAT)</var>
+ </code>
+ </p>
+ </div>
+ <div>
+ <p>In this specific case,</p>
+ <p>
+ <code>
+ <var>printSimpleMatrixDet(MAT)</var>
+ = <var>matrix3x3DetHint(MAT, true)</var>
+ </code>
+ </p>
+ </div>
+ <div>
+ <p>
+ <code>
+ = <var>matrix3x3DetHint(MAT)</var>
+ </code>
+ </p>
+ </div>
+ <div>
+ <code>
+ = <var>SOLN</var>
+ </code>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ </div>
+</body>
+</html>
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<html data-require="math matrix">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>Determinant of a 3x3 matrix</title>
+ <script src="../khan-exercise.js"></script>
+</head>
+<body>
+ <div class="exercise">
+
+ <div class="vars">
+ <var id="MAT">makeMatrix(randRange(-2, 5, DIM, DIM))</var>
+ <var id="SOLN">matrixDet(MAT)</var>
+ <var id="PRETTY_MAT_ID">"\\textbf " + randFromArray("ABCDEF")</var>
+ </div>
+
+ <div class="problem">
+ <p>
+ <code><var>PRETTY_MAT_ID</var> = <var>printSimpleMatrix(MAT)</var></code>
+ </p>
+ </div>
+
+ <p class="question">
+ What is the determinant of <code><var>PRETTY_MAT_ID</var></code>?
+ </p>
+
+ <div class="solution">
+ <span class="sol"><var>SOLN</var></span>
+ </div>
+
+ <div class="problems">
+ <div>
+ <div class="vars" data-apply="prependVars">
+ <var id="DIM">3</var>
+ <var id="HINT_MAT">makeMatrix([["a","b","c"],["d","e","f"],["g","h","i"]])</var>
+ </div>
+ <div class="hints">
+ <div data-video-hint data-youtube-id="v4MenooI1J0"></div>
+ <div>
+ <code>
+ det(<var>PRETTY_MAT_ID</var>)
+ = <var>printSimpleMatrixDet(MAT)</var>
+ = <var>SOLN</var>
+ </code>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ </div>
+</body>
+</html>
Oops, something went wrong.

0 comments on commit 2654ea6

Please sign in to comment.