# Khan/khan-exercises

lint: tabs->spaces and jQuery->\$ for exercises

1 parent 8da1987 commit 4e4cb9b1c8e0fbd044851f51f4a8d6dda475655b beneater committed Apr 10, 2012
Showing 367 changed files with 41,787 additions and 41,787 deletions.
 @@ -1,53 +1,53 @@ - - Absolute value - + + Absolute value + -
-
- rand(5) > 0 ? randRange( 1, 9 ) : 0 - rand(3) > 0 ? "." + randRange(1, 9) : "" - randFromArray(["", "-"]) -
+
+
+ rand(5) > 0 ? randRange( 1, 9 ) : 0 + rand(3) > 0 ? "." + randRange(1, 9) : "" + randFromArray(["", "-"]) +
-
-
-
-

What is \lvert SIGN + INT + FRAC \rvert?

-
-
INT + FRAC
-
-
+
+
+
+

What is \lvert SIGN + INT + FRAC \rvert?

+
+
INT + FRAC
+
+
-
-
- init({ - range: [ [-1, 11], [-1, 1] ] - }); - var start = 0; - var end = 10; - var originX = 0; - var x = abs( INT ) + FRAC; - if ( SIGN === "-" ) { - start = -10; - end = 0; - originX = 10; - x = 10 - x; - } - numberLine( start, end ); - style({ stroke: "#6495ED", fill: "#6495ED" }); - graph.pt = circle( [ x, 0 ], 0.15 ); - style({ stroke: "#FFA500", fill: "#FFA500", strokeWidth: 3.5, arrows: "->" }); - path( [ [ originX, 0 ], [ x, 0 ] ] ); - circle( [ originX, 0 ], 0.10 ); - graph.pt.toFront(); -
-

The distance from 0 to SIGN + INT + FRAC is INT + FRAC, which equals the absolute value.

-

In other words, INT + FRAC is the non-negative version of SIGN + INT + FRAC.

-
-
+
+
+ init({ + range: [ [-1, 11], [-1, 1] ] + }); + var start = 0; + var end = 10; + var originX = 0; + var x = abs( INT ) + FRAC; + if ( SIGN === "-" ) { + start = -10; + end = 0; + originX = 10; + x = 10 - x; + } + numberLine( start, end ); + style({ stroke: "#6495ED", fill: "#6495ED" }); + graph.pt = circle( [ x, 0 ], 0.15 ); + style({ stroke: "#FFA500", fill: "#FFA500", strokeWidth: 3.5, arrows: "->" }); + path( [ [ originX, 0 ], [ x, 0 ] ] ); + circle( [ originX, 0 ], 0.10 ); + graph.pt.toFront(); +
+

The distance from 0 to SIGN + INT + FRAC is INT + FRAC, which equals the absolute value.

+

In other words, INT + FRAC is the non-negative version of SIGN + INT + FRAC.

+
+
 @@ -1,130 +1,130 @@ - - Absolute value equations - + + Absolute value equations + -
-
- randRange( 2, 10 ) - randRangeNonZero( -10, 10 ) - randRange( 2, 10 ) - randRangeNonZero( 2, 10 ) - fractionReduce( D - B, A - C ) - - - (function() { - if ( ( D - B ) / ( A - C) > 0 ) { - return "<code>" - + "x = " - + fractionReduce( -1 * abs( D - B ), abs( A - C ) ) - + "\\text{ or }" - + "x = " - + fractionReduce( abs( D - B ), abs( A - C ) ) - + "</code>"; - } else { - return "No solution"; - } - })() - - - (function() { - var choices = []; +
+
+ randRange( 2, 10 ) + randRangeNonZero( -10, 10 ) + randRange( 2, 10 ) + randRangeNonZero( 2, 10 ) + fractionReduce( D - B, A - C ) + + + (function() { + if ( ( D - B ) / ( A - C) > 0 ) { + return "<code>" + + "x = " + + fractionReduce( -1 * abs( D - B ), abs( A - C ) ) + + "\\text{ or }" + + "x = " + + fractionReduce( abs( D - B ), abs( A - C ) ) + + "</code>"; + } else { + return "No solution"; + } + })() + + + (function() { + var choices = []; - for ( var i = 0; i < 4; i++ ) { - var choice = "<code>"; - var nOffset = randRange( 1, 10 ); - var dOffset = randRangeExclude( 1, 10, [ C - A ] ); - if ( D - B + nOffset === 0 ) { - choice += "x = 0"; - } else { - choice += "x = " - + fractionReduce( -1 * abs( D - B + nOffset ), abs( A - C + dOffset ) ) - + "\\text{ or }" - + "x = " - + fractionReduce( abs( D - B + nOffset ), abs( A - C + dOffset ) ); - } - choice += "</code>"; - choices.unshift( choice ); - } + for ( var i = 0; i < 4; i++ ) { + var choice = "<code>"; + var nOffset = randRange( 1, 10 ); + var dOffset = randRangeExclude( 1, 10, [ C - A ] ); + if ( D - B + nOffset === 0 ) { + choice += "x = 0"; + } else { + choice += "x = " + + fractionReduce( -1 * abs( D - B + nOffset ), abs( A - C + dOffset ) ) + + "\\text{ or }" + + "x = " + + fractionReduce( abs( D - B + nOffset ), abs( A - C + dOffset ) ); + } + choice += "</code>"; + choices.unshift( choice ); + } - if ( ( D - B ) / ( A - C ) > 0 ) { - choices.shift(); - choices.unshift( SOLUTION ); - choices = shuffle( choices ); - choices.push( "No solution"); - } else { - choices = shuffle( choices ); - choices.push( SOLUTION ); - } + if ( ( D - B ) / ( A - C ) > 0 ) { + choices.shift(); + choices.unshift( SOLUTION ); + choices = shuffle( choices ); + choices.push( "No solution"); + } else { + choices = shuffle( choices ); + choices.push( SOLUTION ); + } - return choices; - })() -
+ return choices; + })() +
-
-
-

Solve for x:

-
A|x| + B = C|x| + D
+
+
+

Solve for x:

+
A|x| + B = C|x| + D
-

SOLUTION

+

SOLUTION

-
-
• choice
• -
-
-
+
+
• choice
• +
+
+
-
-
-
-

Subtract C|x| from both sides:

-

(A|x| + B) - C|x| = (C|x| + D) - C|x|

-

A - C|x| + B = D

-
-
-

B > 0 ? "Subtract" : "Add" abs(B) B > 0 ? "from" : "to" both sides:

-

(A - C|x| + B) + -B = D + -B

-

A - C|x| = D - B

-
-
-

Divide both sides by A - C.

-

\frac{A - C|x|}{A - C} = \frac{D - B}{A - C}

-
-
-

Simplify.

-

|x| = SIMPLIFIED

-
-
-
-
-

Subtract A|x| from both sides:

-

(A|x| + B) - A|x| = (C|x| + D) - A|x|

-

B = C - A|x| + D

-
-
-

D > 0 ? "Subtract" : "Add" abs(D) D > 0 ? "from" : "to" both sides:

-

B + -D = (C - A|x| + D) + -D

-

B - D = C - A|x|

-
-
-

Divide both sides by C - A.

-

\frac{B - D}{C - A} = \frac{C - A|x|}{C - A}

-
-
-

Simplify.

-

SIMPLIFIED = |x|

-
-
-

- Thus, the correct answer is SOLUTION. -

-

- The absolute value cannot be negative. Therefore, there is no solution. -

-
-
+
+
+
+

Subtract C|x| from both sides:

+

(A|x| + B) - C|x| = (C|x| + D) - C|x|

+

A - C|x| + B = D

+
+
+

B > 0 ? "Subtract" : "Add" abs(B) B > 0 ? "from" : "to" both sides:

+

(A - C|x| + B) + -B = D + -B

+

A - C|x| = D - B

+
+
+

Divide both sides by A - C.

+

\frac{A - C|x|}{A - C} = \frac{D - B}{A - C}

+
+
+

Simplify.

+

|x| = SIMPLIFIED

+
+
+
+
+

Subtract A|x| from both sides:

+

(A|x| + B) - A|x| = (C|x| + D) - A|x|

+

B = C - A|x| + D

+
+
+

D > 0 ? "Subtract" : "Add" abs(D) D > 0 ? "from" : "to" both sides:

+

B + -D = (C - A|x| + D) + -D

+

B - D = C - A|x|

+
+
+

Divide both sides by C - A.

+

\frac{B - D}{C - A} = \frac{C - A|x|}{C - A}

+
+
+

Simplify.

+

SIMPLIFIED = |x|

+
+
+

+ Thus, the correct answer is SOLUTION. +

+

+ The absolute value cannot be negative. Therefore, there is no solution. +

+
+