# Khan/khan-exercises

```per: https://trello.com/card/adding-and-subtracting-mixed-numbers/4d87e664967a0775082939ab/366
close #16082```
1 parent ac12d12 commit 9212f6faa6571742a53f2442c87d1afbeb717305 beneater committed Apr 13, 2012
 @@ -44,17 +44,17 @@

Separate the whole numbers from the fractional parts:

-

= \color{red}{W1} + \color{red}{fraction( N1, D1 )} SIGN \color{blue}{abs( W2 )} SIGN \color{blue}{fraction( N2, D2 )}

+

= \blue{W1} + \blue{fraction( N1, D1 )} SIGN \pink{abs( W2 )} SIGN \pink{fraction( N2, D2 )}

Bring the whole numbers together and the fractions together:

-

= \color{red}{W1} SIGN \color{blue}{abs( W2 )} + \color{red}{fraction( N1, D1 )} SIGN \color{blue}{fraction( N2, D2 )}

+

= \blue{W1} SIGN \pink{abs( W2 )} + \blue{fraction( N1, D1 )} SIGN \pink{fraction( N2, D2 )}

-

=W1 + W2 + \color{red}{fraction( N1, D1 )} SIGN \color{blue}{fraction( N2, D2 )}

+

=W1 + W2 + \blue{fraction( N1, D1 )} SIGN \pink{fraction( N2, D2 )}

@@ -73,6 +73,61 @@
+ +
+
+ -1 + "-" + randRange( 2, 19 ) + randRange( -W1 + 1, -1 ) + +
+ randRange( 3, 20 ) + D2 +
+
+ randRange( 1, D2 - 1 ) + D2 +
+ + D2 + getGCD( N1 - N2 , LCM ) +
+

+

expr(["+", W1, W2 + fraction( N2, D2 )]) = {?}

+
W1 + W2 + PM * N2 / D2
+
+
+

Convert W1+1 into=\blue{W1} + \blue{fraction( N1, D1)} before subtracting. So the problem becomes:

+

= \blue{W1}\blue{fraction( N1, D1 )} SIGN \pink{abs( W2 )}\pink{fraction( N2, D2 )}

+
+
+

Separate the whole numbers from the fractional parts:

+

= \blue{W1} + \blue{fraction( N1, D1 )} SIGN \pink{abs( W2 )} SIGN \pink{fraction( N2, D2 )}

+
+
+

Bring the whole numbers together and the fractions together:

+

= \blue{W1} SIGN \pink{abs( W2 )} + \blue{fraction( N1, D1 )} SIGN \pink{fraction( N2, D2 )}

+
+
+

+

=W1 + W2 + \blue{fraction( N1, D1 )} SIGN \pink{fraction( N2, D2 )}

+
+
+

+

= expr(["+", W1 + W2, fraction( N1 + PM * N2, D2 )])

+
+
+

Combine the whole and fractional parts into a mixed number:

+

= W1 + W2 + fraction( N1 - N2, D2)

+
+
+

Simplify to lowest terms:

+

= W1 + W2 + fractionReduce( N1 - N2 , LCM )

+
+
+
+
 @@ -44,22 +44,22 @@

Separate the whole numbers from the fractional parts:

-

= \color{red}{W1} + \color{red}{fraction( N1, D1 )} SIGN \color{blue}{abs( W2 )} SIGN \color{blue}{fraction( N2, D2 )}

+

= \blue{W1} + \blue{fraction( N1, D1 )} SIGN \pink{abs( W2 )} SIGN \pink{fraction( N2, D2 )}

Bring the whole numbers together and the fractions together:

-

= \color{red}{W1} SIGN \color{blue}{abs( W2 )} + \color{red}{fraction( N1, D1 )} SIGN \color{blue}{fraction( N2, D2 )}

+

= \blue{W1} SIGN \pink{abs( W2 )} + \blue{fraction( N1, D1 )} SIGN \pink{fraction( N2, D2 )}

-

=W1 + W2 + \color{red}{fraction( N1, D1 )} SIGN \color{blue}{fraction( N2, D2 )}

+

=W1 + W2 + \blue{fraction( N1, D1 )} SIGN \pink{fraction( N2, D2 )}

Simplify each fraction:

-

= W1+W2 + \color{red}{fraction( SIMP_N1, SIMP_D1 )} SIGN \color{blue}{fraction( SIMP_N2, SIMP_D2 )}

+

= W1+W2 + \blue{fraction( SIMP_N1, SIMP_D1 )} SIGN \pink{fraction( SIMP_N2, SIMP_D2 )}

@@ -83,6 +83,76 @@
+ +
+
+ -1 + "-" + randRange( 2, 19 ) + randRange( -W1 + 1, -1 ) +
+ randRange( 3, 20 ) + randRange( 3, 20 ) +
+
+ randRange( 1, D1 - 1 ) + randRange( 1, D2 - 1 ) +
+ getGCD( N1, D1 ) + N1 / GCD1 + D1 / GCD1 + getGCD( N2, D2 ) + N2 / GCD2 + D2 / GCD2 + getLCM( SIMP_D1, SIMP_D2 ) + getGCD( SIMP_N1 * LCM / SIMP_D1 + PM * SIMP_N2 * LCM / SIMP_D2 , LCM ) +
+

+

expr(["+", W1 + 1 + fraction( N1, D1 ), W2 + fraction( N2, D2 )]) = {?}

+
W1 + 1 + W2 + N1 / D1 + PM * N2 / D2
+
+
+

Simplify each fraction.

+

= \blue{W1 + 1fraction( SIMP_N1, SIMP_D1 )} SIGN \pink{abs( W2 )fraction( SIMP_N2, SIMP_D2 )}

+
+
+

Find a common denominator for the fractions:

+

= \blue{W1 + 1fraction( SIMP_N1 * LCM / SIMP_D1, LCM )}SIGN\pink{abs( W2 )fraction( SIMP_N2 * LCM / SIMP_D2, LCM )}

+
+
+

Convert \blue{W1 + 1fraction( SIMP_N1 * LCM / SIMP_D1, LCM)} to \blue{ W1 + fraction( LCM, LCM) + fraction( SIMP_N1 * LCM / SIMP_D1, LCM)}.

+
+
+

So the problem becomes:

+

\blue{W1fraction( LCM + SIMP_N1 * LCM / SIMP_D1, LCM)}SIGN\pink{abs( W2 )fraction( SIMP_N2 * LCM / SIMP_D2, LCM)}

+
+
+

Separate the whole numbers from the fractional parts:

+

= \blue{W1} + \blue{fraction( LCM + SIMP_N1 * LCM / SIMP_D1, LCM )} SIGN \pink{abs( W2 )} SIGN \pink{fraction( SIMP_N2 * LCM / SIMP_D2, LCM)}

+
+
+

Bring the whole numbers together and the fractions together:

+

= \blue{W1} SIGN \pink{abs( W2 )} + \blue{fraction( LCM + SIMP_N1 * LCM / SIMP_D1, LCM )} SIGN \pink{fraction( SIMP_N2 * LCM / SIMP_D2, LCM )}

+
+
+

+

=W1 + W2 + \blue{fraction( LCM + SIMP_N1 * LCM / SIMP_D1, LCM )} SIGN \pink{fraction( SIMP_N2 * LCM / SIMP_D2, LCM)}

+
+
+

+

= expr(["+", W1 + W2, fraction( (LCM + SIMP_N1 * LCM / SIMP_D1) + (PM * SIMP_N2 * LCM / SIMP_D2), LCM )])

+
+
+

Combine the whole and fractional parts into a mixed number:

+

= W1 + W2 + fraction( (LCM + SIMP_N1 * LCM / SIMP_D1) + PM * SIMP_N2 * LCM / SIMP_D2, LCM )

+
+
+

Simplify to lowest terms:

+

= W1 + W2 + fractionReduce( (LCM + SIMP_N1 * LCM / SIMP_D1) + PM * SIMP_N2 * LCM / SIMP_D2, LCM )

+
+
+
+