1 00:00:00,000 --> 00:00:00,880 2 00:00:00,880 --> 00:00:03,040 Welcome to the second presentation on functions. 3 00:00:03,040 --> 00:00:05,370 So let's take off where we left off before. 4 00:00:05,370 --> 00:00:08,509 I still apologize -- in retrospect that that 5 00:00:08,509 --> 00:00:09,769 whole foul food example. 6 00:00:09,769 --> 00:00:12,459 Well maybe it was helpful, so I'm going to leave it there. 7 00:00:12,460 --> 00:00:15,050 Let's do some more problems. 8 00:00:15,050 --> 00:00:17,050 I think the best thing is to keep doing problems with you 9 00:00:17,050 --> 00:00:19,050 and I think you'll see the example, and hopefully 10 00:00:19,050 --> 00:00:21,960 you'll actually see that functions are kind of fun. 11 00:00:21,960 --> 00:00:24,230 Let's do some more problems. 12 00:00:24,230 --> 00:00:25,839 Let's start off with an example, not too different 13 00:00:25,839 --> 00:00:26,629 than what we saw before. 14 00:00:26,629 --> 00:00:47,209 Let's say that g of x is equal to 1 if x is even, and 15 00:00:47,210 --> 00:00:56,030 it equals 0 if x is odd. 16 00:00:56,030 --> 00:01:15,594 And let's say f of x is equal to x plus 3 times g of x. 17 00:01:15,594 --> 00:01:18,239 18 00:01:18,239 --> 00:01:20,859 And let's say -- I'm going to make it really complicated -- 19 00:01:20,859 --> 00:01:22,129 well, actually I'm not going to make it any more 20 00:01:22,129 --> 00:01:22,989 complicated now. 21 00:01:22,989 --> 00:01:24,679 So let's try some problems. 22 00:01:24,680 --> 00:01:26,800 So let's give an example. 23 00:01:26,799 --> 00:01:32,079 What is f of 5. 24 00:01:32,079 --> 00:01:34,179 Well, it's really pretty straightforward. 25 00:01:34,180 --> 00:01:40,560 We take this 5 and we replace it for x in the function f. 26 00:01:40,560 --> 00:01:49,890 So f of 5 is equal to 5 plus 3 times g of 5, right? 27 00:01:49,890 --> 00:01:52,189 We just literally took this 5 and replace it everywhere 28 00:01:52,189 --> 00:01:53,359 where we see an x. 29 00:01:53,359 --> 00:01:57,069 If instead of a 5, I had like a dog here, it would be f of dog 30 00:01:57,069 --> 00:01:59,589 would equal dog plus 3 times g of dog. 31 00:01:59,590 --> 00:02:01,700 Not that that would necessarily make any sense, but 32 00:02:01,700 --> 00:02:02,969 you get the idea. 33 00:02:02,969 --> 00:02:06,530 So f of 5 equals 5 plus 3 times g of 5. 34 00:02:06,530 --> 00:02:07,290 But what does that equal? 35 00:02:07,290 --> 00:02:12,000 So the 5 stays the same, plus 3 times -- well what's g of 5? 36 00:02:12,000 --> 00:02:16,750 Well, if we put 5 here, if 5 is even we do 1, 37 00:02:16,750 --> 00:02:18,729 if five is odd we do 0. 38 00:02:18,729 --> 00:02:20,479 Well 5 is odd so it's a 0. 39 00:02:20,479 --> 00:02:22,269 So g of 5 is equal to 0. 40 00:02:22,270 --> 00:02:24,700 So this is 3 times 0. 41 00:02:24,699 --> 00:02:27,549 So this equals just 5, right, because 3 times 42 00:02:27,550 --> 00:02:29,400 0 is equal to 5. 43 00:02:29,400 --> 00:02:35,050 Well what would be f of 6? 44 00:02:35,050 --> 00:02:42,090 Well, f of 6 would equal 6 plus 3 times g of 6. 45 00:02:42,090 --> 00:02:44,650 46 00:02:44,650 --> 00:02:48,539 And once again, that equals 6 plus -- well, this time g of 47 00:02:48,539 --> 00:02:51,560 6 is, well, 6 is even, so 1. 48 00:02:51,560 --> 00:02:53,370 So g of 6 is equal to 1. 49 00:02:53,370 --> 00:02:56,300 So this equals 6 plus 3 times 1. 50 00:02:56,300 --> 00:03:01,080 So this equals 6 plus 3 which equals 9. 51 00:03:01,080 --> 00:03:02,820 I think you might be getting the idea now. 52 00:03:02,819 --> 00:03:05,139 At first when you see a problem with a lot of these functions, 53 00:03:05,139 --> 00:03:05,769 it seems very confusing. 54 00:03:05,770 --> 00:03:08,909 But if you just keep taking what's inside of the 55 00:03:08,909 --> 00:03:11,960 parentheses and replacing that for x and just keep moving 56 00:03:11,960 --> 00:03:15,689 along that way, you make a lot of progress on these problems. 57 00:03:15,689 --> 00:03:18,259 Let's try a harder one. 58 00:03:18,259 --> 00:03:27,370 Let's say I said that f of x is equal to x squared plus 1. 59 00:03:27,370 --> 00:03:45,439 Let's say that g of x is equal to 2x plus f of x minus 3. 60 00:03:45,439 --> 00:03:53,324 And h of x is equal to 5x. 61 00:03:53,324 --> 00:03:56,199 62 00:03:56,199 --> 00:03:58,439 Now I'm going to give you a tough problem. 63 00:03:58,439 --> 00:04:04,620 What is h of g of x? 64 00:04:04,620 --> 00:04:05,500 No. 65 00:04:05,500 --> 00:04:10,659 What is h of g of -- let's pick a number -- let's say 3? 66 00:04:10,659 --> 00:04:12,129 h of g of 3. 67 00:04:12,129 --> 00:04:14,310 Actually, we'll do examples in the future where we actually 68 00:04:14,310 --> 00:04:16,519 could leave the x there and we'll solve for it. 69 00:04:16,519 --> 00:04:21,810 But let's say this particular example, what is h of g of 3? 70 00:04:21,810 --> 00:04:24,050 At first you might say wow, this is crazy, Sal, I don't 71 00:04:24,050 --> 00:04:25,650 know how to even start here. 72 00:04:25,649 --> 00:04:27,199 But you just take it step-by-step. 73 00:04:27,199 --> 00:04:28,170 What can we figure out? 74 00:04:28,170 --> 00:04:30,350 Can we figure out what g of 3 is? 75 00:04:30,350 --> 00:04:31,540 Well sure. 76 00:04:31,540 --> 00:04:35,220 We could take the 3 and put it into the function g and 77 00:04:35,220 --> 00:04:37,000 see what it spits out. 78 00:04:37,000 --> 00:04:39,459 So let's work on g of 3 first. 79 00:04:39,459 --> 00:04:46,399 So, g of 3 equals -- well it's 2 times 3, right, we're just 80 00:04:46,399 --> 00:04:48,449 replacing wherever we see an x with a 3. 81 00:04:48,449 --> 00:04:56,969 So it's 2 times 3, so that's 6, plus f of -- what, we'll 82 00:04:56,970 --> 00:04:58,640 just replace the x again. 83 00:04:58,639 --> 00:05:02,139 3 minus 3, right? 84 00:05:02,139 --> 00:05:08,560 So this g of 3 is equal to 6 plus f of what? 85 00:05:08,560 --> 00:05:12,500 3 minus 3 is 0. 86 00:05:12,500 --> 00:05:15,199 Now we have to figure out f of 0 is. 87 00:05:15,199 --> 00:05:18,029 We have a definition here for f, so we just figure it out. 88 00:05:18,029 --> 00:05:24,039 f of 0 is equal to -- well, you replace the 0 here. 89 00:05:24,040 --> 00:05:26,810 So you get 0 squared, which is 0 plus 1. 90 00:05:26,810 --> 00:05:29,129 So it's f of 0 is 1. 91 00:05:29,129 --> 00:05:32,909 So you take that and you replace it for f of 0. 92 00:05:32,910 --> 00:05:39,360 So you get g of 3 is equal to 6 plus 1. 93 00:05:39,360 --> 00:05:44,819 So g of 3 is equal to 7, right? 94 00:05:44,819 --> 00:05:46,490 Now we know what g of 3 is equal to. 95 00:05:46,490 --> 00:05:49,470 We can substitute that back here. 96 00:05:49,470 --> 00:05:52,430 So that's the same thing -- we know g of 3 is equal to 7, 97 00:05:52,430 --> 00:05:56,920 so that's the same thing as h of 7. 98 00:05:56,920 --> 00:06:03,360 And h of 7 is just equal to 5 times 7 equals 35. 99 00:06:03,360 --> 00:06:06,060 So I think you're probably a little confused here, and I 100 00:06:06,060 --> 00:06:08,269 would have been if I was in your shoes. 101 00:06:08,269 --> 00:06:10,609 But the important thing is when you first see this problem 102 00:06:10,610 --> 00:06:13,730 you're like what can I tackle first? 103 00:06:13,730 --> 00:06:16,640 h of g of 3, it seems very confusing. 104 00:06:16,639 --> 00:06:18,389 Well, g of 3, can I tackle that? 105 00:06:18,389 --> 00:06:18,610 Sure. 106 00:06:18,610 --> 00:06:21,295 I have a definition of what the function g does when 107 00:06:21,295 --> 00:06:24,280 it's given an x, or in this case, was given a 3. 108 00:06:24,279 --> 00:06:25,189 And that's what we did. 109 00:06:25,189 --> 00:06:27,990 We figured out what g of 3 was first. 110 00:06:27,990 --> 00:06:30,410 And g of 3, we just have to do the 3, and we said well that's 111 00:06:30,410 --> 00:06:33,850 6 plus f of 3 minus 3, right? 112 00:06:33,850 --> 00:06:36,240 Because we just replaced that x with that 3. 113 00:06:36,240 --> 00:06:37,629 And we just kept solving. 114 00:06:37,629 --> 00:06:40,069 We figured out what f of 0 is up here. 115 00:06:40,069 --> 00:06:42,050 And we got g of 3 equals 7. 116 00:06:42,050 --> 00:06:44,290 Then we substituted that back in right here. 117 00:06:44,290 --> 00:06:49,200 We got h of 7 is equal to 35 because it was 5 times 7. 118 00:06:49,199 --> 00:06:50,699 Let's do some more problems. 119 00:06:50,699 --> 00:06:54,670 Actually, let's do another example with the same 120 00:06:54,670 --> 00:07:00,879 set of functions. 121 00:07:00,879 --> 00:07:02,980 I don't want to keep confusing you with new functions. 122 00:07:02,980 --> 00:07:08,259 Let me it erase this as fast as I can. 123 00:07:08,259 --> 00:07:10,925 I think I'm getting faster at this erasing business. 124 00:07:10,925 --> 00:07:15,160 125 00:07:15,160 --> 00:07:17,210 You can sit and think a little bit about what we just 126 00:07:17,209 --> 00:07:18,109 did while I erase. 127 00:07:18,110 --> 00:07:42,389 128 00:07:42,389 --> 00:07:44,529 So let's do another problem. 129 00:07:44,529 --> 00:07:56,529 What is f of h of 10? 130 00:07:56,529 --> 00:07:59,449 131 00:07:59,449 --> 00:08:05,079 Well, first we want to figure out what h of 10 is, right? 132 00:08:05,079 --> 00:08:06,509 Well, we could do it in a different way 133 00:08:06,509 --> 00:08:07,170 as we'll see later. 134 00:08:07,170 --> 00:08:10,100 But we can figure out what h of 10 is pretty easily. 135 00:08:10,100 --> 00:08:12,460 We take the 10, substitute it in for x. 136 00:08:12,459 --> 00:08:14,829 h of 10 is equal to 5 times x. 137 00:08:14,829 --> 00:08:17,909 In this case x is 10 so it equals 50. 138 00:08:17,910 --> 00:08:22,910 So we know h of 10 equals 50. 139 00:08:22,910 --> 00:08:25,010 So we know h of 10 equals 50, so we substitute 140 00:08:25,009 --> 00:08:25,819 that back in here. 141 00:08:25,819 --> 00:08:29,079 So we say f of h of 10 is the same thing as f of 50. 142 00:08:29,079 --> 00:08:32,379 143 00:08:32,379 --> 00:08:34,889 And then f of 50 is, I think pretty straightforward 144 00:08:34,889 --> 00:08:35,659 at this point. 145 00:08:35,659 --> 00:08:38,110 You just take that 50 and replace it back here. 146 00:08:38,110 --> 00:08:40,149 Well, it's 50 squared plus 1. 147 00:08:40,149 --> 00:08:42,689 Well, 50 squared is 2,500 plus 1. 148 00:08:42,690 --> 00:08:45,750 149 00:08:45,750 --> 00:08:49,409 That equals 2,501. 150 00:08:49,409 --> 00:09:01,929 What is g of h of 1? 151 00:09:01,929 --> 00:09:08,919 Well, we take h of 1, h of 1 is 5, so this is equal to g of 5. 152 00:09:08,919 --> 00:09:12,839 And g of 5, we just replace the 5 here, so g of 5 is equal to 2 153 00:09:12,840 --> 00:09:16,810 times 5 plus f of 5 minus 3. 154 00:09:16,809 --> 00:09:19,229 We just take wherever we saw an x and replace it with a 5. 155 00:09:19,230 --> 00:09:25,519 Well, that's equal to 2 times 5 is 10, plus f of 5 minus 3. 156 00:09:25,519 --> 00:09:27,730 Well 5 minus 3 is 2. 157 00:09:27,730 --> 00:09:29,950 Plus f of 2. 158 00:09:29,950 --> 00:09:31,470 What's f of 2? 159 00:09:31,470 --> 00:09:34,902 Well, 2 squared plus 1 is 5, right? f of 2 is 5 160 00:09:34,902 --> 00:09:36,629 -- 2 squared plus 1. 161 00:09:36,629 --> 00:09:41,399 So that equals 10 plus 5 which equals 15. 162 00:09:41,399 --> 00:09:43,340 If you're still confused, don't worry. 163 00:09:43,340 --> 00:09:45,990 I'm about to record some more problems that will give you 164 00:09:45,990 --> 00:09:49,779 even more examples of function problems. 165 00:09:49,779 --> 00:09:51,679 See you in the next presentation. 166 00:09:51,679 --> 00:09:52,979 Bye. 167 00:09:52,980 --> 00:09:53,580