1 00:00:00,000 --> 00:00:03,440 >> [MUSIC PLAYING] 2 00:00:03,440 --> 00:01:57,217 3 00:01:57,217 --> 00:02:00,710 >> [APPLAUSE] 4 00:02:00,710 --> 00:02:05,700 5 00:02:05,700 --> 00:02:09,669 >> DAVID J. MALAN: This is CS50, Harvard University's introduction 6 00:02:09,669 --> 00:02:12,370 to the intellectual enterprises of computer science 7 00:02:12,370 --> 00:02:14,180 and the art of programming. 8 00:02:14,180 --> 00:02:17,530 Now if you are among those that every year are sitting here 9 00:02:17,530 --> 00:02:21,450 with a bit of nerves in your mind, such that you don't think you belong here, 10 00:02:21,450 --> 00:02:24,270 you think that most anyone sitting around you 11 00:02:24,270 --> 00:02:27,730 knows far more than you, is indeed more comfortable than you at computer 12 00:02:27,730 --> 00:02:30,430 science or computers more generally, realize 13 00:02:30,430 --> 00:02:36,140 that 78% of the students who now take CS50 have no prior experience. 14 00:02:36,140 --> 00:02:39,570 >> Indeed, there's 100 dots there on the display, 78 of which 15 00:02:39,570 --> 00:02:43,540 are solid green, which means you, if you're among that demographic, 16 00:02:43,540 --> 00:02:46,420 are in very good company here on out. 17 00:02:46,420 --> 00:02:50,320 And if you are instead among the 22% of CS50 students who do indeed 18 00:02:50,320 --> 00:02:53,920 have prior experience, whether in high school or some other program, 19 00:02:53,920 --> 00:02:56,430 realize that you, too, will be challenged in the course. 20 00:02:56,430 --> 00:02:59,930 >> Not only do we have different tracks for students less comfortable and more 21 00:02:59,930 --> 00:03:03,789 comfortable alike in sections, we also have so-called hacker editions 22 00:03:03,789 --> 00:03:06,080 of most problem sets that will challenge those students 23 00:03:06,080 --> 00:03:09,650 with that additional experience to explore similar material 24 00:03:09,650 --> 00:03:12,140 but from a more sophisticated perspective. 25 00:03:12,140 --> 00:03:13,900 >> But what is computer science? 26 00:03:13,900 --> 00:03:17,750 Well, ultimately, what's going to matter as you explore this field is not 27 00:03:17,750 --> 00:03:20,500 so much where you end up relative to your classmates, 28 00:03:20,500 --> 00:03:25,350 but where you yourself end up in week 12 versus where you begin here 29 00:03:25,350 --> 00:03:26,720 in week zero. 30 00:03:26,720 --> 00:03:31,850 Now computer science-- well, let's call it the science of computation-- 31 00:03:31,850 --> 00:03:35,910 where computation is really just a fancy way of saying, taking some input, 32 00:03:35,910 --> 00:03:39,460 producing some output, and doing so by running algorithms, 33 00:03:39,460 --> 00:03:43,700 sets of instructions for solving some problem on those inputs 34 00:03:43,700 --> 00:03:48,460 in order to produce some output or solution in which you are interested. 35 00:03:48,460 --> 00:03:51,310 >> So we recently had occasion to travel out 36 00:03:51,310 --> 00:03:53,170 to California to meet with an alumna. 37 00:03:53,170 --> 00:03:54,650 Her name is Susan Wojcicki. 38 00:03:54,650 --> 00:03:57,190 And she'd like to speak to you here on video 39 00:03:57,190 --> 00:04:01,690 to testify to just how applicable even just a taste of computer 40 00:04:01,690 --> 00:04:03,770 science at the introductory level can be. 41 00:04:03,770 --> 00:04:06,870 Even if you don't go on to pursue computer science as a field, 42 00:04:06,870 --> 00:04:09,330 or even engineering, or STEM more generally, 43 00:04:09,330 --> 00:04:12,360 you'll see, in fact, how a certain course so influenced her life. 44 00:04:12,360 --> 00:04:16,630 And she only just took it when she was a senior here at Harvard College. 45 00:04:16,630 --> 00:04:19,482 >> If we could dim the lights for Susan. 46 00:04:19,482 --> 00:04:20,690 SUSAN WOJCICKI: Hello, world. 47 00:04:20,690 --> 00:04:22,100 I'm Susan Wojcicki. 48 00:04:22,100 --> 00:04:24,110 I'm the CEO of YouTube. 49 00:04:24,110 --> 00:04:29,150 And I took CS50 when I was a senior at Harvard in 1990. 50 00:04:29,150 --> 00:04:31,220 I was actually a history and literature major. 51 00:04:31,220 --> 00:04:36,760 >> And my junior summer, I realized that maybe I 52 00:04:36,760 --> 00:04:39,060 wanted to learn something about computers. 53 00:04:39,060 --> 00:04:40,930 And so, I came back. 54 00:04:40,930 --> 00:04:42,500 I took CS50. 55 00:04:42,500 --> 00:04:46,940 It was hard, but it was the most amazing class I took. 56 00:04:46,940 --> 00:04:49,630 >> It changed how I think about everything. 57 00:04:49,630 --> 00:04:55,810 And when I graduated from Harvard in 1990, I went to Silicon Valley. 58 00:04:55,810 --> 00:04:57,140 And I got a job. 59 00:04:57,140 --> 00:05:00,150 And I've been working in tech ever since. 60 00:05:00,150 --> 00:05:02,650 DAVID J. MALAN: Now what Susan didn't mention in this video, 61 00:05:02,650 --> 00:05:05,340 that it was actually in her garage that Google itself was 62 00:05:05,340 --> 00:05:07,420 founded by Larry and Sergey. 63 00:05:07,420 --> 00:05:11,169 >> Now we also reached out to our friends at code.org, an organization that 64 00:05:11,169 --> 00:05:13,460 over the past year has been getting people particularly 65 00:05:13,460 --> 00:05:16,520 excited about computer science and programming, in particular. 66 00:05:16,520 --> 00:05:20,590 But it's worth noting that programming is not computer science per se. 67 00:05:20,590 --> 00:05:22,090 Computer science is not programming. 68 00:05:22,090 --> 00:05:24,560 Rather programming is just a tool-- with which all of you 69 00:05:24,560 --> 00:05:27,510 will be all too well familiar by semester's end-- 70 00:05:27,510 --> 00:05:30,650 such that you can apply not just to future courses in CS 71 00:05:30,650 --> 00:05:33,670 but to whatever fields from whence you're coming, in humanities, 72 00:05:33,670 --> 00:05:36,090 social sciences, natural science, or the like. 73 00:05:36,090 --> 00:05:39,740 >> Indeed, allow a few other alumni and their colleagues 74 00:05:39,740 --> 00:05:43,400 to speak to the applicability of the field that awaits. 75 00:05:43,400 --> 00:05:52,340 76 00:05:52,340 --> 00:05:57,350 >> BILL GATES: I was 13 when I first got access to a computer. 77 00:05:57,350 --> 00:06:00,485 >> JACK DORSEY: My parents bought me a Macintosh in 1984 78 00:06:00,485 --> 00:06:01,640 when I was eight-years-old. 79 00:06:01,640 --> 00:06:02,990 >> MARK ZUCKERBERG: I was in the sixth grade. 80 00:06:02,990 --> 00:06:04,670 >> SPEAKER 1: I learned to code in college. 81 00:06:04,670 --> 00:06:09,080 >> RUCHI SANGHVI: Freshman year, first semester, Intro to Computer Science. 82 00:06:09,080 --> 00:06:11,850 >> BILL GATES: I wrote a program that played tic-tac-toe. 83 00:06:11,850 --> 00:06:14,100 >> DREW HOUSTON: I think it was pretty humble beginnings. 84 00:06:14,100 --> 00:06:16,370 I think the first program I wrote asked things like, 85 00:06:16,370 --> 00:06:17,820 what's your favorite color? 86 00:06:17,820 --> 00:06:18,696 Or how old are you? 87 00:06:18,696 --> 00:06:21,070 ELENA SILENOK: I first learned how to make a green circle 88 00:06:21,070 --> 00:06:23,670 and a red square appear on the screen. 89 00:06:23,670 --> 00:06:25,420 GABE NEWELL: The first time I actually had 90 00:06:25,420 --> 00:06:27,360 something come up and say, hello, world. 91 00:06:27,360 --> 00:06:29,710 And I made a computer do that. 92 00:06:29,710 --> 00:06:30,850 It was just astonishing. 93 00:06:30,850 --> 00:06:33,224 >> MARK ZUCKERBERG: Learning how to program didn't start off 94 00:06:33,224 --> 00:06:35,450 as wanting to learn all of computer science 95 00:06:35,450 --> 00:06:38,630 or trying to master this discipline or anything like that. 96 00:06:38,630 --> 00:06:41,591 It just started off because I wanted to do this one simple thing. 97 00:06:41,591 --> 00:06:44,340 I wanted to make something that was fun for myself and my sisters. 98 00:06:44,340 --> 00:06:46,399 >> And I wrote this little program. 99 00:06:46,399 --> 00:06:48,440 And then basically just added a little bit to it. 100 00:06:48,440 --> 00:06:49,930 And then when I needed to learn something new, 101 00:06:49,930 --> 00:06:52,210 I looked it up, either in a book or on the internet, 102 00:06:52,210 --> 00:06:53,240 and then added a little bit to it. 103 00:06:53,240 --> 00:06:56,300 >> DREW HOUSTON: It's really not unlike playing an instrument or something 104 00:06:56,300 --> 00:07:00,007 or playing a sport. 105 00:07:00,007 --> 00:07:01,090 DAVID J. MALAN: All right. 106 00:07:01,090 --> 00:07:04,120 So let us now actually dive in a little deeper. 107 00:07:04,120 --> 00:07:07,430 What are these inputs and outputs that we're talking about here? 108 00:07:07,430 --> 00:07:09,110 >> So how about something simple? 109 00:07:09,110 --> 00:07:12,120 You probably know, even if you have no familiarity with computer science 110 00:07:12,120 --> 00:07:16,570 whatsoever, that computers somehow use and understands only zeros and ones. 111 00:07:16,570 --> 00:07:20,500 But how can that possibly be given how much today's desktops and laptops alike 112 00:07:20,500 --> 00:07:21,280 can do? 113 00:07:21,280 --> 00:07:24,310 >> The DNA of the day, the only alphabet that they understand 114 00:07:24,310 --> 00:07:26,410 is a zero or a one. 115 00:07:26,410 --> 00:07:27,470 Well, consider this. 116 00:07:27,470 --> 00:07:30,840 We, humans, tend to use the decimal system. "Dec" meaning 10. 117 00:07:30,840 --> 00:07:33,970 And that's 10 because we have 10 digits, 0 through nine. 118 00:07:33,970 --> 00:07:36,180 >> Now computers, by contrast, tend to use binary. 119 00:07:36,180 --> 00:07:37,270 "Bi" meaning two. 120 00:07:37,270 --> 00:07:39,560 So they tend to use only zero and one. 121 00:07:39,560 --> 00:07:42,680 But it turns out, that even just with zeros and ones, that 122 00:07:42,680 --> 00:07:45,900 is a sufficiently large alphabet with which to represent most 123 00:07:45,900 --> 00:07:48,490 any piece of data you want, whether it's a number, 124 00:07:48,490 --> 00:07:52,100 whether it's a letter, whether it's a graphic or video on the screen. 125 00:07:52,100 --> 00:07:57,140 >> Consider, for instance, how we humans typically interpret this number here. 126 00:07:57,140 --> 00:08:00,010 This is just three digits, one, two, three. 127 00:08:00,010 --> 00:08:04,570 But we know this number innately now as 123. 128 00:08:04,570 --> 00:08:05,510 But why is that? 129 00:08:05,510 --> 00:08:07,570 >> Well, if you think back to perhaps grade school, 130 00:08:07,570 --> 00:08:11,700 you probably were taught to think of these numbers as being in columns, 131 00:08:11,700 --> 00:08:14,700 where the one is in the hundreds place, the two is in the tens place, 132 00:08:14,700 --> 00:08:16,360 and the three is in the ones place. 133 00:08:16,360 --> 00:08:17,790 Why is that actually useful? 134 00:08:17,790 --> 00:08:19,665 Well, think about the super simple arithmetic 135 00:08:19,665 --> 00:08:22,219 that we all have been doing for years now. 136 00:08:22,219 --> 00:08:24,510 Effectively, if you've got a one in the hundreds place, 137 00:08:24,510 --> 00:08:29,610 you do the quick math 100 times 1 plus 10 times 2-- 138 00:08:29,610 --> 00:08:33,059 because two is in the tens place-- plus 1 times 3-- 139 00:08:33,059 --> 00:08:34,830 because three is in the ones place. 140 00:08:34,830 --> 00:08:37,039 So, of course, if we actually multiply this out, 141 00:08:37,039 --> 00:08:39,600 what we're really representing with this pattern-- one 142 00:08:39,600 --> 00:08:46,150 two three-- is 100 plus 20 plus 3, which, of course, is 123. 143 00:08:46,150 --> 00:08:51,130 >> Now binary, and computers really, fundamentally speak the same language 144 00:08:51,130 --> 00:08:51,680 that we do. 145 00:08:51,680 --> 00:08:53,400 They just have a smaller alphabet. 146 00:08:53,400 --> 00:08:57,100 So computers only have zeros and ones at their disposal. 147 00:08:57,100 --> 00:09:02,500 So whereas we humans have essentially powers of 10 in each of these places-- 148 00:09:02,500 --> 00:09:06,810 10 to the zero, 10 to the one, ten to the two, giving you 110 and 100 149 00:09:06,810 --> 00:09:07,700 respectively. 150 00:09:07,700 --> 00:09:12,140 >> Because computers only have two values they can understand, zero and one, 151 00:09:12,140 --> 00:09:16,600 they have to use different values in these columns, one, two, four. 152 00:09:16,600 --> 00:09:20,480 And if we kept going, eight, 16, 32, 64, and so forth. 153 00:09:20,480 --> 00:09:24,220 But the pattern and the mentality is exactly the same. 154 00:09:24,220 --> 00:09:27,340 >> So by this logic, anyone, how would I go about representing the number 155 00:09:27,340 --> 00:09:28,530 one in binary? 156 00:09:28,530 --> 00:09:33,080 If you've never even thought about this before, what's your gut say? 157 00:09:33,080 --> 00:09:33,777 >> AUDIENCE: One. 158 00:09:33,777 --> 00:09:34,610 DAVID J. MALAN: One. 159 00:09:34,610 --> 00:09:35,660 Exactly. 160 00:09:35,660 --> 00:09:38,100 We just need a one in the ones place because the zeros 161 00:09:38,100 --> 00:09:40,610 suffice to give us neither a four nor a two. 162 00:09:40,610 --> 00:09:42,440 So one times one equals one. 163 00:09:42,440 --> 00:09:43,940 Now things get a little interesting. 164 00:09:43,940 --> 00:09:46,830 If I want to represent in binary the number two-- but, 165 00:09:46,830 --> 00:09:49,790 again, even if you've never spoken this language before, 166 00:09:49,790 --> 00:09:54,680 how do we represent in binary the value we humans know as two? 167 00:09:54,680 --> 00:09:55,570 Zero one zero. 168 00:09:55,570 --> 00:09:57,620 Just put the one in the column that you want it. 169 00:09:57,620 --> 00:09:59,560 >> Now it's getting pretty easy probably now. 170 00:09:59,560 --> 00:10:02,950 So if I want to represent three-- there is no three's column. 171 00:10:02,950 --> 00:10:06,770 So, again, I can now add these values together by putting a one here. 172 00:10:06,770 --> 00:10:10,320 So 2 times 1 plus 1 times 1 is, of course, 3. 173 00:10:10,320 --> 00:10:13,480 >> Now things get a little fun in that the ones now become zeros. 174 00:10:13,480 --> 00:10:15,480 And to represent four, I get this. 175 00:10:15,480 --> 00:10:19,310 And if we increment slowly here-- that would be five. 176 00:10:19,310 --> 00:10:20,700 This would be six. 177 00:10:20,700 --> 00:10:22,100 This would be seven. 178 00:10:22,100 --> 00:10:25,310 >> But now I seem to have run into a problem. 179 00:10:25,310 --> 00:10:30,520 How might I go about representing eight-- would be the next value. 180 00:10:30,520 --> 00:10:31,900 Yeah, so we need a new bits. 181 00:10:31,900 --> 00:10:33,899 And, indeed, if you've heard this phrase before, 182 00:10:33,899 --> 00:10:37,380 bits, that's just short for binary digit, zero or one. 183 00:10:37,380 --> 00:10:41,520 >> And so I happen to be representing only three such bits here. 184 00:10:41,520 --> 00:10:44,900 But if I had a way of storing not three different bits, but four, 185 00:10:44,900 --> 00:10:47,250 surely I could represent eight, and then nine, and then 186 00:10:47,250 --> 00:10:49,400 10, and even higher and higher. 187 00:10:49,400 --> 00:10:52,140 >> But that then calls into question how we can 188 00:10:52,140 --> 00:10:54,540 go about representing these things in the first place. 189 00:10:54,540 --> 00:10:56,950 It's one thing to draw them up here on a slide, 190 00:10:56,950 --> 00:11:00,660 but how do you represent them if you're a mechanical device? 191 00:11:00,660 --> 00:11:04,390 What is a computer doing to represent the inputs and outputs that 192 00:11:04,390 --> 00:11:09,020 fundamentally define computation at the end of the day? 193 00:11:09,020 --> 00:11:12,090 >> Well, what about something super simple like this? 194 00:11:12,090 --> 00:11:13,200 It's just a light bulb. 195 00:11:13,200 --> 00:11:15,460 And I can trigger this light bulb to go on 196 00:11:15,460 --> 00:11:17,920 by turning some electricity on and allowing electrons 197 00:11:17,920 --> 00:11:22,585 to flow through, which changes its state or its value, so to speak. 198 00:11:22,585 --> 00:11:24,460 For instance, this is an old school desk lamp 199 00:11:24,460 --> 00:11:27,250 here with one such light bulb inside of it. 200 00:11:27,250 --> 00:11:29,940 And right now it's not really doing anything useful. 201 00:11:29,940 --> 00:11:32,680 But as soon as I plug it into an electrical socket 202 00:11:32,680 --> 00:11:36,390 and then use this switch-- or we can even call it a transistor 203 00:11:36,390 --> 00:11:39,970 or think of it as such-- I can now represent either 204 00:11:39,970 --> 00:11:44,120 this value, where the light bulb's obviously off, or this value. 205 00:11:44,120 --> 00:11:46,060 This value or this value. 206 00:11:46,060 --> 00:11:47,520 This value and so forth. 207 00:11:47,520 --> 00:11:51,220 >> So inside of a computer, presumably, are much smaller pieces of hardware, 208 00:11:51,220 --> 00:11:52,970 but that at the end of the day simply have 209 00:11:52,970 --> 00:11:55,360 to use electricity-- perhaps capture it-- 210 00:11:55,360 --> 00:11:59,730 and then either keep something on or keep something off. 211 00:11:59,730 --> 00:12:02,021 Of course, this isn't particularly interesting to do 212 00:12:02,021 --> 00:12:03,270 with just a single light bulb. 213 00:12:03,270 --> 00:12:06,726 >> In fact, how high can I count in binary with this desk lamp here? 214 00:12:06,726 --> 00:12:07,420 >> AUDIENCE: One. 215 00:12:07,420 --> 00:12:08,545 >> DAVID J. MALAN: One, right? 216 00:12:08,545 --> 00:12:11,020 I need more desk lamps if I actually want to count higher. 217 00:12:11,020 --> 00:12:12,210 But we can do better than that. 218 00:12:12,210 --> 00:12:14,460 Because the light bulbs that we've put in these things 219 00:12:14,460 --> 00:12:17,730 are actually fancier light bulbs than yesteryear would allow. 220 00:12:17,730 --> 00:12:20,310 And they're actually networked light bulbs. 221 00:12:20,310 --> 00:12:23,160 And bunches of companies make these things these days. 222 00:12:23,160 --> 00:12:25,190 >> But it turns out that this one in particular 223 00:12:25,190 --> 00:12:27,680 comes with a feature whereby you can change its colors. 224 00:12:27,680 --> 00:12:30,810 So for instance, if you adorned your dorm room 225 00:12:30,810 --> 00:12:33,200 with a few of these light bulbs, depending on your mood, 226 00:12:33,200 --> 00:12:35,366 depending on who comes in, depending on the weather, 227 00:12:35,366 --> 00:12:37,360 depending on the time of day, you can actually 228 00:12:37,360 --> 00:12:40,300 change the colors of the bulbs in your room. 229 00:12:40,300 --> 00:12:43,740 And that's because these light bulbs and others like it have what's 230 00:12:43,740 --> 00:12:48,010 called an API, an application programming interface, which 231 00:12:48,010 --> 00:12:50,920 is a topic with which you'll be well familiar with by semester's end. 232 00:12:50,920 --> 00:12:53,710 >> And this is just a fancy, cryptic way of saying, 233 00:12:53,710 --> 00:12:57,570 you can program these light bulbs to do your bidding. 234 00:12:57,570 --> 00:13:00,360 You can send them messages just like you, a human, 235 00:13:00,360 --> 00:13:03,640 can send a message to a web server saying, give me today's news 236 00:13:03,640 --> 00:13:05,110 or give me my email. 237 00:13:05,110 --> 00:13:08,010 >> You can send more arcane messages to these light bulbs 238 00:13:08,010 --> 00:13:09,700 to say, turn on and turn off. 239 00:13:09,700 --> 00:13:11,370 But that's not all that interesting. 240 00:13:11,370 --> 00:13:14,280 You can say, turn on red, turn on green, turn on blue, 241 00:13:14,280 --> 00:13:15,990 all with the same light bulb. 242 00:13:15,990 --> 00:13:20,990 And you can even, with a bit more savvy, say, turn yourself to blue 243 00:13:20,990 --> 00:13:24,710 when it's a gloomy day outside, for instance. 244 00:13:24,710 --> 00:13:27,910 It can actually patch into a weather API and find out 245 00:13:27,910 --> 00:13:32,260 what the weather is, or the time of day, or other such triggers. 246 00:13:32,260 --> 00:13:35,550 >> So, in fact, two of CS50's own staff members, 247 00:13:35,550 --> 00:13:38,827 Dan Bradley and Ansel Duff here, kindly procured 248 00:13:38,827 --> 00:13:40,410 us a whole bunch of these light bulbs. 249 00:13:40,410 --> 00:13:42,910 And they built CS50's first ever binary bulbs, 250 00:13:42,910 --> 00:13:46,850 where we've represented here-- with these playful little magnets-- 251 00:13:46,850 --> 00:13:49,780 the various placeholders we alluded to just a bit ago. 252 00:13:49,780 --> 00:13:52,572 >> So way over here is the ones place, two, four. 253 00:13:52,572 --> 00:13:54,030 And we didn't see higher than that. 254 00:13:54,030 --> 00:13:55,613 But, of course, they're powers of two. 255 00:13:55,613 --> 00:13:59,490 Eight, 16, 32, 64, and 128. 256 00:13:59,490 --> 00:14:03,320 So if I now want to be a little fancier than using this old school switch, 257 00:14:03,320 --> 00:14:07,310 I have here on this iPad a super simple interface 258 00:14:07,310 --> 00:14:10,440 that Dan Bradley, a former student and now teaching fellow, 259 00:14:10,440 --> 00:14:13,510 programed using some HTML and JavaScript, which 260 00:14:13,510 --> 00:14:15,685 are markup and programming languages respectively. 261 00:14:15,685 --> 00:14:17,560 And you can probably see-- even in the back-- 262 00:14:17,560 --> 00:14:21,670 there's a big plus and a big minus, plus one button for each of these bulbs. 263 00:14:21,670 --> 00:14:25,740 And what this is going to allow me to do is, for instance, click the plus 264 00:14:25,740 --> 00:14:28,250 and now represent, of course, what number? 265 00:14:28,250 --> 00:14:28,750 One. 266 00:14:28,750 --> 00:14:30,220 And I can hit it again. 267 00:14:30,220 --> 00:14:31,480 Two. 268 00:14:31,480 --> 00:14:32,800 Three. 269 00:14:32,800 --> 00:14:33,950 Four. 270 00:14:33,950 --> 00:14:35,200 Five. 271 00:14:35,200 --> 00:14:36,360 Six. 272 00:14:36,360 --> 00:14:36,880 Seven. 273 00:14:36,880 --> 00:14:40,740 >> And here now we get that rollover, but we have a fourth bit this time, 274 00:14:40,740 --> 00:14:42,180 so now we have eight. 275 00:14:42,180 --> 00:14:44,000 So we could do this for quite some time. 276 00:14:44,000 --> 00:14:46,530 In fact, as an aside, how high could we count? 277 00:14:46,530 --> 00:14:48,318 Anyone? 278 00:14:48,318 --> 00:14:49,270 >> AUDIENCE: 255. 279 00:14:49,270 --> 00:14:51,420 >> DAVID J. MALAN: 255, right? 280 00:14:51,420 --> 00:14:54,900 Don't worry too much about the math for now, but that's a pretty decent number. 281 00:14:54,900 --> 00:14:59,140 But it actually does bound just how many pieces of information, 282 00:14:59,140 --> 00:15:01,760 like a letter, or a graphic that we could represent. 283 00:15:01,760 --> 00:15:02,697 >> But no matter for now. 284 00:15:02,697 --> 00:15:04,530 I'm going to go ahead and turn them all off. 285 00:15:04,530 --> 00:15:09,670 And if I could, I'd like to ask for a volunteer, our first volunteer-- 286 00:15:09,670 --> 00:15:11,342 oh, hello-- on stage. 287 00:15:11,342 --> 00:15:14,050 The catch is you have to be comfortable appearing, as you clearly 288 00:15:14,050 --> 00:15:17,421 are in front of all your classmates, as well as on the internet. 289 00:15:17,421 --> 00:15:20,420 And let me look a little beyond the-- how about here in the white shirt? 290 00:15:20,420 --> 00:15:20,920 And hand up. 291 00:15:20,920 --> 00:15:22,071 Come on up. 292 00:15:22,071 --> 00:15:22,820 What is your name? 293 00:15:22,820 --> 00:15:23,760 >> AUDIENCE: Jackie. 294 00:15:23,760 --> 00:15:24,718 >> DAVID J. MALAN: Jackie. 295 00:15:24,718 --> 00:15:25,820 Jackie, come on up. 296 00:15:25,820 --> 00:15:29,820 So what there is also on this iPad is a button called Game Mode. 297 00:15:29,820 --> 00:15:32,570 And this Game Mode is going to allow me to input 298 00:15:32,570 --> 00:15:35,780 in advance a particular decimal number, the numbers we humans are 299 00:15:35,780 --> 00:15:36,760 familiar with. 300 00:15:36,760 --> 00:15:39,820 And then you will be challenged here to use the buttons 301 00:15:39,820 --> 00:15:42,140 on the top-- one for each of these bulbs-- 302 00:15:42,140 --> 00:15:45,050 to actually figure out the pattern of light bulbs 303 00:15:45,050 --> 00:15:46,970 that represents the number in question. 304 00:15:46,970 --> 00:15:47,790 >> And I'm sorry, what was your name again? 305 00:15:47,790 --> 00:15:48,250 >> AUDIENCE: Jackie. 306 00:15:48,250 --> 00:15:48,620 >> DAVID J. MALAN: Jackie. 307 00:15:48,620 --> 00:15:48,920 All right. 308 00:15:48,920 --> 00:15:49,740 Good to meet you. 309 00:15:49,740 --> 00:15:54,580 >> So let me go ahead and program in for the world to see the number 15. 310 00:15:54,580 --> 00:15:56,360 We'll keep it small at first here. 311 00:15:56,360 --> 00:15:58,240 And I'm going to go into Game Mode. 312 00:15:58,240 --> 00:16:01,160 And I'm going to specify, give us the number 15. 313 00:16:01,160 --> 00:16:01,900 >> OK. 314 00:16:01,900 --> 00:16:05,510 And now with everyone watching-- if you want to maybe stand this way, 315 00:16:05,510 --> 00:16:09,970 because it will line up-- go ahead and toggle the eight buttons along the top 316 00:16:09,970 --> 00:16:12,530 to turn the bulbs on or off as you see fit. 317 00:16:12,530 --> 00:16:13,530 >> AUDIENCE: OK. 318 00:16:13,530 --> 00:16:17,720 >> DAVID J. MALAN: And no cheating by hitting plus 15 times. 319 00:16:17,720 --> 00:16:19,275 Oh, we are going to do that. 320 00:16:19,275 --> 00:16:20,069 >> AUDIENCE: Oh, wait. 321 00:16:20,069 --> 00:16:20,610 I'm so sorry. 322 00:16:20,610 --> 00:16:22,660 >> DAVID J. MALAN: You can also turn the light bulbs on individually 323 00:16:22,660 --> 00:16:24,076 with each of these buttons on top. 324 00:16:24,076 --> 00:16:24,844 AUDIENCE: Oh, OK. 325 00:16:24,844 --> 00:16:27,429 So it would be like-- 326 00:16:27,429 --> 00:16:28,220 DAVID J. MALAN: OK. 327 00:16:28,220 --> 00:16:29,100 So now we have eight. 328 00:16:29,100 --> 00:16:31,280 So let's pause for the audience to engage here. 329 00:16:31,280 --> 00:16:34,300 What number is Jackie currently representing? 330 00:16:34,300 --> 00:16:34,800 11. 331 00:16:34,800 --> 00:16:35,730 So we're almost there. 332 00:16:35,730 --> 00:16:38,360 333 00:16:38,360 --> 00:16:39,630 And excellent. 334 00:16:39,630 --> 00:16:41,487 So we have our first winner. 335 00:16:41,487 --> 00:16:42,445 Congratulations. 336 00:16:42,445 --> 00:16:48,200 >> And we thought we'd have some fabulous giveaways. 337 00:16:48,200 --> 00:16:50,860 If you'd like to be one such dorm room here on campus, 338 00:16:50,860 --> 00:16:56,126 you can yourself have a final project using now this API, thanks to Jackie. 339 00:16:56,126 --> 00:16:57,050 So now-- 340 00:16:57,050 --> 00:16:58,902 >> [APPLAUSE] 341 00:16:58,902 --> 00:17:01,690 342 00:17:01,690 --> 00:17:04,839 >> --if we could, one more such around of this. 343 00:17:04,839 --> 00:17:07,690 Oh, now everyone wants some light bulbs. 344 00:17:07,690 --> 00:17:11,790 For the so-called hacker edition, we're going to ramp it up a-- oh, 345 00:17:11,790 --> 00:17:12,770 yeah, noncommittal. 346 00:17:12,770 --> 00:17:16,010 I think you're coming up now if your hand's going down. 347 00:17:16,010 --> 00:17:16,800 What is your name? 348 00:17:16,800 --> 00:17:17,424 >> AUDIENCE: Alex. 349 00:17:17,424 --> 00:17:19,440 DAVID J. MALAN: Alex, come on over here. 350 00:17:19,440 --> 00:17:26,190 So for Alex, we are going to program in a slightly larger number. 351 00:17:26,190 --> 00:17:27,790 Perhaps in order. 352 00:17:27,790 --> 00:17:29,110 The number 50. 353 00:17:29,110 --> 00:17:29,744 >> AUDIENCE: OK. 354 00:17:29,744 --> 00:17:31,660 DAVID J. MALAN: But, as I said-- and you might 355 00:17:31,660 --> 00:17:33,580 want to stand here so that the buttons line up 356 00:17:33,580 --> 00:17:37,115 as you would expect-- but I did call this the hacker edition. 357 00:17:37,115 --> 00:17:47,125 So-- good luck! 358 00:17:47,125 --> 00:17:48,416 >> [LAUGHTER] 359 00:17:48,416 --> 00:17:58,570 360 00:17:58,570 --> 00:18:02,050 >> You will be able to turn them off if you-- OK. 361 00:18:02,050 --> 00:18:02,880 Excellent. 362 00:18:02,880 --> 00:18:03,675 Wonderful. 363 00:18:03,675 --> 00:18:04,341 Congratulations. 364 00:18:04,341 --> 00:18:08,730 >> [APPLAUSE] 365 00:18:08,730 --> 00:18:10,355 I suppose I should pay up. 366 00:18:10,355 --> 00:18:11,830 Congratulations to Alex as well. 367 00:18:11,830 --> 00:18:12,330 OK. 368 00:18:12,330 --> 00:18:15,550 >> So the ultimate takeaway here is hopefully, frankly, 369 00:18:15,550 --> 00:18:18,109 the simplicity-- the simplicity with which 370 00:18:18,109 --> 00:18:20,650 you can get some nice light bulbs, apparently in [INAUDIBLE]. 371 00:18:20,650 --> 00:18:23,000 But they represent, ultimately, the same ideas 372 00:18:23,000 --> 00:18:26,310 with which we humans are already all too familiar. 373 00:18:26,310 --> 00:18:28,660 So what might the next step be in the progression 374 00:18:28,660 --> 00:18:30,920 of trying to do something interesting with data 375 00:18:30,920 --> 00:18:34,950 and representing inputs that aren't just numbers but are maybe letters or more? 376 00:18:34,950 --> 00:18:37,820 >> Well, it turns out that the computer world, for many years, 377 00:18:37,820 --> 00:18:43,300 simply adopted an arbitrary but a consistent standard that maps numbers 378 00:18:43,300 --> 00:18:44,610 to letters of the alphabet. 379 00:18:44,610 --> 00:18:47,120 For instance, here is an excerpt from that mapping. 380 00:18:47,120 --> 00:18:48,350 It's called Ascii. 381 00:18:48,350 --> 00:18:53,220 A-S-C-I-I. And that is simply a table that maps uppercase letters-- 382 00:18:53,220 --> 00:18:56,600 in this case-- to decimal numbers. 383 00:18:56,600 --> 00:18:57,890 >> But what's the implication? 384 00:18:57,890 --> 00:19:01,090 Well, if you actually want to represent something like an email or some text 385 00:19:01,090 --> 00:19:03,310 on a web page, you obviously want to show 386 00:19:03,310 --> 00:19:06,100 the human letters of the alphabet, not numbers. 387 00:19:06,100 --> 00:19:09,140 So depending on the context of the program 388 00:19:09,140 --> 00:19:12,600 that a user is using, if it's a web browser or email client, 389 00:19:12,600 --> 00:19:16,090 numbers can certainly be interpreted as letters. 390 00:19:16,090 --> 00:19:20,290 That is to say, patterns of bits can easily be interpreted as letters. 391 00:19:20,290 --> 00:19:24,700 >> And so what we can have is the letter A being 392 00:19:24,700 --> 00:19:28,410 represented as 65, B being represented as 66. 393 00:19:28,410 --> 00:19:30,900 So if we have a super short word, like hi, 394 00:19:30,900 --> 00:19:35,740 what a computer would ultimately store in decimal but really in binary, 395 00:19:35,740 --> 00:19:40,070 using some sequence of bits, leveraging a bit of electricity in some way, 396 00:19:40,070 --> 00:19:44,010 would be the two numbers 72 and 73. 397 00:19:44,010 --> 00:19:46,780 >> But the pattern of bits that represents those values. 398 00:19:46,780 --> 00:19:49,820 So these then are how we can represent our inputs and outputs. 399 00:19:49,820 --> 00:19:52,630 And suffice it to say, we can do more complex representations 400 00:19:52,630 --> 00:19:56,450 ultimately with things like graphics, videos, music, and more 401 00:19:56,450 --> 00:19:58,190 as we'll see later this term. 402 00:19:58,190 --> 00:20:00,630 >> So that just leaves then algorithms, these sets 403 00:20:00,630 --> 00:20:03,490 of instructions with which we're solving actual problems. 404 00:20:03,490 --> 00:20:05,820 We're passing in inputs to algorithms. 405 00:20:05,820 --> 00:20:09,630 And those algorithms are producing outputs, hopefully correct outputs 406 00:20:09,630 --> 00:20:14,160 and hopefully, too, efficiently gathered outputs. 407 00:20:14,160 --> 00:20:16,890 In other words, it's one thing to implement something correctly. 408 00:20:16,890 --> 00:20:20,790 It's another thing to implement something well or efficiently. 409 00:20:20,790 --> 00:20:23,690 >> For instance, one demonstration that we're fond of in the course 410 00:20:23,690 --> 00:20:24,460 is this one. 411 00:20:24,460 --> 00:20:26,345 But these things are getting increasingly hard to find. 412 00:20:26,345 --> 00:20:28,930 But this is indeed an old school phone book, inside of which 413 00:20:28,930 --> 00:20:32,580 are 1,000 plus pages of names and telephone numbers. 414 00:20:32,580 --> 00:20:34,830 And if I wanted to look up someone in this phone book, 415 00:20:34,830 --> 00:20:38,640 I could simply do a very naive algorithm. 416 00:20:38,640 --> 00:20:42,150 I could open up to the first page, and I could start to look for, say, someone 417 00:20:42,150 --> 00:20:43,130 named Mike Smith. 418 00:20:43,130 --> 00:20:46,160 And if he's not on the first page, I progress to the second, 419 00:20:46,160 --> 00:20:49,120 and then to the third, and then to the fourth, and so forth, 420 00:20:49,120 --> 00:20:51,430 until I finally find Mike Smith. 421 00:20:51,430 --> 00:20:53,010 >> Now is that algorithm correct? 422 00:20:53,010 --> 00:20:53,896 >> AUDIENCE: Yes. 423 00:20:53,896 --> 00:20:54,248 >> DAVID J. MALAN: Yeah. 424 00:20:54,248 --> 00:20:56,039 If he's in there, I'll eventually find him. 425 00:20:56,039 --> 00:20:58,820 But it's arguably not very efficient, certainly not fast, 426 00:20:58,820 --> 00:21:01,200 because, my god, why am I wasting my time flipping 427 00:21:01,200 --> 00:21:04,500 through all of these pages when I could certainly do this physically faster? 428 00:21:04,500 --> 00:21:08,210 >> Well, a slight optimization, so to speak, might be not one page at a time, 429 00:21:08,210 --> 00:21:11,610 but two, four, six, eight, 10. 430 00:21:11,610 --> 00:21:12,725 Still correct? 431 00:21:12,725 --> 00:21:14,030 >> AUDIENCE: No. 432 00:21:14,030 --> 00:21:17,040 >> DAVID J. MALAN: So no if I for instance skip over Mike Smith. 433 00:21:17,040 --> 00:21:20,530 But so long as I back pedal one page, if I overshoot him, 434 00:21:20,530 --> 00:21:25,240 maybe we could correct what might otherwise be a gotcha. 435 00:21:25,240 --> 00:21:26,020 >> But is it better? 436 00:21:26,020 --> 00:21:27,469 Is it faster? 437 00:21:27,469 --> 00:21:28,010 I mean, yeah. 438 00:21:28,010 --> 00:21:30,950 It's literally twice as fast if I do two pages at a time. 439 00:21:30,950 --> 00:21:35,720 So if I originally had 1,000 pages, now I only have to flip 500 times, 440 00:21:35,720 --> 00:21:39,429 not fully 1,000 pages to get potentially in the worst case 441 00:21:39,429 --> 00:21:41,220 to the end of the phone book, where someone 442 00:21:41,220 --> 00:21:44,380 like Mike Smith or someone with a later name might actually be. 443 00:21:44,380 --> 00:21:46,540 >> But, of course, we humans certainly aren't 444 00:21:46,540 --> 00:21:49,250 going to be doing that, certainly not at this point in our lives. 445 00:21:49,250 --> 00:21:51,454 What is a reasonable human likely going to do? 446 00:21:51,454 --> 00:21:52,870 AUDIENCE: Go straight to the9 S's. 447 00:21:52,870 --> 00:21:53,860 DAVID J. MALAN: Go straight to the S's? 448 00:21:53,860 --> 00:21:55,563 How do I go straight to the S's? 449 00:21:55,563 --> 00:21:57,342 >> AUDIENCE: Rip it in half. 450 00:21:57,342 --> 00:21:59,050 DAVID J. MALAN: Well, there's no marking. 451 00:21:59,050 --> 00:22:02,116 So, yes, if there were indeed a label or a sticky tab for S, 452 00:22:02,116 --> 00:22:03,240 we should jump right there. 453 00:22:03,240 --> 00:22:05,420 But it's pretty innocuous. 454 00:22:05,420 --> 00:22:08,480 So the best I can do is roughly to the S section or maybe roughly 455 00:22:08,480 --> 00:22:09,650 into the middle. 456 00:22:09,650 --> 00:22:12,110 But the key takeaway now-- and the intuition 457 00:22:12,110 --> 00:22:14,430 that you've taken for granted for years probably-- 458 00:22:14,430 --> 00:22:17,103 is that what do you now know about this problem? 459 00:22:17,103 --> 00:22:19,320 >> AUDIENCE: [INAUDIBLE] 460 00:22:19,320 --> 00:22:22,290 >> DAVID J. MALAN: Mike Smith is surely not in this half of the problem 461 00:22:22,290 --> 00:22:25,600 because Smith comes after the middle which is roughly the M section, 462 00:22:25,600 --> 00:22:26,510 it seems to be. 463 00:22:26,510 --> 00:22:30,340 So as you might have seen at Visitas, we can now literally 464 00:22:30,340 --> 00:22:31,737 tear this problem in half. 465 00:22:31,737 --> 00:22:32,320 AUDIENCE: Woo! 466 00:22:32,320 --> 00:22:33,690 DAVID J. MALAN: It's getting easier and easier. 467 00:22:33,690 --> 00:22:34,666 [APPLAUSE] 468 00:22:34,666 --> 00:22:36,618 There you go. 469 00:22:36,618 --> 00:22:39,060 [LAUGHTER] 470 00:22:39,060 --> 00:22:41,870 And now I fundamentally have the same problem, 471 00:22:41,870 --> 00:22:43,866 but it's literally half as big. 472 00:22:43,866 --> 00:22:45,240 I'm still looking for Mike Smith. 473 00:22:45,240 --> 00:22:47,950 And I daresay, I can still look for him in the same way, 474 00:22:47,950 --> 00:22:51,200 splitting the problem in half again, tearing the problem again 475 00:22:51,200 --> 00:22:54,140 in half, which now leaves me with a problem a quarter of the size, 476 00:22:54,140 --> 00:22:58,710 dramatically throw that half away, and repeat this process again and again 477 00:22:58,710 --> 00:23:01,150 and again, glancing down at each point to see 478 00:23:01,150 --> 00:23:03,400 if Mike Smith is on the page in question. 479 00:23:03,400 --> 00:23:06,190 >> Now if I do this right, ultimately I'll find myself 480 00:23:06,190 --> 00:23:11,085 with just one page on which Mike Smith is if he's indeed in the phone book. 481 00:23:11,085 --> 00:23:13,510 Of course, I could never call Mike again. 482 00:23:13,510 --> 00:23:18,800 But the point here is that if we started with 1,000 pages, my first algorithm, 483 00:23:18,800 --> 00:23:21,620 flip the page, maybe 1,000 times-- definitely less because it's 484 00:23:21,620 --> 00:23:26,430 an S name and not a Z name, but as many as 1,000 pages potentially. 485 00:23:26,430 --> 00:23:27,590 >> Second algorithm, better. 486 00:23:27,590 --> 00:23:28,480 500 pages. 487 00:23:28,480 --> 00:23:31,230 Third algorithm, though, how many steps would it 488 00:23:31,230 --> 00:23:35,520 take to divide a 1,000 page phone book in half like that? 489 00:23:35,520 --> 00:23:37,000 10, give or take. 490 00:23:37,000 --> 00:23:40,770 So only by flipping through that phone book, diving and conquering, 491 00:23:40,770 --> 00:23:46,130 so to speak, 10 times, will I make my way down to just one single page. 492 00:23:46,130 --> 00:23:48,880 >> And so we can capture this intuition now a little bit graphically 493 00:23:48,880 --> 00:23:51,320 if you just consider this super simple graph. 494 00:23:51,320 --> 00:23:55,470 We're on the x-axis, or horizontal axis, is the size of my problem, 495 00:23:55,470 --> 00:23:57,100 the number of pages in the phone book. 496 00:23:57,100 --> 00:23:59,040 And computer scientists generally like to call 497 00:23:59,040 --> 00:24:02,180 the size of a problem n, where n is just some variable that 498 00:24:02,180 --> 00:24:04,310 represents-- in this case-- number of pages. 499 00:24:04,310 --> 00:24:07,412 >> The vertical, or y-axis, here is going to be the time to solve, 500 00:24:07,412 --> 00:24:09,870 maybe the number of page turns, maybe the number of seconds 501 00:24:09,870 --> 00:24:11,960 or minutes, whatever your unit of measure is. 502 00:24:11,960 --> 00:24:14,337 And so this red line represents the first algorithm, 503 00:24:14,337 --> 00:24:16,670 because there's a one to one relationship between number 504 00:24:16,670 --> 00:24:18,880 of pages and amount of time it takes. 505 00:24:18,880 --> 00:24:22,240 >> If Verizon doubles the number of pages in the phone book next year, 506 00:24:22,240 --> 00:24:24,590 my running time-- the time required to execute 507 00:24:24,590 --> 00:24:27,610 that first algorithm-- doubles in the worst case. 508 00:24:27,610 --> 00:24:30,690 But the second algorithm, where I'm flipping by two, 509 00:24:30,690 --> 00:24:33,650 requires less time for a given size problem. 510 00:24:33,650 --> 00:24:36,090 So if I have this many pages here-- notice 511 00:24:36,090 --> 00:24:38,870 that the yellow line suggests less time to solve. 512 00:24:38,870 --> 00:24:42,490 And indeed, it represents, we'll say, n over two. 513 00:24:42,490 --> 00:24:47,717 >> But what's the shape of the third and final curve going to look like? 514 00:24:47,717 --> 00:24:50,800 Yeah, it's indeed going to look-- I don't know what you were going to say. 515 00:24:50,800 --> 00:24:52,300 But let's see what you were going to say. 516 00:24:52,300 --> 00:24:53,280 >> AUDIENCE: Like that. 517 00:24:53,280 --> 00:24:57,060 >> DAVID J. MALAN: It's going to look like this, a logarithmic slope-- exactly-- 518 00:24:57,060 --> 00:24:59,770 whereby you have this curious slope. 519 00:24:59,770 --> 00:25:01,235 It's no longer a straight line. 520 00:25:01,235 --> 00:25:05,000 And what's compelling about that is that even though the graph is now cut off, 521 00:25:05,000 --> 00:25:07,790 you can extrapolate in your mind that that green line's not 522 00:25:07,790 --> 00:25:10,060 going to increase in height all that much 523 00:25:10,060 --> 00:25:13,500 as you proceed further down that horizontal axis. 524 00:25:13,500 --> 00:25:15,890 >> Indeed, Verizon, for instance, could double 525 00:25:15,890 --> 00:25:19,100 the number of pages in the phone book between this year and next year 526 00:25:19,100 --> 00:25:22,140 from 1,000 to 2000 pages, but no big deal. 527 00:25:22,140 --> 00:25:24,960 With this third and final, there's a intuitive algorithm 528 00:25:24,960 --> 00:25:26,209 of dividing and conquering. 529 00:25:26,209 --> 00:25:29,000 It's going to take me how many more steps next year to find someone 530 00:25:29,000 --> 00:25:29,700 like Mike Smith? 531 00:25:29,700 --> 00:25:30,560 >> AUDIENCE: One. 532 00:25:30,560 --> 00:25:31,230 >> DAVID J. MALAN: There's just one. 533 00:25:31,230 --> 00:25:34,430 And they can quadruple it, it's going to take me just two more steps 534 00:25:34,430 --> 00:25:35,210 and so forth. 535 00:25:35,210 --> 00:25:38,730 And so this is testament to just how some careful design 536 00:25:38,730 --> 00:25:42,437 and some appreciation for what your inputs are can do even better. 537 00:25:42,437 --> 00:25:44,270 Now we're cheating a little bit in the sense 538 00:25:44,270 --> 00:25:46,350 that we're leveraging an assumption. 539 00:25:46,350 --> 00:25:48,500 What is my assumption about our phone book 540 00:25:48,500 --> 00:25:52,720 that allowed me to divide and conquer in this intuitive and still correct way? 541 00:25:52,720 --> 00:25:53,705 >> AUDIENCE: [INAUDIBLE] 542 00:25:53,705 --> 00:25:54,580 DAVID J. MALAN: Yeah. 543 00:25:54,580 --> 00:25:55,440 So it was ordered. 544 00:25:55,440 --> 00:25:57,392 It was alphabetized by the phone book company. 545 00:25:57,392 --> 00:26:00,100 If it were in random order, that would be a hell of a phone book, 546 00:26:00,100 --> 00:26:02,850 but it certainly wouldn't lend itself to the algorithm 547 00:26:02,850 --> 00:26:05,950 I used, because you would never just happen across Mike Smith 548 00:26:05,950 --> 00:26:09,210 if you kept dividing in half in that way by chance. 549 00:26:09,210 --> 00:26:12,060 >> So let's now formalize what's clearly intuitive. 550 00:26:12,060 --> 00:26:13,950 So something called pseudocode is where we'll 551 00:26:13,950 --> 00:26:15,780 begin some of our initial problems. 552 00:26:15,780 --> 00:26:20,410 And this is a generic way of describing an algorithm or a computer program, 553 00:26:20,410 --> 00:26:24,150 not using C, or C++, or Java, or any specific language, 554 00:26:24,150 --> 00:26:27,430 but just using English, with which any human might be familiar. 555 00:26:27,430 --> 00:26:31,220 >> And we might write the pseudocode for this problem as follows. 556 00:26:31,220 --> 00:26:33,520 Step one, pick up the phone book. 557 00:26:33,520 --> 00:26:35,840 Step two, open to middle of phone book. 558 00:26:35,840 --> 00:26:37,730 Step three, look at the names. 559 00:26:37,730 --> 00:26:40,630 Step four, if Smith is among names-- 560 00:26:40,630 --> 00:26:42,960 >> And now this is an interesting construct. 561 00:26:42,960 --> 00:26:44,290 It's a decision point. 562 00:26:44,290 --> 00:26:47,920 It's a fork in the road, if you will, a branch, so to speak. 563 00:26:47,920 --> 00:26:50,810 So I'm going to indent just by convention step-- 564 00:26:50,810 --> 00:26:53,950 not five-- which is to say, I'll call Mike. 565 00:26:53,950 --> 00:26:57,290 So this indentation, totally arbitrary human convention, but it's 566 00:26:57,290 --> 00:27:01,160 simply meant to convey semantically that if Smith is among names, 567 00:27:01,160 --> 00:27:03,310 then I should call Mike. 568 00:27:03,310 --> 00:27:06,630 >> Meanwhile in step six, notice that the indentation's gone. 569 00:27:06,630 --> 00:27:10,980 So else is the other fork in the road, the other road I might travel. 570 00:27:10,980 --> 00:27:14,130 So else if Smith is earlier in the book, what's 571 00:27:14,130 --> 00:27:16,964 my next step probably going to be here? 572 00:27:16,964 --> 00:27:18,380 AUDIENCE: You go to the left side. 573 00:27:18,380 --> 00:27:21,004 DAVID J. MALAN: Yeah, so go to the left half of the phone book. 574 00:27:21,004 --> 00:27:24,140 Throw away the right half if Smith is earlier in the book. 575 00:27:24,140 --> 00:27:27,140 So open to the middle of the left half of the book. 576 00:27:27,140 --> 00:27:30,240 >> And then step eight, go to line three. 577 00:27:30,240 --> 00:27:34,520 And this is a curious loop I'm inducing, a recursion so to speak. 578 00:27:34,520 --> 00:27:35,990 But more on that in the future. 579 00:27:35,990 --> 00:27:39,590 >> I'm using my same algorithm, my same pseudocode, 580 00:27:39,590 --> 00:27:43,020 to solve the same problem again because the only thing that's changed 581 00:27:43,020 --> 00:27:46,550 is the size of the problem, not my objective, and not the person 582 00:27:46,550 --> 00:27:47,340 I'm looking for. 583 00:27:47,340 --> 00:27:51,610 So I can reuse the algorithm that I've already defined. 584 00:27:51,610 --> 00:27:53,580 >> Else if Smith is later in book-- you might 585 00:27:53,580 --> 00:27:56,200 guess-- open to the middle of the right half of the book. 586 00:27:56,200 --> 00:27:58,350 And again, go to line three. 587 00:27:58,350 --> 00:28:01,480 Else-- what's the final line in this program going to be? 588 00:28:01,480 --> 00:28:03,580 If he's not among the names on the page I'm 589 00:28:03,580 --> 00:28:06,870 on, if he's not earlier in the book, and he's not later 590 00:28:06,870 --> 00:28:09,899 in the book, what do I know is true about Mike Smith now? 591 00:28:09,899 --> 00:28:11,190 AUDIENCE: He's not in the book. 592 00:28:11,190 --> 00:28:12,731 DAVID J. MALAN: He's not in the book. 593 00:28:12,731 --> 00:28:16,040 So the best I can do is just give up and stop this program. 594 00:28:16,040 --> 00:28:16,540 All right. 595 00:28:16,540 --> 00:28:20,350 So at this point, let's take a quick tour of some of what awaits. 596 00:28:20,350 --> 00:28:23,620 And in fact, I'm joined here by a number of CS50 staff. 597 00:28:23,620 --> 00:28:26,940 If these folks could all join me up here on stage. 598 00:28:26,940 --> 00:28:28,900 >> [APPLAUSE] 599 00:28:28,900 --> 00:28:35,280 600 00:28:35,280 --> 00:28:38,170 >> Mind you, this is only a subset of CS50 staff, 601 00:28:38,170 --> 00:28:42,380 since each year we have nearly 100 staff members in roles of course assistants, 602 00:28:42,380 --> 00:28:44,410 teaching fellows, and more. 603 00:28:44,410 --> 00:28:45,700 Come on up. 604 00:28:45,700 --> 00:28:48,820 So they will join us here awkwardly for just a moment 605 00:28:48,820 --> 00:28:54,230 as we give a whirlwind tour of what you should expect here in the course. 606 00:28:54,230 --> 00:28:59,640 >> So first and foremost, we have SAT/UNS as the grading option in the course. 607 00:28:59,640 --> 00:29:03,180 This is meant deliberately to be an option whereby 608 00:29:03,180 --> 00:29:05,570 if you are a bit uneasy at being in the course, 609 00:29:05,570 --> 00:29:09,390 and you do fear failure-- even if frankly failure means hurting your GPA, 610 00:29:09,390 --> 00:29:13,180 getting a B and not an A-- that is precisely what, certainly for a gateway 611 00:29:13,180 --> 00:29:15,750 course like CS50 and other introductory courses, 612 00:29:15,750 --> 00:29:17,540 this grading option is meant to allow. 613 00:29:17,540 --> 00:29:19,930 >> I wholeheartedly encourage students-- especially 614 00:29:19,930 --> 00:29:23,090 if on the fence-- to start the course SAT/UNS, even remain SAT/UNS. 615 00:29:23,090 --> 00:29:27,310 But you can certainly switch to a letter grade by the fifth Monday in the term. 616 00:29:27,310 --> 00:29:31,560 >> Frankly, back when I was a freshman in 1995, 617 00:29:31,560 --> 00:29:34,630 I myself didn't even take CS50 because I didn't get up the nerve 618 00:29:34,630 --> 00:29:36,540 to actually step foot in the classroom. 619 00:29:36,540 --> 00:29:40,020 It seemed a domain far too unfamiliar to me and really only 620 00:29:40,020 --> 00:29:43,080 for those friends of mine, frankly, who had been programming 621 00:29:43,080 --> 00:29:45,570 since they were six- or maybe 10-years-old. 622 00:29:45,570 --> 00:29:48,640 And it was only because I was able to take CS50 in my day 623 00:29:48,640 --> 00:29:52,720 in the equivalent version of SAT/UNS-- pass/fail back in the day-- 624 00:29:52,720 --> 00:29:53,850 that even I took 50. 625 00:29:53,850 --> 00:29:57,440 And somehow or other, I'm here again with you today. 626 00:29:57,440 --> 00:30:00,690 >> Now meanwhile what else you should keep in mind about 50 627 00:30:00,690 --> 00:30:01,910 is simultaneous enrollment. 628 00:30:01,910 --> 00:30:03,785 Contrary to rumors that you might have heard, 629 00:30:03,785 --> 00:30:07,650 you can, in fact, simultaneously enroll in CS50 and another class that 630 00:30:07,650 --> 00:30:12,150 meets at the same or some overlapping time as CS50's lectures right here. 631 00:30:12,150 --> 00:30:16,420 See the syllabus for the particulars of the implementation thereof. 632 00:30:16,420 --> 00:30:19,540 >> Lectures, meanwhile, contrary to what's officially in the catalog, 633 00:30:19,540 --> 00:30:22,060 will generally only meet for just an hour. 634 00:30:22,060 --> 00:30:24,240 On occasion we may run a little long. 635 00:30:24,240 --> 00:30:26,800 But keep in mind that the goal in CS50's lectures 636 00:30:26,800 --> 00:30:28,980 is to provide you with a conceptual overview, 637 00:30:28,980 --> 00:30:31,830 hopefully some demonstrations, maybe even some giveaways, 638 00:30:31,830 --> 00:30:34,390 of what awaits for the week that follows. 639 00:30:34,390 --> 00:30:37,730 >> And so in lectures, we'll explore those topics and examples together, 640 00:30:37,730 --> 00:30:41,420 bringing students up on stage, and staff up on stage as often as we can, 641 00:30:41,420 --> 00:30:43,740 for just a couple of hours each week. 642 00:30:43,740 --> 00:30:47,435 Sections, meanwhile, will be offered by these folks here-- many 643 00:30:47,435 --> 00:30:50,060 of them teaching fellows, some of them course assistants-- will 644 00:30:50,060 --> 00:30:51,160 be happening weekly. 645 00:30:51,160 --> 00:30:52,940 >> And what's key to keep in mind is that we 646 00:30:52,940 --> 00:30:55,920 do have-- not unlike First Nights, the music class-- 647 00:30:55,920 --> 00:30:59,220 different tracks of sections for students less comfortable, more 648 00:30:59,220 --> 00:31:01,150 comfortable, and somewhere in between. 649 00:31:01,150 --> 00:31:03,559 And frankly, you know if you're less comfortable. 650 00:31:03,559 --> 00:31:05,600 And you probably know if you're more comfortable. 651 00:31:05,600 --> 00:31:09,920 And if you're not really sure, you are by definition somewhere in between. 652 00:31:09,920 --> 00:31:12,850 So when it comes time to section in a week or so, per the syllabus, 653 00:31:12,850 --> 00:31:14,070 we'll ask you that question. 654 00:31:14,070 --> 00:31:16,890 And you can self-select based on your own comfort level 655 00:31:16,890 --> 00:31:22,220 and be with students-- be with green dots-- similar in comfort level to you. 656 00:31:22,220 --> 00:31:25,710 >> Meanwhile, we have problem sets, which will ultimately 657 00:31:25,710 --> 00:31:28,310 define your experience in this course. 658 00:31:28,310 --> 00:31:30,370 They're offered typically in multiple editions. 659 00:31:30,370 --> 00:31:34,150 A standard edition that we expect most every student in the course to tackle 660 00:31:34,150 --> 00:31:37,900 but also a so-called hacker edition that offers no form of extra credit 661 00:31:37,900 --> 00:31:41,980 outright but really the bragging rights to say that you tried and tackled 662 00:31:41,980 --> 00:31:45,250 the course's hacker editions that approach the similar material 663 00:31:45,250 --> 00:31:47,370 but from a more sophisticated angle. 664 00:31:47,370 --> 00:31:49,480 >> What we offer for the standard edition, for, 665 00:31:49,480 --> 00:31:51,420 again, a super majority of students, are not 666 00:31:51,420 --> 00:31:54,060 only walk-throughs, which are videos led by the course's staff 667 00:31:54,060 --> 00:31:57,840 that truly walk you through the course's problems and possible design 668 00:31:57,840 --> 00:31:58,910 implementations. 669 00:31:58,910 --> 00:32:01,434 And we also, after the fact, offer postmortems, 670 00:32:01,434 --> 00:32:03,350 whereby if you're wondering how you could have 671 00:32:03,350 --> 00:32:05,930 or should have solved some problem, the teaching staff 672 00:32:05,930 --> 00:32:08,640 will walk you through those on video as well. 673 00:32:08,640 --> 00:32:14,350 >> Meanwhile, what awaits too are five late days and the fact 674 00:32:14,350 --> 00:32:16,680 that we will drop your lowest problem set score. 675 00:32:16,680 --> 00:32:20,370 We certainly appreciate that in exchange for the workload that 50 expects 676 00:32:20,370 --> 00:32:24,020 of you, life gets in the way sometimes, if not five times. 677 00:32:24,020 --> 00:32:26,150 And so this will offer you a bit of flexibility, 678 00:32:26,150 --> 00:32:29,400 extending your deadline from, say, a Thursday at noon to a Friday at noon. 679 00:32:29,400 --> 00:32:33,150 See the syllabus for the implementation details thereof. 680 00:32:33,150 --> 00:32:34,702 >> Now what now awaits? 681 00:32:34,702 --> 00:32:36,660 And it's only occurring to me now just how long 682 00:32:36,660 --> 00:32:38,333 I'm having you guys stand here on stage. 683 00:32:38,333 --> 00:32:39,060 >> [LAUGHTER] 684 00:32:39,060 --> 00:32:41,867 >> DAVID J. MALAN: But we'll get to the climactic finish before long. 685 00:32:41,867 --> 00:32:43,700 So what awaits in terms of the problem sets? 686 00:32:43,700 --> 00:32:47,099 Well, perhaps a teaser of what we all did last year with your predecessors. 687 00:32:47,099 --> 00:32:49,140 In the first problem set last year, we introduced 688 00:32:49,140 --> 00:32:51,630 Scratch, a graphical programming language that 689 00:32:51,630 --> 00:32:54,570 lets you program literally by dragging and dropping puzzle pieces, 690 00:32:54,570 --> 00:32:57,220 like these, that are reminiscent of the constructs 691 00:32:57,220 --> 00:32:59,260 will see just one week hence, when we switch 692 00:32:59,260 --> 00:33:01,870 to a more traditional language, known as C. 693 00:33:01,870 --> 00:33:03,930 >> Last year we proceeded to this problem set, 694 00:33:03,930 --> 00:33:06,720 involving for cryptography, the scrambling of information 695 00:33:06,720 --> 00:33:10,410 to keep it from governmental or friends' eyes that you don't want to see it. 696 00:33:10,410 --> 00:33:12,540 Encoded in here is a message that soon you 697 00:33:12,540 --> 00:33:15,740 will be able to decrypt or de-scramble. 698 00:33:15,740 --> 00:33:17,960 >> Breakout was a problem set last year, wherein 699 00:33:17,960 --> 00:33:21,530 you use these new found programming skills to actually implement 700 00:33:21,530 --> 00:33:24,840 a game wherein-- as you may recall from childhood-- 701 00:33:24,840 --> 00:33:28,040 the goal was to bash the bricks that are atop the screen 702 00:33:28,040 --> 00:33:30,190 here, accumulating a score along the way, 703 00:33:30,190 --> 00:33:35,460 and implementing your own algorithms with which this solution ultimately 704 00:33:35,460 --> 00:33:37,357 lets you play the game. 705 00:33:37,357 --> 00:33:39,440 Meanwhile, later in the semester, we will give you 706 00:33:39,440 --> 00:33:43,470 a dictionary of 143,091 English words. 707 00:33:43,470 --> 00:33:46,300 And you will be challenged to write a program that 708 00:33:46,300 --> 00:33:50,260 spell checks, documents, by loading that many words into memory 709 00:33:50,260 --> 00:33:52,300 as efficiently as possible. 710 00:33:52,300 --> 00:33:54,240 Generally pitting you against your classmates 711 00:33:54,240 --> 00:33:56,610 if you opt into a bit of a challenge in leader board 712 00:33:56,610 --> 00:34:00,090 to see who can use the fewest seconds of running time, 713 00:34:00,090 --> 00:34:03,550 and the fewest number of megabytes of memory, 714 00:34:03,550 --> 00:34:08,659 and actually fine-tuning your programs to be incredibly resource efficient not 715 00:34:08,659 --> 00:34:09,820 just time. 716 00:34:09,820 --> 00:34:13,239 >> Last year, too, we looked at the end of the semester at web programming. 717 00:34:13,239 --> 00:34:16,230 And indeed, we'll do that again this year with multiple problem sets, 718 00:34:16,230 --> 00:34:20,290 introducing you to the techniques and the mindset with which you can apply 719 00:34:20,290 --> 00:34:23,489 these programming skills to websites, dynamic websites, 720 00:34:23,489 --> 00:34:26,639 websites that actually solve problems and behave differently 721 00:34:26,639 --> 00:34:30,620 and are not simply static sites with static information. 722 00:34:30,620 --> 00:34:32,854 >> The final project ultimately will define, though, 723 00:34:32,854 --> 00:34:34,770 the climax of the course for students, wherein 724 00:34:34,770 --> 00:34:37,228 you'll be challenged to implement most anything of interest 725 00:34:37,228 --> 00:34:40,590 to you, so long as it somehow draws upon the course's lessons. 726 00:34:40,590 --> 00:34:42,930 >> And as you saw in the video at the start, 727 00:34:42,930 --> 00:34:47,340 we will conclude the semester with the CS50 Hackathon, which if, unfamiliar, 728 00:34:47,340 --> 00:34:51,420 will begin at 7:00 PM one night and end at 7:00 AM the next morning. 729 00:34:51,420 --> 00:34:53,614 Around 9:00 PM, we'll order in first dinner. 730 00:34:53,614 --> 00:34:55,489 Around 1:00 AM, we'll order in second dinner. 731 00:34:55,489 --> 00:34:57,490 And if you're still standing at 5:00 AM, we 732 00:34:57,490 --> 00:35:00,320 will shuttle bus you to IHOP for breakfast. 733 00:35:00,320 --> 00:35:04,980 >> The CS50 Fair, meanwhile, is an event to which 2,000 plus faculty, students, 734 00:35:04,980 --> 00:35:07,850 and staff from across campus will come to see your accomplishments 735 00:35:07,850 --> 00:35:10,150 in the course and the final projects and creations 736 00:35:10,150 --> 00:35:14,960 that you create on your laptops, desktops, or perhaps even light bulbs. 737 00:35:14,960 --> 00:35:17,340 >> Meanwhile, office hours and the support structure. 738 00:35:17,340 --> 00:35:20,480 And now it would've been a better time to bring you all up. 739 00:35:20,480 --> 00:35:24,310 >> Office hours will take place four nights a week for multiple hours each night 740 00:35:24,310 --> 00:35:27,710 with generally 20 to 30 of the course's staff on duty at once 741 00:35:27,710 --> 00:35:31,240 to provide you with intimate one-on-one opportunities for support 742 00:35:31,240 --> 00:35:33,790 with the course's problem sets. 743 00:35:33,790 --> 00:35:36,120 Tutoring too will be available, particularly 744 00:35:36,120 --> 00:35:39,630 for students less comfortable-- or dare say least comfortable-- for whom 745 00:35:39,630 --> 00:35:41,869 office hours are not the most nurturing environment 746 00:35:41,869 --> 00:35:43,660 and are certainly not the most stress-free. 747 00:35:43,660 --> 00:35:47,430 Especially when deadlines are pressing, we will proactively pair you ourselves 748 00:35:47,430 --> 00:35:51,440 with a member of the staff to work with on some regular schedule as your needs 749 00:35:51,440 --> 00:35:53,850 and their schedule allows. 750 00:35:53,850 --> 00:35:55,260 >> And staff. 751 00:35:55,260 --> 00:36:01,020 Allow me to introduce Davon, Rob, and Gabriel, this year's heads. 752 00:36:01,020 --> 00:36:02,370 If you would each like to say-- 753 00:36:02,370 --> 00:36:03,349 >> [APPLAUSE] 754 00:36:03,349 --> 00:36:03,849 --a word. 755 00:36:03,849 --> 00:36:05,328 [APPLAUSE] 756 00:36:05,328 --> 00:36:10,270 757 00:36:10,270 --> 00:36:13,220 Davon over here is the course's manager, which 758 00:36:13,220 --> 00:36:15,730 means in his full-time role he helps with the execution 759 00:36:15,730 --> 00:36:18,424 and logistics of CS50. 760 00:36:18,424 --> 00:36:19,340 DAVON: Yeah, hi, guys. 761 00:36:19,340 --> 00:36:20,965 You'll see a lot to me at office hours. 762 00:36:20,965 --> 00:36:22,110 I'll be teaching sections. 763 00:36:22,110 --> 00:36:25,150 And if you shoot emails ahead, I'll probably be responding. 764 00:36:25,150 --> 00:36:27,670 So I'll see lots of you all semester. 765 00:36:27,670 --> 00:36:29,890 And welcome to CS50. 766 00:36:29,890 --> 00:36:38,330 >> DAVID J. MALAN: And now Gabriel, who himself was just a freshman last year, 767 00:36:38,330 --> 00:36:41,820 but for the past couple of years has been operating his own version of CS50 768 00:36:41,820 --> 00:36:44,660 in Brazil, whereby he downloaded all of the course's content-- 769 00:36:44,660 --> 00:36:46,890 which is clearly being filmed and placed online-- 770 00:36:46,890 --> 00:36:51,480 so that he could translate it to Portuguese and then teach more than 100 771 00:36:51,480 --> 00:36:54,610 of his classmates over the course of a couple of years, 772 00:36:54,610 --> 00:36:57,650 teaching in his native tongue the course's curriculum. 773 00:36:57,650 --> 00:36:58,964 >> GABRIEL: Hello. 774 00:36:58,964 --> 00:37:00,912 >> [APPLAUSE] 775 00:37:00,912 --> 00:37:06,669 776 00:37:06,669 --> 00:37:07,710 GABRIEL: Hi, I'm Gabriel. 777 00:37:07,710 --> 00:37:09,340 I'm the head TF of the course. 778 00:37:09,340 --> 00:37:10,780 And I hope you'll love CS50. 779 00:37:10,780 --> 00:37:12,830 This is CS50. 780 00:37:12,830 --> 00:37:14,697 >> DAVID J. MALAN: Now for Rob. 781 00:37:14,697 --> 00:37:15,780 Oh, you want introduction? 782 00:37:15,780 --> 00:37:16,696 >> ROB: No, I don't know. 783 00:37:16,696 --> 00:37:18,225 [LAUGHTER] 784 00:37:18,225 --> 00:37:19,475 DAVID J. MALAN: And Rob Boden. 785 00:37:19,475 --> 00:37:22,300 [LAUGHTER] 786 00:37:22,300 --> 00:37:23,800 ROB: Hi, I'm Rob. 787 00:37:23,800 --> 00:37:27,220 This is my fifth year involved with the course. 788 00:37:27,220 --> 00:37:29,220 Every year, it's just a better and better class, 789 00:37:29,220 --> 00:37:31,550 so you guys are clearly going to be awesome. 790 00:37:31,550 --> 00:37:33,181 I hope you all have fun with it. 791 00:37:33,181 --> 00:37:34,430 I'm going to have fun with it. 792 00:37:34,430 --> 00:37:36,670 So see you around. 793 00:37:36,670 --> 00:37:38,445 >> DAVID J. MALAN: And time won't permit us-- 794 00:37:38,445 --> 00:37:39,670 >> [APPLAUSE] 795 00:37:39,670 --> 00:37:41,661 >> Time won't permit us to introduce everyone 796 00:37:41,661 --> 00:37:44,660 on the stage and all of their colleagues who are shopping classes today. 797 00:37:44,660 --> 00:37:47,390 But allow me to introduce Belinda and CS50 Puzzle 798 00:37:47,390 --> 00:37:49,550 Day, which awaits this coming Saturday, which 799 00:37:49,550 --> 00:37:51,800 is the first of the course's large scale events. 800 00:37:51,800 --> 00:37:54,300 >> This one in particular meant to hammer home the point 801 00:37:54,300 --> 00:37:57,580 that computer science is ultimately not about programming, but rather 802 00:37:57,580 --> 00:37:59,280 about problem solving more generally. 803 00:37:59,280 --> 00:38:01,450 And Puzzle Day, as you'll see, will bring you 804 00:38:01,450 --> 00:38:04,207 and your classmates together-- we hope this Saturday. 805 00:38:04,207 --> 00:38:04,961 >> BELINDA: OK. 806 00:38:04,961 --> 00:38:05,750 Hi, guys. 807 00:38:05,750 --> 00:38:06,740 So thanks. 808 00:38:06,740 --> 00:38:10,120 So as our illustrious captain said, my name's Belinda. 809 00:38:10,120 --> 00:38:12,100 I am a sophomore at Quincy House. 810 00:38:12,100 --> 00:38:15,730 >> I, just like you guys, took CS50 last year, really loved it. 811 00:38:15,730 --> 00:38:17,960 I have a soft spot for you guys in the third row. 812 00:38:17,960 --> 00:38:21,384 And I'm proud to say, I'm now in a committed relationship 813 00:38:21,384 --> 00:38:22,300 with CS50 [INAUDIBLE]. 814 00:38:22,300 --> 00:38:22,799 OK. 815 00:38:22,799 --> 00:38:26,140 That was my lame version of a joke. 816 00:38:26,140 --> 00:38:28,320 >> Anyway, so moving on, just wanted to invite 817 00:38:28,320 --> 00:38:31,439 you guys all to the i-lab, or HBS hives. 818 00:38:31,439 --> 00:38:33,730 We're going to be having Puzzle Day from 12:00 to 3:00. 819 00:38:33,730 --> 00:38:37,680 And it's a great opportunity for you guys to meet your fellow CS friends, 820 00:38:37,680 --> 00:38:42,780 solve some non-CS puzzles, like Captain mentioned, and also eat some free food, 821 00:38:42,780 --> 00:38:46,910 earn some awesome prizes, like gift cards, $75 per person, 822 00:38:46,910 --> 00:38:48,400 and also-- what was it? 823 00:38:48,400 --> 00:38:49,540 Wii U or something? 824 00:38:49,540 --> 00:38:50,333 Wii U? 825 00:38:50,333 --> 00:38:51,040 Yes. 826 00:38:51,040 --> 00:38:52,330 For our raffle. 827 00:38:52,330 --> 00:38:52,830 Awesome. 828 00:38:52,830 --> 00:38:54,310 So I'll stick around after class. 829 00:38:54,310 --> 00:38:56,770 And if you guys have any questions, let me know. 830 00:38:56,770 --> 00:38:59,980 >> DAVID J. MALAN: And you'll see, beyond this there's nothing to do today. 831 00:38:59,980 --> 00:39:01,920 The first problem set will go out Friday. 832 00:39:01,920 --> 00:39:05,420 But to bring us home today, I'd like to introduce you to specifically one more 833 00:39:05,420 --> 00:39:09,080 member of the staff, Colton Ogden here, whose hands are now 834 00:39:09,080 --> 00:39:12,250 protected above you with this MIDI controller 835 00:39:12,250 --> 00:39:15,170 to hammer home the point further that computer science, too, 836 00:39:15,170 --> 00:39:19,130 has applicability far beyond engineering and STEM and computer science itself, 837 00:39:19,130 --> 00:39:22,890 extending even to such domains as music. 838 00:39:22,890 --> 00:39:30,590 >> Colton has kindly offered-- I thought one of them was going to fix the focus. 839 00:39:30,590 --> 00:39:34,400 Andrew, if we could summon focus over here for just a moment. 840 00:39:34,400 --> 00:39:36,780 >> What Colton has done in advance is program 841 00:39:36,780 --> 00:39:40,345 this device, this pad of buttons that you see pictured up here, 842 00:39:40,345 --> 00:39:42,470 as a MIDI controller, whereby each of those buttons 843 00:39:42,470 --> 00:39:47,080 is wired to a particular musical note or a sound, more generally a recording, 844 00:39:47,080 --> 00:39:50,445 such that by playing patterns of these buttons, much like patterns of bits, 845 00:39:50,445 --> 00:39:52,620 can represent other higher level concepts. 846 00:39:52,620 --> 00:39:56,750 Will he be able ultimately to take us home here today? 847 00:39:56,750 --> 00:39:59,540 Without further ado, if we could dim the lights, 848 00:39:59,540 --> 00:40:03,145 and turn on the screen behind Colton. 849 00:40:03,145 --> 00:40:03,865 >> AUDIENCE: Woo! 850 00:40:03,865 --> 00:40:06,090 >> DAVID J. MALAN: This is CS50. 851 00:40:06,090 --> 00:40:10,518 >> [MUSIC PLAYING] 852 00:40:10,518 --> 00:42:46,018 853 00:42:46,018 --> 00:42:49,420 >> [APPLAUSE] 854 00:42:49,420 --> 00:42:54,766 855 00:42:54,766 --> 00:42:56,450 >> That's it for CS50. 856 00:42:56,450 --> 00:42:57,950 We will see you Friday. 857 00:42:57,950 --> 00:42:59,890 Some cake awaits you in the Transept. 858 00:42:59,890 --> 00:43:04,046 859 00:43:04,046 --> 00:43:08,850 >> [MUSIC PLAYING] 860 00:43:08,850 --> 00:45:49,227