# Khan/khan-exercises

Older
100644 114 lines (102 sloc) 4.49 KB
 71f1fb3 Add alternative hints to some exercises for A/B testing beneater authored Sep 11, 2012 1 2e59498 Oops.. adding the correct alternative exercises beneater authored Sep 11, 2012 2 3 4 5 Greatest common divisor 6 7 8 9
10
11 randRange( 1, 10 ) 12 randRange( 1, 10 ) 13 randRange( 1, 5 ) 14 15 A_START * FACTOR 16 B_START * FACTOR 17 getGCD( A, B ) 18 getFactors( A ) 19 getFactors( B ) 20 _.intersection( A_FACTORS, B_FACTORS ) 21
22 23
24
25
26

What is the greatest common divisor of A and B?

27

Another way to say this is:

28

\gcd(A, B) = {?}

29
30 31

GCD

32
33
34 35
36

37 The greatest common divisor is the largest number that divides evenly into both A and 38 B. 39

40 41

42 Start by thinking about all of the numbers that divide evenly into A. In other words, 43 what are the divisors of A? 44

45 46
47

48 The only divisor of 1 is 1 49 since that's the only number that divides evenly into 1: 50

51

52 The divisors of A are toSentence( getFactors( A ) ) 53 since those are all the numbers that divide evenly into A: 54

55

56 57 58 A \div \color{BLUE}{F} = A/F
59
60

61
62 63

64 Start by thinking about all of the numbers that divide evenly into B. In other words, 65 what are the divisors of B? 66

67 68
69

70 The only divisor of 1 is 1 71 since that's the only number that divides evenly into 1: 72

73

74 The divisors of B are toSentence( getFactors( B ) ) 75 since those are all the numbers that divide evenly into B: 76

77

78 79 80 B \div \color{GREEN}{F} = B/F
81
82

83
84 85

86 To find the common divisors, find the all the divisors of A and 87 divisors of B that are the same. 88

89 90
91

92 The only common divisor of A and B is 93 GCD since that's the only number that divides 94 evenly into both A and B. 95

96

97 The common divisors of A and B are 98 toSentence( COMMON_FACTORS ) since each of those numbers divides 99 evenly into both A and B. We're interested in the greatest common divisor. 100

101
102 jQuery( "span.hint_pink" ).show(); 103
104
105 106

107 The greatest common divisor of A and B is GCD. 108 In other words, \gcd(A, B) = GCD. 109

110
111
112 71f1fb3 Add alternative hints to some exercises for A/B testing beneater authored Sep 11, 2012 113
Something went wrong with that request. Please try again.