Skip to content

# publicKhan/khan-exercises

### Subversion checkout URL

You can clone with HTTPS or Subversion.

Newer
Older
100644 51 lines (48 sloc) 2.276 kb
  9e59905f » marcia  2011-07-13 Add exercise -- multiplying decimals 1 2 3  4e4cb9b1 » beneater  2012-04-10 lint: tabs->spaces and jQuery->$for exercises 4 5 Adding and subtracting fractions 6  9e59905f » marcia  2011-07-13 Add exercise -- multiplying decimals 7 8  4e4cb9b1 » beneater  2012-04-10 lint: tabs->spaces and jQuery->$ for exercises 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
 9e59905f » marcia  2011-07-13 Add exercise -- multiplying decimals 19  4e4cb9b1 » beneater  2012-04-10 lint: tabs->spaces and jQuery->$for exercises 20 21 22 23 fraction( N1, D1 ) + fraction( N2, D2 ) = {?} 24 25 N1 / D1 + N2 / D2 26 27  9e59905f » marcia  2011-07-13 Add exercise -- multiplying decimals 28  4e4cb9b1 » beneater  2012-04-10 lint: tabs->spaces and jQuery->$ for exercises 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
 9e59905f » marcia  2011-07-13 Add exercise -- multiplying decimals 49 50
Something went wrong with that request. Please try again.