# Khan/khan-exercises

Older
100644 51 lines (48 sloc) 2.22 KB
 9e59905 Add exercise -- multiplying decimals marcia authored Jul 13, 2011 1 2 3 4e4cb9b lint: tabs->spaces and jQuery->$for exercises beneater authored Apr 10, 2012 4 5 Adding and subtracting fractions 6 9e59905 Add exercise -- multiplying decimals marcia authored Jul 14, 2011 7 8 4e4cb9b lint: tabs->spaces and jQuery->$ for exercises beneater authored Apr 10, 2012 9
10
11 randRangeNonZero( -9, 9 ) 12 randRangeNonZero( -9, 9 ) 13 randRangeExclude( 2, 9, [ N1, -N1 ] ) 14 randRangeExclude( 2, 9, [ N2, -N2 ] ) 15 getLCM( D1, D2 ) 16 LCM / D1 17 LCM / D2 18
9e59905 Add exercise -- multiplying decimals marcia authored Jul 14, 2011 19 4e4cb9b lint: tabs->spaces and jQuery->$for exercises beneater authored Apr 10, 2012 20 21 22 23 fraction( N1, D1 ) + fraction( N2, D2 ) = {?} 24 25 N1 / D1 + N2 / D2 26 27 9e59905 Add exercise -- multiplying decimals marcia authored Jul 14, 2011 28 4e4cb9b lint: tabs->spaces and jQuery->$ for exercises beneater authored Apr 10, 2012 29
30

First, we need to find a common denominator. The least common multiple of D1 and D2 is the smallest possible common denominator.

31

\lcm(D1, D2) = LCM

32

Now, we need to change both fractions to have a denominator of LCM.

33

\begin{align*}fraction( N1, D1 )\cdot fraction( F1, F1 ) &= fraction( N1 * F1, LCM )\\ 34 fraction( N2, D2 )\cdot fraction( F2, F2 ) &= fraction( N2 * F2, LCM )\end{align*}

35
36

So, the problem becomes:

37

fraction( N1 * F1, LCM ) + fraction( N2 * F2, LCM ) = {?}

38
39
40

N2 > 0 ? "Add" : "Subtract" the numerators.

41

fraction( F1 * N1 + F2 * N2, LCM)

42
43
44

Simplify.

45

fractionReduce( F1 * N1 + F2 * N2, LCM )

46
47
48
9e59905 Add exercise -- multiplying decimals marcia authored Jul 14, 2011 49 50
Something went wrong with that request. Please try again.