# Khan/khan-exercises

### Subversion checkout URL

You can clone with
or
.
Older
100644 52 lines (48 sloc) 2.868 kb
 25bce65 Sequences and series spicyj authored Feb 15, 2013 1 cde9e9f Re-run the exercises through the updated cleaner. jeresig authored Apr 24, 2013 2 3 0f0c630 Clean up the exercise files using the new cleaning utility. (II) cbhl authored Apr 16, 2013 4 25bce65 Sequences and series spicyj authored Feb 15, 2013 5 Geometric sequences 1 ac1415e Use requirejs for module loading spicyj authored Mar 5, 2014 6 25bce65 Sequences and series spicyj authored Feb 15, 2013 7 8 9
10
11
0f0c630 Clean up the exercise files using the new cleaning utility. (II) cbhl authored Apr 16, 2013 12
25bce65 Sequences and series spicyj authored Feb 15, 2013 13 randRangeNonZero(-8, 8) 14 randFromArray([-1, 1]) * randRange(1, 4) 0f0c630 Clean up the exercise files using the new cleaning utility. (II) cbhl authored Apr 16, 2013 15 randRange(1, 4) 25bce65 Sequences and series spicyj authored Feb 15, 2013 16 randRange(3, 5) 17 18 randRange(-N - 1, 0) 19 _.map(_.range(N), function(i) { 20 if (i + OFFSET >= 0) { 21 return reduce(A * pow(RN, i + OFFSET), pow(RD, i + OFFSET)); 22 } else { 23 return reduce(A * pow(RD, -i - OFFSET), pow(RN, -i - OFFSET)); 24 } 25 }) 26 reduce(A * pow(RN, N + OFFSET), pow(RD, N + OFFSET)) 27 28 fractionReduce(RN, RD) 29 _.map(GIVEN, function(f) { 30 return fractionReduce.apply(KhanUtil, f); 31 }) 32
33 34
b0a7644 Get rid of cardinal() everywhere escept the exercise testing cardinal… csilvers authored Sep 9, 2013 35

The first cardinalThrough20(N) terms of a geometric sequence are given:

25bce65 Sequences and series spicyj authored Feb 15, 2013 36

GIVEN_TEX.join(","), \ldots

b0a7644 Get rid of cardinal() everywhere escept the exercise testing cardinal… csilvers authored Sep 9, 2013 37

What is the ordinalThrough20(N + 1) term in the sequence?

25bce65 Sequences and series spicyj authored Feb 15, 2013 38
39
A * pow(RN / RD, N + OFFSET)
40 41
42

In any geometric sequence, each term is equal to the previous term times the common ratio.

43

Thus, the second term is equal to the first term times the common ratio. In this sequence, the second term, GIVEN_TEX[1], is R_TEX times the first term, GIVEN_TEX[0].

44

Therefore, the common ratio is R_TEX.

b0a7644 Get rid of cardinal() everywhere escept the exercise testing cardinal… csilvers authored Sep 9, 2013 45

The ordinalThrough20(N + 1) term in the sequence is equal to the ordinalThrough20(N) term times the common ratio, or GIVEN_TEX[N - 1] \cdot R_TEX = fractionReduce(A * pow(RN, N + OFFSET), pow(RD, N + OFFSET)).

25bce65 Sequences and series spicyj authored Feb 15, 2013 46
47
48
49
cde9e9f Re-run the exercises through the updated cleaner. jeresig authored Apr 24, 2013 50 51
Something went wrong with that request. Please try again.