1 00:00:00,000 --> 00:00:01,199 2 00:00:01,199 --> 00:00:03,740 Welcome to the presentation on functions. 3 00:00:03,740 --> 00:00:06,330 Functions are something that, when I first learned it, it 4 00:00:06,330 --> 00:00:08,800 was kind of like I had a combination of I was 1, 5 00:00:08,800 --> 00:00:11,280 confused, and at the same time, I was like, well what's even 6 00:00:11,279 --> 00:00:12,709 the point of learning this? 7 00:00:12,710 --> 00:00:16,310 So hopefully, at least in this introduction lecture, we can 8 00:00:16,309 --> 00:00:19,070 get at least a very general sense of what a function is 9 00:00:19,070 --> 00:00:21,469 and why it might be useful. 10 00:00:21,469 --> 00:00:23,559 So let's just start off with just the overall 11 00:00:23,559 --> 00:00:24,570 concept of a function. 12 00:00:24,570 --> 00:00:27,449 A function is something that you can give it an input-- and 13 00:00:27,449 --> 00:00:29,349 we'll start with just one input, but actually you can 14 00:00:29,350 --> 00:00:32,160 give it multiple inputs-- you give a function an input, 15 00:00:32,159 --> 00:00:35,029 let's call that input x. 16 00:00:35,030 --> 00:00:39,420 And you can view a function as-- I guess a bunch of 17 00:00:39,420 --> 00:00:41,079 different ways you can view it. 18 00:00:41,079 --> 00:00:41,820 I don't know if you're familiar with the 19 00:00:41,820 --> 00:00:42,859 concept of a black box. 20 00:00:42,859 --> 00:00:45,060 A black box is kind of a box, you don't know what's inside of 21 00:00:45,060 --> 00:00:49,340 it, but if you put something into it like this x, and let's 22 00:00:49,340 --> 00:00:52,440 call that box-- let's say the function is called f, then 23 00:00:52,439 --> 00:00:56,759 it'll output what we call f of x. 24 00:00:56,759 --> 00:00:59,179 I know this terminology might seem a little confusing at 25 00:00:59,179 --> 00:01:03,820 first, but let's make some-- I guess, let's define what's 26 00:01:03,820 --> 00:01:05,670 inside the box in different ways. 27 00:01:05,670 --> 00:01:14,329 Let's say that the function was-- let's say that f of x is 28 00:01:14,329 --> 00:01:19,239 equal to x squared plus 1. 29 00:01:19,239 --> 00:01:22,280 Then, if I were to say what is f of-- let's 30 00:01:22,280 --> 00:01:25,870 say, what's f of 2? 31 00:01:25,870 --> 00:01:28,050 Well that means we're taking 2 and we're going to 32 00:01:28,049 --> 00:01:30,359 put it into the box. 33 00:01:30,359 --> 00:01:32,969 And I want to know what comes out of the box 34 00:01:32,969 --> 00:01:34,450 when I put 2 into it. 35 00:01:34,450 --> 00:01:38,430 Well inside the box, we know we do this to the input. 36 00:01:38,430 --> 00:01:42,060 We take the x, we square it, and we add 1, so f of 2 is 2 37 00:01:42,060 --> 00:01:44,500 squared, which is 4, plus 1. 38 00:01:44,500 --> 00:01:47,040 Which is equal to 5. 39 00:01:47,040 --> 00:01:47,900 I know what you're thinking. 40 00:01:47,900 --> 00:01:50,510 Probably like, well, Sal, this just seems like a very 41 00:01:50,510 --> 00:01:55,469 convoluted way of substituting x into an equation and just 42 00:01:55,469 --> 00:01:56,579 finding out the result. 43 00:01:56,579 --> 00:01:59,399 And I agree with you right now. 44 00:01:59,400 --> 00:02:02,770 But as you'll see, a function can become kind of a more 45 00:02:02,769 --> 00:02:05,420 general thing than just an equation. 46 00:02:05,420 --> 00:02:09,009 For example, let me say-- let me actually-- actually not, 47 00:02:09,009 --> 00:02:10,530 let me not erase this. 48 00:02:10,530 --> 00:02:13,150 Let me define a function as this. 49 00:02:13,150 --> 00:02:24,560 f of x is equal to x squared plus 1, if x is even, 50 00:02:24,560 --> 00:02:29,819 and it equals x squared minus 1 if x is odd. 51 00:02:29,819 --> 00:02:32,799 52 00:02:32,800 --> 00:02:35,390 I know this would have been-- this is something that we've 53 00:02:35,389 --> 00:02:36,429 never really seen before. 54 00:02:36,430 --> 00:02:40,319 This isn't just what I would call an analytic expression, 55 00:02:40,319 --> 00:02:43,539 this isn't just x plus something squared. 56 00:02:43,539 --> 00:02:45,469 We're actually saying, depending on what type of x you 57 00:02:45,469 --> 00:02:47,849 put in, we're going to do a different thing to that x. 58 00:02:47,849 --> 00:02:49,479 So let me ask you a question. 59 00:02:49,479 --> 00:02:53,469 What's f of 2 in this example? 60 00:02:53,469 --> 00:02:57,930 Well if we put 2 here, it says if x is even you do this one, 61 00:02:57,930 --> 00:02:59,469 if x is odd you do this one. 62 00:02:59,469 --> 00:03:01,479 Well, 2 is even, so we do this top one. 63 00:03:01,479 --> 00:03:05,829 So we'd say 2 squared plus 1, well that equals 5. 64 00:03:05,830 --> 00:03:09,230 But then, what's f of 3? 65 00:03:09,229 --> 00:03:12,179 Well if we put the 3 in here, we'd use this 66 00:03:12,180 --> 00:03:13,930 case, because 3 is odd. 67 00:03:13,930 --> 00:03:18,409 So we do 3 squared minus 1. f of 3 is equal to 8. 68 00:03:18,409 --> 00:03:22,590 So notice, this was a little bit more I guess you could 69 00:03:22,590 --> 00:03:25,719 even say abstract or unusual in this case. 70 00:03:25,719 --> 00:03:27,526 I'm going to keep doing examples of functions and 71 00:03:27,526 --> 00:03:32,589 I'm going to show you how general this idea can be. 72 00:03:32,590 --> 00:03:35,379 And if you get confused, I'm going to show you that the 73 00:03:35,379 --> 00:03:37,250 actual function problems you're going to encounter are 74 00:03:37,250 --> 00:03:38,560 actually not that hard to do. 75 00:03:38,560 --> 00:03:41,000 I just want to make sure that you least get exposed to kind 76 00:03:41,000 --> 00:03:44,840 of the general idea of what a function is. 77 00:03:44,840 --> 00:03:49,920 You can view almost anything in the world as a function. 78 00:03:49,919 --> 00:03:53,739 Let's say that there is a function called Sal, because, 79 00:03:53,740 --> 00:03:54,835 you know, that's my name. 80 00:03:54,835 --> 00:03:58,620 81 00:03:58,620 --> 00:04:00,950 And I'm a function. 82 00:04:00,949 --> 00:04:08,489 Let's say that if you were to-- let me think. 83 00:04:08,490 --> 00:04:14,189 If you were to give me food, what do I produce? 84 00:04:14,189 --> 00:04:17,740 So what is Sal of food? 85 00:04:17,740 --> 00:04:23,050 So if you input food into Sal, what will Sal produce? 86 00:04:23,050 --> 00:04:24,770 Well I won't go into some of the things that I would 87 00:04:24,769 --> 00:04:30,709 produce, but I would produce videos. 88 00:04:30,709 --> 00:04:33,689 I would produce math videos if you gave me food. 89 00:04:33,689 --> 00:04:36,370 Math videos. 90 00:04:36,370 --> 00:04:37,670 I'm just a function. 91 00:04:37,670 --> 00:04:40,900 You give me food and-- and maybe, actually, maybe 92 00:04:40,899 --> 00:04:41,919 I have multiple inputs. 93 00:04:41,920 --> 00:04:48,140 Maybe if you give me a food and a computer, and I would 94 00:04:48,139 --> 00:04:51,829 produce math videos for you. 95 00:04:51,829 --> 00:04:54,214 And maybe you are a function. 96 00:04:54,214 --> 00:04:57,009 97 00:04:57,009 --> 00:04:57,879 I don't know your name. 98 00:04:57,879 --> 00:05:00,540 I would like to, but I don't know your name. 99 00:05:00,540 --> 00:05:09,439 And let's say if I were to input math videos into you, 100 00:05:09,439 --> 00:05:12,839 then you will produce-- let's see, what would you produce? 101 00:05:12,839 --> 00:05:17,079 If I gave you math videos, you would produce A's on tests. 102 00:05:17,079 --> 00:05:23,579 103 00:05:23,579 --> 00:05:24,909 A's on your math test. 104 00:05:24,910 --> 00:05:28,150 Hopefully you're not taking someone else's math test. 105 00:05:28,149 --> 00:05:29,000 So it's interesting. 106 00:05:29,000 --> 00:05:31,689 If you give-- well, let's take the computer away. 107 00:05:31,689 --> 00:05:33,819 Let's say that all Sal needs is food. 108 00:05:33,819 --> 00:05:35,449 Which is kind of true. 109 00:05:35,449 --> 00:05:38,639 So if you put food into Sal, Sal of food, he 110 00:05:38,639 --> 00:05:42,050 produces math videos. 111 00:05:42,050 --> 00:05:45,930 And if I were to put math videos into you, then you 112 00:05:45,930 --> 00:05:49,120 produce A's on your math test. 113 00:05:49,120 --> 00:05:51,709 So let's think of an interesting problem. 114 00:05:51,709 --> 00:05:59,079 What is you of Sal of food? 115 00:05:59,079 --> 00:06:02,719 116 00:06:02,720 --> 00:06:05,620 I know this seems very ridiculous, but I actually 117 00:06:05,620 --> 00:06:08,639 think we might be going someplace, so we might be 118 00:06:08,639 --> 00:06:10,509 getting somewhere with this kind of idea. 119 00:06:10,509 --> 00:06:14,000 Well, first we would try to figure out what is Sal of food. 120 00:06:14,000 --> 00:06:17,339 Well, we already figured out if you put food into Sal, Sal of 121 00:06:17,339 --> 00:06:19,079 food is equal to math videos. 122 00:06:19,079 --> 00:06:25,629 So this is the same thing as you of-- I'm trying to confuse 123 00:06:25,629 --> 00:06:32,120 you-- you of math videos. 124 00:06:32,120 --> 00:06:34,230 And I already determined, we already said, well, if you put 125 00:06:34,230 --> 00:06:37,830 math videos into the function called you, whatever your name 126 00:06:37,829 --> 00:06:42,129 might be, then it produces A's on your math test. 127 00:06:42,129 --> 00:06:47,480 So that you of math videos equals A's on your math test. 128 00:06:47,480 --> 00:06:52,100 129 00:06:52,100 --> 00:06:57,180 So you of Sal of food will produce A's on your math test. 130 00:06:57,180 --> 00:06:59,000 And notice, we just said what happens when you 131 00:06:59,000 --> 00:07:02,149 put food into Sal. 132 00:07:02,149 --> 00:07:04,659 This could-- would be a very different outcome if you put, 133 00:07:04,660 --> 00:07:08,630 like, if you replaced food with let's say poison. 134 00:07:08,629 --> 00:07:12,569 135 00:07:12,569 --> 00:07:19,810 Because if you put poison into Sal, Sal of poison-- not that I 136 00:07:19,810 --> 00:07:23,939 would recommend that you did this-- Sal of poison 137 00:07:23,939 --> 00:07:28,509 would equal death. 138 00:07:28,509 --> 00:07:31,610 No, no, I shouldn't say something, so no no no no. 139 00:07:31,610 --> 00:07:33,189 Well you get the idea. 140 00:07:33,189 --> 00:07:35,719 There wouldn't be math videos. 141 00:07:35,720 --> 00:07:36,600 Anyway. 142 00:07:36,600 --> 00:07:38,400 Let me move on. 143 00:07:38,399 --> 00:07:41,509 So with that kind of-- I'm not so clear whether that would be 144 00:07:41,509 --> 00:07:46,810 a useful example with the food and the math videos. 145 00:07:46,810 --> 00:07:50,699 Let's do some actual problems using functions. 146 00:07:50,699 --> 00:07:54,990 So if I were to tell you that I had one function, called f of x 147 00:07:54,990 --> 00:08:00,610 is equal to x plus 2, and I had another function that said g 148 00:08:00,610 --> 00:08:11,850 of x is equal to x squared minus 1. 149 00:08:11,850 --> 00:08:19,790 If I were to ask you what g of f of 3 is. 150 00:08:19,790 --> 00:08:22,780 151 00:08:22,779 --> 00:08:27,439 Well the first thing we want to do is evaluate what f of 3 is. 152 00:08:27,439 --> 00:08:35,070 So if you-- the 3 would replace the x, so f of 3 is equal to 153 00:08:35,070 --> 00:08:39,210 3 plus 2, which equals 5. 154 00:08:39,210 --> 00:08:45,440 So g of f of 3 is the same thing as g of 5, because f 155 00:08:45,440 --> 00:08:46,390 of three is equal to 5. 156 00:08:46,389 --> 00:08:49,080 Sorry for the little bit of messiness. 157 00:08:49,080 --> 00:08:50,340 So then, what's g of 5? 158 00:08:50,340 --> 00:08:53,889 Well, then we take this 5, and we put it in in place of this 159 00:08:53,889 --> 00:09:02,759 x, so g of 5 is 5 squared, 25, minus 1, which equals 24. 160 00:09:02,759 --> 00:09:07,110 So g of f of 3 is equal to 24. 161 00:09:07,110 --> 00:09:08,950 Hopefully that gives you a taste of what a function is all 162 00:09:08,950 --> 00:09:12,000 about, and I really apologize if I have either confused or 163 00:09:12,000 --> 00:09:16,730 scared you with the Sal food/poison math video example. 164 00:09:16,730 --> 00:09:19,779 But in the next set of presentations, I'm going to do 165 00:09:19,779 --> 00:09:22,419 a lot more of these examples, and I think you'll get the idea 166 00:09:22,419 --> 00:09:25,110 of at least how to do these problems that you might see on 167 00:09:25,110 --> 00:09:27,350 your math tests, and maybe get a sense of what functions 168 00:09:27,350 --> 00:09:29,120 are all about. 169 00:09:29,120 --> 00:09:30,720 See you in the next video. 170 00:09:30,720 --> 00:09:32,019 Bye. 171 00:09:32,019 --> 00:09:32,995