1 00:00:00,580 --> 00:00:02,920 PROFESSOR: The elements that have inverses modulo 2 00:00:02,920 --> 00:00:05,580 and will be particularly important to us. 3 00:00:05,580 --> 00:00:07,820 And so the first question is how many of 4 00:00:07,820 --> 00:00:11,770 them are there, which is what Euler's function tells us. 5 00:00:11,770 --> 00:00:15,540 So the definition of Euler's function, phi of n, 6 00:00:15,540 --> 00:00:20,520 is it's the number of integers in the remainder 7 00:00:20,520 --> 00:00:23,240 interval from 0 to n minus 1 such 8 00:00:23,240 --> 00:00:25,350 that k is relatively prime to n. 9 00:00:25,350 --> 00:00:27,890 So remember, there's the notation for the remainder 10 00:00:27,890 --> 00:00:31,030 interval that includes 0 and excludes n. 11 00:00:31,030 --> 00:00:35,500 And another way to say relatively prime to n 12 00:00:35,500 --> 00:00:41,170 is to say the gcd of k and n is 1. 13 00:00:41,170 --> 00:00:44,460 So let's define that set of numbers 14 00:00:44,460 --> 00:00:48,460 that we're interested in-- gcd1 of n [? be ?] 15 00:00:48,460 --> 00:00:53,020 those numbers that have a gcd of 1 with n. 16 00:00:53,020 --> 00:00:55,920 That is, the numbers that have inverses and the numbers that 17 00:00:55,920 --> 00:00:58,660 are cancellable modulo n. 18 00:00:58,660 --> 00:01:01,710 So what it means is that phi of n 19 00:01:01,710 --> 00:01:05,690 is precisely equal to the size of gcd1 of n. 20 00:01:05,690 --> 00:01:09,300 Now, some authors call gcd1 n star. 21 00:01:09,300 --> 00:01:12,210 I didn't find that a very informative notation 22 00:01:12,210 --> 00:01:14,220 and so I'm not using it. 23 00:01:14,220 --> 00:01:16,700 phi of n is also, for your information, called 24 00:01:16,700 --> 00:01:19,500 Euler's totient function, but we'll just 25 00:01:19,500 --> 00:01:23,760 stick to calling it phi or Euler's phi. 26 00:01:23,760 --> 00:01:27,280 So let's look at an example-- gcd1 of 7. 27 00:01:27,280 --> 00:01:30,170 The numbers that are relatively prime to 7 28 00:01:30,170 --> 00:01:34,000 are all the positive numbers less than 7 because 7 is prime. 29 00:01:34,000 --> 00:01:38,120 So it's the set 1, 2, 3, 4, 5, 6. 30 00:01:38,120 --> 00:01:42,970 gcd1 of 12 is the numbers that have 31 00:01:42,970 --> 00:01:45,080 no factor in common with 12. 32 00:01:45,080 --> 00:01:48,510 They are the numbers in green below. 33 00:01:48,510 --> 00:01:50,710 And the other red numbers do have 34 00:01:50,710 --> 00:01:54,220 a number in common with 12-- do have a prime in common with 12. 35 00:01:54,220 --> 00:01:57,880 The pattern here is not so apparent. 36 00:01:57,880 --> 00:02:02,810 Anyway, phi of 7 is the size of gcd1 of 7-- namely 37 00:02:02,810 --> 00:02:06,180 the size of the set 1 through 6, which is 6. 38 00:02:06,180 --> 00:02:11,390 gcd 12 determines phi of 12. phi of 12 39 00:02:11,390 --> 00:02:16,830 is the number of green elements, which is 4. 40 00:02:16,830 --> 00:02:18,960 OK. 41 00:02:18,960 --> 00:02:21,760 A simple rule for calculating phi. 42 00:02:21,760 --> 00:02:23,880 When phi is prime we've already indicated, 43 00:02:23,880 --> 00:02:26,880 namely, everything-- every positive number 44 00:02:26,880 --> 00:02:29,610 less than p is relatively prime to p. 45 00:02:29,610 --> 00:02:33,480 And so phi of p is simply p minus 1. 46 00:02:33,480 --> 00:02:35,910 Let's look at a more important example, 47 00:02:35,910 --> 00:02:37,880 or illustrative example-- namely, phi of 9. 48 00:02:37,880 --> 00:02:39,260 Well, OK. 49 00:02:39,260 --> 00:02:41,470 So there are the candidate numbers from 0 50 00:02:41,470 --> 00:02:46,250 through 8, and which ones are relatively prime to 9? 51 00:02:46,250 --> 00:02:48,120 Well, it's relatively prime to 9 if and only 52 00:02:48,120 --> 00:02:51,280 if it's relatively prime to 3. 53 00:02:51,280 --> 00:02:52,980 Now, which numbers in this interval 54 00:02:52,980 --> 00:02:56,520 are relatively prime to-- are relatively prime to 3, 55 00:02:56,520 --> 00:02:59,060 or, rather, are not relatively prime to 3? 56 00:02:59,060 --> 00:03:03,100 Well, it's every third number that's divisible by 3. 57 00:03:03,100 --> 00:03:04,710 So, those are the bad ones. 58 00:03:04,710 --> 00:03:07,550 If we subtract the bad ones, we're left with the good ones-- 59 00:03:07,550 --> 00:03:09,580 the ones that are relatively prime. 60 00:03:09,580 --> 00:03:13,240 So a phi of 9 is simply the set of all the numbers 61 00:03:13,240 --> 00:03:18,400 minus 1/3 of 9, which is the bad one-- bad one's namely 6. 62 00:03:18,400 --> 00:03:20,990 This generalizes to a power of a prime. 63 00:03:20,990 --> 00:03:24,680 If k is a positive integer then phi of p 64 00:03:24,680 --> 00:03:27,250 to the k-- the reasoning is that a number is relatively 65 00:03:27,250 --> 00:03:29,130 prime to the p to the k if and only 66 00:03:29,130 --> 00:03:32,090 if it's relatively prime to p. 67 00:03:32,090 --> 00:03:34,870 p divides every pth number, so one pth 68 00:03:34,870 --> 00:03:37,020 of the numbers in the interval are bad, 69 00:03:37,020 --> 00:03:45,260 which means that phi of p is the good ones minus 1 pth of p 70 00:03:45,260 --> 00:03:46,360 to the k. 71 00:03:46,360 --> 00:03:49,810 Namely, phi of p to the k is p to the k minus p to the k 72 00:03:49,810 --> 00:03:52,370 over p, which can also be expressed 73 00:03:52,370 --> 00:03:55,020 in a more standard form-- p to the k 74 00:03:55,020 --> 00:03:58,650 minus p to the power k minus 1. 75 00:03:58,650 --> 00:04:03,610 And that knocks off the story of phi 76 00:04:03,610 --> 00:04:07,199 to the p for powers of primes. 77 00:04:07,199 --> 00:04:09,240 Well, suppose you're dealing with a number that's 78 00:04:09,240 --> 00:04:10,960 not a power of a prime. 79 00:04:10,960 --> 00:04:15,900 And there's one very elegant little fact about phi 80 00:04:15,900 --> 00:04:19,200 that explains how to deal with non powers of primes. 81 00:04:19,200 --> 00:04:23,300 Namely, if a and b are relatively prime, 82 00:04:23,300 --> 00:04:27,070 then phi of a b is simply gotten by computing phi of a 83 00:04:27,070 --> 00:04:30,010 and multiplying it by phi of b. 84 00:04:30,010 --> 00:04:33,100 This property of phi is called multiplicativity, by the way. 85 00:04:33,100 --> 00:04:35,050 It comes up a lot in number theory. 86 00:04:35,050 --> 00:04:37,600 A function is multiplicative when 87 00:04:37,600 --> 00:04:40,750 its value at a product of relatively prime numbers 88 00:04:40,750 --> 00:04:43,980 is the product of the values at those two 89 00:04:43,980 --> 00:04:45,130 relatively prime numbers. 90 00:04:45,130 --> 00:04:47,390 So phi is multiplicative. 91 00:04:47,390 --> 00:04:54,010 Now, the proof of that-- one proof is on problem set 5, 92 00:04:54,010 --> 00:04:57,050 and there's another proof that we'll see in a couple of weeks 93 00:04:57,050 --> 00:05:00,110 when we get into counting the inclusion-exclusion principle. 94 00:05:00,110 --> 00:05:02,920 Let's just use this fact about phi-- 95 00:05:02,920 --> 00:05:06,040 the multiplicity of phi-- multiplicativity of phi 96 00:05:06,040 --> 00:05:09,170 to see how it lets us calculate phi of an arbitrary number. 97 00:05:09,170 --> 00:05:11,910 So, in particular, phi of 12-- which looked complicated 98 00:05:11,910 --> 00:05:14,900 earlier-- well, 12 is 3 times 4. 99 00:05:14,900 --> 00:05:18,990 So that means that phi of 12 is phi of 3 times phi of 4. 100 00:05:18,990 --> 00:05:21,310 But now I'm in great shape because 3 101 00:05:21,310 --> 00:05:23,940 is a power of a prime, namely 3 to the 1. 102 00:05:23,940 --> 00:05:27,700 And 4 is a power of a prime, namely 2 squared. 103 00:05:27,700 --> 00:05:31,890 So applying the power of prime formulas, I get that phi of 3 104 00:05:31,890 --> 00:05:36,690 is 3 times 1 times 2 squared minus 2 to the 2 minus 1, 105 00:05:36,690 --> 00:05:41,110 which simplifies to 4, which is the answer that we saw before. 106 00:05:41,110 --> 00:05:44,200 And the punchline for why we're examining phi 107 00:05:44,200 --> 00:05:46,440 is Euler's theorem, which tells us 108 00:05:46,440 --> 00:05:51,890 how powers of numbers in gcd1 of n behave. 109 00:05:51,890 --> 00:05:55,670 Namely, that if k is relatively prime to n, then 110 00:05:55,670 --> 00:05:59,220 if you raise k to the power phi of n, 111 00:05:59,220 --> 00:06:03,136 it's congruent to 1 mod n. 112 00:06:03,136 --> 00:06:05,140 And that will lead us. 113 00:06:05,140 --> 00:06:07,480 In the next section we will look at the proof 114 00:06:07,480 --> 00:06:09,960 of Euler's theorem.