1 00:00:00,506 --> 00:03:34,516 [ Music ] 2 00:03:35,016 --> 00:03:45,000 [ Laughing ] 3 00:03:45,516 --> 00:05:50,256 [ Music ] 4 00:05:50,756 --> 00:05:50,826 >> Yeah. 5 00:05:51,516 --> 00:06:00,186 [ Applause ] 6 00:06:00,686 --> 00:06:03,646 >> My name is David Malan and this is CS50. 7 00:06:03,646 --> 00:06:06,896 77% of the people around here 8 00:06:06,896 --> 00:06:09,376 in this room have no prior experience 9 00:06:09,376 --> 00:06:11,006 and that was the same way last year 10 00:06:11,266 --> 00:06:15,446 with your 494 predecessors all of whom accomplished the sorts 11 00:06:15,446 --> 00:06:18,306 of things that you saw depicted in those screens there. 12 00:06:18,586 --> 00:06:21,236 There's a lot of misconceptions about computer science 13 00:06:21,236 --> 00:06:24,276 that it is dominated by folks with their heads 14 00:06:24,276 --> 00:06:26,566 down at computer terminals toiling away, 15 00:06:26,566 --> 00:06:27,976 completely anti-social. 16 00:06:28,306 --> 00:06:31,906 A reputation that it is dominated by men and not 17 00:06:31,956 --> 00:06:34,796 so much women, and yet these are things that are changing. 18 00:06:34,796 --> 00:06:37,596 In fact, last year alone we had a record number of women 19 00:06:37,596 --> 00:06:41,676 in Computer Science 50, up to 37%, almost 40, 20 00:06:41,986 --> 00:06:44,186 and I don't doubt before long that we will be 21 00:06:44,186 --> 00:06:47,256 at 50/50 perhaps even this year here too. 22 00:06:47,526 --> 00:06:50,456 And realize too, that if you're thinking what the hell am I 23 00:06:50,456 --> 00:06:52,256 doing in a computer science class, 24 00:06:52,486 --> 00:06:56,516 realize that same emotion is probably going on in maybe 77% 25 00:06:56,516 --> 00:06:58,676 of the people to your left or to your right today. 26 00:06:58,976 --> 00:07:02,366 But indeed, there's a whole gamut of comfort levels 27 00:07:02,366 --> 00:07:04,476 that we have in this course and these are statistics 28 00:07:04,476 --> 00:07:06,026 that are consistent throughout the years. 29 00:07:06,266 --> 00:07:10,176 Last year 46% of the students in this course declared themselves 30 00:07:10,176 --> 00:07:12,586 as being among those less comfortable. 31 00:07:12,586 --> 00:07:15,426 There's no precise definition for that but you kinda know it 32 00:07:15,506 --> 00:07:17,316 if you're in that bucket and perhaps some 33 00:07:17,316 --> 00:07:19,706 of you have already just slapped that label on yourselves. 34 00:07:19,996 --> 00:07:22,826 We had last year 42% of the students 35 00:07:22,826 --> 00:07:25,656 in the class being somewhere in between less comfortable 36 00:07:25,656 --> 00:07:29,056 and more comfortable with 12% of the class being those types 37 00:07:29,056 --> 00:07:31,146 who may very well have been programming 38 00:07:31,146 --> 00:07:34,306 since they were 10 years old or who took AP computer science, 39 00:07:34,566 --> 00:07:36,896 but we have all sorts of demographics in the class, 40 00:07:36,896 --> 00:07:40,056 and as you'll see today and on Friday, there are a number 41 00:07:40,056 --> 00:07:43,176 of ways in which all students in this class can approach it 42 00:07:43,406 --> 00:07:46,476 and ultimately succeed as in that imagery there. 43 00:07:46,746 --> 00:07:50,056 And in no small part that's because of the sheer size 44 00:07:50,056 --> 00:07:51,726 of the teaching staff this course has. 45 00:07:52,036 --> 00:07:54,766 Seated in front of you are only those TF's and CA's 46 00:07:54,766 --> 00:07:57,066 who are skipping classes right now, 47 00:07:57,066 --> 00:07:59,886 but indeed we have some 87 teaching fellows 48 00:07:59,886 --> 00:08:02,306 and course assistants on staff, many of whom you will meet 49 00:08:02,556 --> 00:08:04,216 over the course of the semester. 50 00:08:04,726 --> 00:08:06,756 Now what is computer science? 51 00:08:06,756 --> 00:08:09,206 We've started this class in recent years 52 00:08:09,206 --> 00:08:11,736 with a little demo involving tearing a phone book 53 00:08:11,736 --> 00:08:14,006 and you might've heard about this sort of thing before 54 00:08:14,226 --> 00:08:16,576 and it's a little hard to keep doing the same bit even though 55 00:08:16,576 --> 00:08:18,766 it might very well send a very compelling, 56 00:08:18,816 --> 00:08:20,326 we think, pedagogical message. 57 00:08:20,586 --> 00:08:23,206 But I just found a huge stack of phone books in [inaudible] 58 00:08:23,396 --> 00:08:26,526 in the computer science building this year, so I thought we might 59 00:08:26,526 --> 00:08:28,586 as well do justice to last year's phone book 60 00:08:28,756 --> 00:08:29,856 by actually having some 61 00:08:29,856 --> 00:08:33,606 of our own team members here answer a question of this form. 62 00:08:33,606 --> 00:08:35,976 So a phone book of this size has, you know, 63 00:08:35,976 --> 00:08:38,046 some 1,000 pages in it. 64 00:08:38,046 --> 00:08:41,176 And this is a fairly tedious problem to solve 65 00:08:41,326 --> 00:08:43,326 if you're looking for something very small, 66 00:08:43,406 --> 00:08:45,256 a needle in a haystack so to speak. 67 00:08:45,436 --> 00:08:48,026 And so if you're looking for, let's suppose these are not 68 00:08:48,026 --> 00:08:50,466 so much yellow pages but white pages with people's names 69 00:08:50,466 --> 00:08:52,116 in them, someone like Mike Smith, 70 00:08:52,446 --> 00:08:55,446 well you could certainly start at the beginning and turn 71 00:08:55,446 --> 00:08:58,266 to the next page and you could see that you're on the A's. 72 00:08:58,656 --> 00:09:01,436 You could see that you're on the B's and the C's and then 73 00:09:01,496 --> 00:09:05,666 so forth and my god some 600 700 pages later, we might happen 74 00:09:05,666 --> 00:09:08,466 across Mike Smith, but if we could perhaps have 75 00:09:08,466 --> 00:09:12,186 about every third TF and CA here stand up, 76 00:09:12,466 --> 00:09:15,486 perhaps we can do something a little more compelling than that 77 00:09:15,846 --> 00:09:18,376 and send home the first such message of the day 78 00:09:18,646 --> 00:09:21,606 as to what it actually means to do computer science 79 00:09:21,606 --> 00:09:23,476 and to solve problems, as we say 80 00:09:23,476 --> 00:09:25,066 in the course catalog description, 81 00:09:25,366 --> 00:09:27,586 more efficiently and more effectively. 82 00:09:27,586 --> 00:09:29,836 Those TF's and CA's who now have handbooks, 83 00:09:29,966 --> 00:09:33,296 phone books in their hands, if you could please stand up 84 00:09:34,146 --> 00:09:38,026 and let's see if we can't have the audience here too answer a 85 00:09:38,026 --> 00:09:41,416 bit of, here we are, let's see do you wanna just keep passing 86 00:09:41,416 --> 00:09:43,906 these down, otherwise this is gonna take all day. 87 00:09:44,786 --> 00:09:47,556 Why don't we have each of these guys solve this 88 00:09:47,596 --> 00:09:50,066 in what's probably a much more intuitive way. 89 00:09:50,336 --> 00:09:53,006 I'll hang onto one for myself and of course anyone 90 00:09:53,006 --> 00:09:56,346 from the audience probably now can point out that my algorithm, 91 00:09:56,556 --> 00:09:59,506 my procedure that I proposed a moment ago starting 92 00:09:59,506 --> 00:10:02,716 at the beginning and turning to the right, turning to the right, 93 00:10:02,926 --> 00:10:04,346 might very well be correct. 94 00:10:04,346 --> 00:10:07,506 And indeed it is correct but it's kind of stupid, right? 95 00:10:07,546 --> 00:10:09,176 Because clearly we can do better than this. 96 00:10:09,176 --> 00:10:10,146 So anyone in the audience, 97 00:10:10,146 --> 00:10:13,066 what would a reasonable human being do to find Mike Smith 98 00:10:13,066 --> 00:10:14,236 in a phone book of this size? 99 00:10:15,196 --> 00:10:16,536 >> Tear it in half. 100 00:10:16,536 --> 00:10:17,826 >> So te- tear it in half. 101 00:10:18,176 --> 00:10:18,826 So we'll get there. 102 00:10:20,276 --> 00:10:22,016 So you'd look roughly in the middle right? 103 00:10:22,016 --> 00:10:24,486 You sort of haphazardly pull it on into the inside. 104 00:10:24,486 --> 00:10:26,046 So if our volunteers here standing 105 00:10:26,046 --> 00:10:28,376 with phone books could do exactly that, odds are, 106 00:10:28,376 --> 00:10:30,336 Matt you ended up at what letter in the alphabet? 107 00:10:31,026 --> 00:10:31,096 >> M. 108 00:10:31,676 --> 00:10:34,636 >> M, indeed which makes sense 'cause it's roughly 109 00:10:34,636 --> 00:10:37,316 in the middle of the alphabet and so Mike Smith is now clearly 110 00:10:37,316 --> 00:10:39,026 to the right so perhaps our TF's 111 00:10:39,026 --> 00:10:41,496 and CA's could demonstrate exactly how we can chop this 112 00:10:41,546 --> 00:10:42,736 problem in half now. 113 00:10:43,516 --> 00:10:50,056 [ Laughing ] 114 00:10:50,556 --> 00:10:54,756 Most. . . perhaps most of our staff can demonstrate this. 115 00:10:55,506 --> 00:10:58,146 So now we've got a problem that's half as big, right? 116 00:10:58,146 --> 00:11:00,606 Now we have the M's through the Z's and so we might dive 117 00:11:00,606 --> 00:11:03,736 in again and so the staff might split the phone book in two 118 00:11:03,736 --> 00:11:07,176 yet again and now we've gone from 1,000 pages to 500. 119 00:11:07,296 --> 00:11:09,326 We're about to go now instead to 250. 120 00:11:09,326 --> 00:11:13,186 So if you'd like to iterate here again and tear. 121 00:11:13,456 --> 00:11:17,146 So now we're down to just 250 pages and if you guys want 122 00:11:17,146 --> 00:11:21,366 to repeat and repeat and repeat, after just a few tearings 123 00:11:21,366 --> 00:11:23,916 of this, only around 10 in fact, 124 00:11:24,146 --> 00:11:27,386 should they finally reach just a single page and on 125 00:11:27,386 --> 00:11:30,156 that page should ideally, if they were paying attention 126 00:11:30,156 --> 00:11:32,756 to the pages that they were tearing be someone, [laughter] 127 00:11:33,146 --> 00:11:35,066 and I don't know what's going 128 00:11:35,066 --> 00:11:37,536 on here [laughter] would be Mike Smith. 129 00:11:39,516 --> 00:11:45,326 [ Applause ] 130 00:11:45,826 --> 00:11:47,316 So thanks to our team here. 131 00:11:47,316 --> 00:11:49,116 These are just a few of the faces you'll meet 132 00:11:49,116 --> 00:11:50,706 over the course of the semester. 133 00:11:50,996 --> 00:11:53,846 You're welcome to sit here the entire lecture, that's fine, 134 00:11:53,946 --> 00:11:56,696 but in a moment we'll need just two of our team. 135 00:11:57,496 --> 00:11:59,216 So what did this really do for us? 136 00:11:59,216 --> 00:12:01,906 Well we went from a problem of size, again, 137 00:12:01,906 --> 00:12:05,586 1,000 down to a problem of size 500 to 250 138 00:12:05,646 --> 00:12:07,336 and this is a very powerful thing. 139 00:12:07,336 --> 00:12:09,416 We're not just taking one page at a time 140 00:12:09,666 --> 00:12:12,306 but rather we're taking huge, non-trivial bites 141 00:12:12,596 --> 00:12:15,816 of this problem out at any given time. 142 00:12:15,816 --> 00:12:18,196 So what does this actually mean? 143 00:12:18,196 --> 00:12:20,806 Well, let's consider another example and, whoops, 144 00:12:20,846 --> 00:12:25,406 let me zoom ahead to an algorithm here 145 00:12:25,406 --> 00:12:27,866 so that we can get the juices flowing among the audience here 146 00:12:27,866 --> 00:12:28,266 as well. 147 00:12:28,266 --> 00:12:30,856 So every year it's a real pain to do attendance in a room 148 00:12:30,856 --> 00:12:32,996 of this size and it would take me forever, 149 00:12:32,996 --> 00:12:34,866 much like it would take me forever to find Mike 150 00:12:34,906 --> 00:12:36,726 in this phone book, I could start sort 151 00:12:36,726 --> 00:12:39,516 of like your grade school teacher would and do one, two, 152 00:12:39,566 --> 00:12:43,206 three, four, five, six, and seven, and finally we'd get 153 00:12:43,206 --> 00:12:45,736 up to N, the total number of students in the room. 154 00:12:46,006 --> 00:12:48,786 Now what's a modification to that algorithm 155 00:12:48,786 --> 00:12:52,176 that you probably learned say in middle school or in high school. 156 00:12:52,176 --> 00:12:54,786 How could we speed up that algorithm very easily, 157 00:12:54,896 --> 00:12:55,756 very mindlessly? 158 00:12:56,476 --> 00:12:57,996 You count by two's right? 159 00:12:57,996 --> 00:12:59,996 Instead of doing one, two, three, I'm pretty good 160 00:12:59,996 --> 00:13:02,956 at counting even numbers so I can do two, four, six, 161 00:13:03,026 --> 00:13:05,326 eight and so forth and so if we were 162 00:13:05,326 --> 00:13:07,886 to plot this just very simply on a chart, 163 00:13:08,126 --> 00:13:11,556 if I said that my original algorithm was just counting one 164 00:13:11,606 --> 00:13:13,946 at a time and there's N students in the room, 165 00:13:14,076 --> 00:13:18,286 well that algorithm's gonna take N steps, N seconds, N minutes, 166 00:13:18,286 --> 00:13:20,536 N operations, whatever the unit of measure is. 167 00:13:20,536 --> 00:13:24,046 But if I start counting in twos, well I can double the speed 168 00:13:24,046 --> 00:13:27,126 of this algorithm and that's pretty good but my god it feels 169 00:13:27,126 --> 00:13:29,206 like there's room for opportunity here 170 00:13:29,406 --> 00:13:30,726 at the right-hand side. 171 00:13:30,726 --> 00:13:32,756 And though I'm jumping around and spoiling some 172 00:13:32,756 --> 00:13:35,546 of the imagery, let's see if we can't paint this picture 173 00:13:35,546 --> 00:13:39,196 as a group as to how much faster we can count everyone 174 00:13:39,196 --> 00:13:40,456 in this room than I could. 175 00:13:40,716 --> 00:13:42,916 So if you would humor us, the staff of 50, 176 00:13:42,916 --> 00:13:46,196 if everyone in this room could now stand up and think 177 00:13:46,196 --> 00:13:52,516 to yourself the number one, go ahead now and execute step two, 178 00:13:52,586 --> 00:13:55,976 pair off with someone near you, add your numbers together 179 00:13:55,976 --> 00:13:57,976 and just one of you should sit down. 180 00:13:58,516 --> 00:14:34,546 [ Audience chatter ] 181 00:14:35,046 --> 00:14:35,906 >> Do we know what the total is roughly? 182 00:14:35,906 --> 00:14:36,156 >> What's that? 183 00:14:36,346 --> 00:14:37,616 >> Do we know what the total is roughly? 184 00:14:37,616 --> 00:14:37,683 >> [Inaudible] 185 00:14:37,683 --> 00:14:40,116 >> Oh god, I don't know. 186 00:14:41,326 --> 00:14:45,786 >> Can you try to figure it out in the next 30 seconds? 187 00:14:45,786 --> 00:14:45,886 >> [Inaudible] 188 00:14:45,886 --> 00:14:45,976 >> Okay. 189 00:14:46,516 --> 00:14:52,026 [ Audience chatter ] 190 00:14:52,526 --> 00:14:54,806 >> So those still standing should continue pairing off. 191 00:14:54,806 --> 00:14:55,016 . . 192 00:14:55,016 --> 00:15:09,000 [ Audience chatter ] 193 00:15:09,046 --> 00:15:10,976 And we see just a few folks still standing. 194 00:15:10,976 --> 00:15:11,043 . . 195 00:15:11,043 --> 00:15:16,000 [ Audience chatter ] 196 00:15:16,806 --> 00:15:18,956 It's at this point where the demonstration starts 197 00:15:18,956 --> 00:15:21,866 to get a little awkward 'cause either the people get far away 198 00:15:21,866 --> 00:15:23,646 or the ri- arithmetic gets difficult. 199 00:15:25,996 --> 00:15:27,956 [laughter] How many folks do we still ste- have standing? 200 00:15:27,956 --> 00:15:29,966 I see one, two at at the top, 201 00:15:29,966 --> 00:15:31,596 you two up at the top can pair up, 202 00:15:31,596 --> 00:15:33,256 you three up at the top can pair off. 203 00:15:33,996 --> 00:15:35,406 Anyone else down here still standing? 204 00:15:35,406 --> 00:15:37,716 You two. What what's your number here? 205 00:15:38,176 --> 00:15:38,416 >> 52. 206 00:15:38,416 --> 00:15:39,396 >> 52 plus? 207 00:15:39,396 --> 00:15:39,796 >> 91. 208 00:15:40,616 --> 00:15:43,716 >> 52 plus 91 and what do we have in the balcony? 209 00:15:43,716 --> 00:15:46,996 >> Balcony, 119. 210 00:15:47,236 --> 00:15:50,506 >> 119 total or just you? 211 00:15:51,006 --> 00:15:55,456 >> [Inaudible] 212 00:15:55,956 --> 00:15:59,386 >> 172? Anyone else still standing? 213 00:15:59,386 --> 00:15:59,506 >> [Inaudible] 214 00:15:59,506 --> 00:16:00,506 >> Okay yeah? 215 00:16:00,926 --> 00:16:02,006 >> 159. 216 00:16:02,506 --> 00:16:06,426 >> 159. Uh oh. 217 00:16:06,666 --> 00:16:09,656 I didn't hit plus, now we're up to 17,000. 218 00:16:09,966 --> 00:16:12,256 [laughter] Anyone else? 219 00:16:12,256 --> 00:16:14,736 We're gonna fake the rest of this. 220 00:16:14,736 --> 00:16:15,296 >> [Inaudible] 221 00:16:15,296 --> 00:16:18,826 >> 45 which puts us at 18,000 [laughter] 222 00:16:19,376 --> 00:16:24,506 and the total should indeed be, did our teaching staff come. 223 00:16:24,506 --> 00:16:24,573 . . 224 00:16:24,573 --> 00:16:25,976 >> Yeah, 570. 225 00:16:26,276 --> 00:16:29,886 >> 570. So plus, wait plus? 226 00:16:30,106 --> 00:16:31,376 >> 121. 227 00:16:31,876 --> 00:16:32,786 >> 121? 228 00:16:32,886 --> 00:16:33,166 >> Yeah. 229 00:16:33,226 --> 00:16:35,176 >> Okay so the the preface 230 00:16:35,176 --> 00:16:36,876 for this demonstration historically is 231 00:16:36,876 --> 00:16:39,956 that this algorithm tends not to work so well in reality, 232 00:16:40,346 --> 00:16:42,056 but there, if you consider it 233 00:16:42,056 --> 00:16:44,716 on a theoretical level how much faster that could, 234 00:16:44,716 --> 00:16:46,876 how much faster that should have gone, 235 00:16:47,066 --> 00:16:49,246 well indeed if I were still counting like this 236 00:16:49,246 --> 00:16:51,666 and there were, let's say 500 people in this room, 237 00:16:51,926 --> 00:16:55,296 my hand would've had to point at 500 people individually, 238 00:16:55,296 --> 00:16:58,486 or better yet maybe 250 total iterations; 239 00:16:58,716 --> 00:17:00,276 but how about your all here? 240 00:17:00,276 --> 00:17:03,876 There's 500 people in the room, but on every iteration 241 00:17:03,876 --> 00:17:06,826 of this algorithm, this procedure, this program, 242 00:17:06,826 --> 00:17:09,416 call it whatever you want-- half of you were sitting down. 243 00:17:09,586 --> 00:17:11,526 So it's much like this same phone book example. 244 00:17:11,526 --> 00:17:15,226 500, 250, 125, and so forth and so 245 00:17:15,226 --> 00:17:18,106 that begs the question how many times can you divide a room full 246 00:17:18,106 --> 00:17:19,546 of 500 people in half? 247 00:17:19,956 --> 00:17:22,916 Well, feels like it's only around nine if you do 248 00:17:22,916 --> 00:17:25,336 out the math and you kind of ignore rounding errors 249 00:17:25,336 --> 00:17:28,396 and so forth you'll get down to a single, lonely, 250 00:17:28,436 --> 00:17:30,606 awkward volunteer standing in the middle 251 00:17:30,606 --> 00:17:33,356 of the room ideally containing that number, 252 00:17:33,356 --> 00:17:35,916 and I simply facilitated here by merging some 253 00:17:35,916 --> 00:17:36,936 of these numbers together. 254 00:17:36,936 --> 00:17:39,936 And that's a powerful thing because if we go back now 255 00:17:39,936 --> 00:17:42,766 to where we started, counting sort of like in grade school, 256 00:17:42,766 --> 00:17:44,916 and then we upgraded to twosies in middle school, 257 00:17:44,916 --> 00:17:48,016 but now we have something fundamentally more powerful 258 00:17:48,336 --> 00:17:51,996 and that's this notion of logarithmic growth as opposed 259 00:17:51,996 --> 00:17:52,896 to something linear-- 260 00:17:52,896 --> 00:17:55,366 linear implying the straight lines there, logarithmic, 261 00:17:55,646 --> 00:17:58,606 this is sort of the end game when trying 262 00:17:58,606 --> 00:17:59,936 to implement something well, 263 00:17:59,936 --> 00:18:01,596 and that will be a theme of this course. 264 00:18:01,736 --> 00:18:03,786 Not just getting something to work, 'cause right, 265 00:18:03,786 --> 00:18:06,056 I could fine Mike Smith the old fashioned way 266 00:18:06,346 --> 00:18:07,916 but it's not slow, it's not efficient. 267 00:18:07,916 --> 00:18:09,436 I'm gonna go use some other website, 268 00:18:09,636 --> 00:18:12,296 I'm gonna go use some other program that performs better 269 00:18:12,296 --> 00:18:15,136 and solves problems more efficiently for me. 270 00:18:15,656 --> 00:18:17,546 Well the other thing about computers is 271 00:18:17,546 --> 00:18:19,796 that they're not all that, 272 00:18:20,006 --> 00:18:26,526 actually I did have one snippet here, let me pull this back. 273 00:18:26,736 --> 00:18:27,186 Wimbledon. 274 00:18:27,556 --> 00:18:31,176 So you might be familiar with the notion of tennis 275 00:18:31,176 --> 00:18:32,956 and these tournaments that happen each year, 276 00:18:32,956 --> 00:18:36,426 and in Wimbledon we have some, 277 00:18:36,426 --> 00:18:40,016 what is it 128 people participating 278 00:18:40,016 --> 00:18:41,026 in a given tournament? 279 00:18:41,246 --> 00:18:43,486 And that tournament actually goes fairly rapidly 280 00:18:43,486 --> 00:18:45,346 because when you're playing tennis of course you're playing 281 00:18:45,346 --> 00:18:48,156 against another person, and so every time a game is played 282 00:18:48,156 --> 00:18:51,166 and if you're assuming single elimination, you get to halve 283 00:18:51,166 --> 00:18:52,996 and halve and halve and halve the number 284 00:18:52,996 --> 00:18:56,696 of players participating until you have ideally just one winner 285 00:18:56,696 --> 00:18:57,666 at the end of the game. 286 00:18:57,856 --> 00:19:02,116 But imagine now how we can apply this idea of divide and conquer, 287 00:19:02,156 --> 00:19:05,066 taking a problem and splitting it in half, and then in half 288 00:19:05,306 --> 00:19:07,386 and then in half whereby we're not doing anything new 289 00:19:07,386 --> 00:19:09,866 and different each time, we're doing the same darn thing again 290 00:19:09,866 --> 00:19:12,686 and again but the problem is rapidly approaching the 291 00:19:12,686 --> 00:19:14,116 solution, just one. 292 00:19:14,366 --> 00:19:17,036 So I looked it up on Wikipedia earlier today and there's 293 00:19:17,036 --> 00:19:20,316 about seven billion people on earth right now. 294 00:19:20,546 --> 00:19:22,436 Well you know what's a pretty powerful thing? 295 00:19:22,436 --> 00:19:25,806 We could actually have a worldwide tennis tournament 296 00:19:26,036 --> 00:19:28,606 where all seven billion, maybe lets even round 297 00:19:28,606 --> 00:19:31,146 up to eight billion people, could participate 298 00:19:31,316 --> 00:19:33,636 and how many rounds would that actually take? 299 00:19:34,246 --> 00:19:37,006 Well, how many times can you divide roughly eight billion 300 00:19:37,006 --> 00:19:37,616 people in half? 301 00:19:37,996 --> 00:19:41,096 Well you go from eight to four, four to two, two to one, 302 00:19:41,336 --> 00:19:43,536 one to a half billion and so forth. 303 00:19:43,726 --> 00:19:46,586 Well you know what, we could knock off this global Wimbledon 304 00:19:46,586 --> 00:19:49,276 tournament after just 33 rounds of play. 305 00:19:49,886 --> 00:19:52,316 Now, admittedly we'd need a whole lot of tennis courts 306 00:19:52,316 --> 00:19:54,746 to be doing this all in parallel and simultaneously 307 00:19:54,946 --> 00:19:56,676 but that's the power of actually thinking through 308 00:19:56,676 --> 00:19:58,336 and actually coming up with algorithms 309 00:19:58,556 --> 00:20:01,626 that are much more elegant and efficient 310 00:20:01,866 --> 00:20:03,786 than what might otherwise be obvious. 311 00:20:04,086 --> 00:20:07,376 The problem though is that computers need to be told what 312 00:20:07,376 --> 00:20:09,716 to do and we've all gotten frustrated by computers 313 00:20:09,716 --> 00:20:11,166 when they don't behave as expected 314 00:20:11,166 --> 00:20:13,926 and that's usually not even your fault, but the fault 315 00:20:13,926 --> 00:20:16,056 of some programmer who made some mistake, 316 00:20:16,056 --> 00:20:17,886 who didn't anticipate some condition, 317 00:20:18,096 --> 00:20:22,306 or made some assumptions that the user then kind of flaunted. 318 00:20:22,456 --> 00:20:23,446 Well what's an example? 319 00:20:23,446 --> 00:20:25,916 Well if you look up most any cooking book, 320 00:20:26,216 --> 00:20:28,686 well a cooking book will typically start with a recipe 321 00:20:28,686 --> 00:20:31,136 in step one something like put egg in bowl. 322 00:20:31,366 --> 00:20:33,776 Well here's a bowl, here's an egg. 323 00:20:33,776 --> 00:20:35,306 It's kind of assuming a few things. 324 00:20:35,826 --> 00:20:38,496 That's not in fact what the author intended, 325 00:20:38,746 --> 00:20:40,346 so we need to be more precise right? 326 00:20:40,346 --> 00:20:43,996 We need to make m- we cannot make so many assumptions. 327 00:20:43,996 --> 00:20:46,306 If we want the computer, if we want the cook 328 00:20:46,356 --> 00:20:50,236 to do what we want him or her to do, we need to be more accurate 329 00:20:50,236 --> 00:20:53,236 and we need to think about how best to express those things. 330 00:20:53,436 --> 00:20:55,996 Now you've probably not had the fun of filling 331 00:20:55,996 --> 00:20:57,996 out your own tax forms, but by contrast, 332 00:20:58,226 --> 00:21:00,806 the world of federal taxes is very much the opposite. 333 00:21:00,806 --> 00:21:03,046 You get these crazy worksheets that are now available 334 00:21:03,336 --> 00:21:06,116 in PDF form or you can use software like TurboTax 335 00:21:06,116 --> 00:21:08,656 and the like, but if you just glance at this sort 336 00:21:08,656 --> 00:21:11,006 of thing you'll see that it's ever so precise. 337 00:21:11,006 --> 00:21:13,756 For instance, it asks you to check a box and input a number 338 00:21:13,756 --> 00:21:15,986 in row five, in row six, in row seven, 339 00:21:15,986 --> 00:21:18,076 and then it explicitly says in row nine, 340 00:21:18,316 --> 00:21:20,016 add lines five through eight. 341 00:21:20,016 --> 00:21:22,596 In other words, the process of taxes is actually, 342 00:21:22,596 --> 00:21:24,906 though overwhelming, much more precise. 343 00:21:24,906 --> 00:21:26,856 It doesn't just say add up what you earned this year 344 00:21:26,856 --> 00:21:27,886 and let us know, right? 345 00:21:27,886 --> 00:21:29,496 It's much more precise than that. 346 00:21:30,026 --> 00:21:33,216 So perhaps we could do something like that along the lines 347 00:21:33,216 --> 00:21:36,496 of something more familiar and less daunting than taxes. 348 00:21:36,776 --> 00:21:39,436 In a moment I'm gonna go ahead and play some background music 349 00:21:39,436 --> 00:21:43,126 and let me ask that you humor us here too by pulling out a sheet 350 00:21:43,126 --> 00:21:47,146 of paper and writing in no more than one, maybe two minutes, 351 00:21:47,446 --> 00:21:49,946 an algorithm, a ste- a set of procedures, 352 00:21:49,946 --> 00:21:51,776 some number of steps line by line 353 00:21:52,086 --> 00:21:55,596 with which you could instruct a computer or a human 354 00:21:55,656 --> 00:21:59,776 or just a friend to make you a peanut butter and jelly sandwich 355 00:21:59,966 --> 00:22:02,616 and assume only that you have a jar of peanut butter, 356 00:22:02,866 --> 00:22:05,936 a jar of jelly, a loaf of bread, and a knife. 357 00:22:06,226 --> 00:22:09,406 You have those as your ingredients and so if you would, 358 00:22:09,976 --> 00:22:13,026 take just one minute or two to write out this algorithm 359 00:22:13,326 --> 00:22:14,966 and we'll see how well we have done. 360 00:22:15,516 --> 00:22:21,516 [ Pause ] 361 00:22:22,016 --> 00:22:52,000 [ Music ] 362 00:22:52,446 --> 00:22:53,816 I'll let it play at least once more. 363 00:22:54,516 --> 00:23:23,546 [ Music ] 364 00:23:24,046 --> 00:23:24,976 Let's do one more iteration. 365 00:23:25,516 --> 00:23:56,566 [ Music ] 366 00:23:57,066 --> 00:23:58,836 And go ahead and finish what you're working on. 367 00:23:59,156 --> 00:24:01,406 I'm gonna need a couple of volunteers. 368 00:24:01,636 --> 00:24:03,576 How 'bout you two lovely contestants? 369 00:24:04,176 --> 00:24:05,246 Come on up. 370 00:24:05,246 --> 00:24:10,906 And how 'bout you folks who have not been prepped on the staff? 371 00:24:10,906 --> 00:24:13,706 Yes I see two hands, how 'bout in the red shirt here and some 372 00:24:13,706 --> 00:24:16,726 of someone from this side, someone from this side. 373 00:24:17,216 --> 00:24:17,736 . . more interest. 374 00:24:17,966 --> 00:24:18,536 More interest. 375 00:24:18,686 --> 00:24:21,436 I'm not seeing the, how 'bout you with your hand the highest? 376 00:24:21,656 --> 00:24:23,596 There. Ri- yup, you who just turned around. 377 00:24:23,656 --> 00:24:24,806 Yeah, come on down. 378 00:24:27,546 --> 00:24:29,646 There'll be ample opportunities during the remainder 379 00:24:29,646 --> 00:24:30,256 of the term. 380 00:24:30,366 --> 00:24:32,626 So, now there's still an opportunity 381 00:24:32,626 --> 00:24:34,526 for some participation here. 382 00:24:35,056 --> 00:24:38,036 I need two people's algorithms 383 00:24:38,036 --> 00:24:39,506 that they actually wrote down, all right? 384 00:24:39,826 --> 00:24:40,356 Better be good. 385 00:24:40,356 --> 00:24:41,206 Thank you. 386 00:24:42,786 --> 00:24:43,666 >> Preview it, it's right there. 387 00:24:43,666 --> 00:24:46,296 >> Okay. Not gonna get this back if that's okay. 388 00:24:46,766 --> 00:24:48,926 And one more volunteer. 389 00:24:48,926 --> 00:24:49,476 >> [Inaudible] 390 00:24:49,476 --> 00:24:51,326 >> All right. 391 00:24:51,766 --> 00:24:54,036 All right these'll be very short demos. 392 00:24:54,176 --> 00:24:58,586 All right, so we've got four of our volunteers here, 393 00:24:58,906 --> 00:25:02,076 only two of whom I actually know. 394 00:25:02,076 --> 00:25:02,866 So let's see your name is? 395 00:25:02,976 --> 00:25:03,476 >> I'm Daniel. 396 00:25:03,566 --> 00:25:03,926 >> Daniel. 397 00:25:04,246 --> 00:25:07,796 David. All right this is Rob, Zmyla and. 398 00:25:07,796 --> 00:25:08,126 . . 399 00:25:08,126 --> 00:25:08,396 >> Lisa. 400 00:25:08,526 --> 00:25:09,366 >> Lisa. David. 401 00:25:09,596 --> 00:25:10,956 All right so I just so happened to go 402 00:25:10,956 --> 00:25:12,786 to the supermarket before this example 403 00:25:12,786 --> 00:25:14,856 and this was actually inspired by my fifth grade teacher 404 00:25:14,856 --> 00:25:16,796 who at the time, I'm pretty sure did not intend this 405 00:25:16,796 --> 00:25:19,226 to be any sort of demonstration in the pedagogy 406 00:25:19,226 --> 00:25:22,386 of computer science and the ideas behind algorithms, 407 00:25:22,386 --> 00:25:25,096 but really just how to teach 10 year olds how 408 00:25:25,096 --> 00:25:26,316 to follow directions. 409 00:25:26,316 --> 00:25:29,226 Well let's see if we can't go borrow the same spirit of this 410 00:25:29,486 --> 00:25:32,906 since I was well equipped here to go and pick 411 00:25:32,906 --> 00:25:33,966 up some loaves of bread. 412 00:25:35,706 --> 00:25:38,106 So we've got some bread for each of you. 413 00:25:38,156 --> 00:25:40,506 [bag rustling] All right. 414 00:25:42,516 --> 00:25:46,846 [ Pause ] 415 00:25:47,346 --> 00:25:52,976 We've got some jelly here and a knife as promised. 416 00:25:53,516 --> 00:26:01,586 [ Pause ] 417 00:26:02,086 --> 00:26:04,616 We've got knives for each of you. 418 00:26:05,096 --> 00:26:07,726 And lastly, the final ingredient with which 419 00:26:07,826 --> 00:26:09,866 to see how well these algorithms performed-- 420 00:26:10,516 --> 00:26:16,686 [ Pause ] 421 00:26:17,186 --> 00:26:23,166 [laughter] All right, so let's see how our two volunteers 422 00:26:23,166 --> 00:26:23,526 here did. 423 00:26:23,526 --> 00:26:25,486 So I'll go ahead and be the advisor. 424 00:26:25,886 --> 00:26:28,736 You all should be behaving in exactly the same manner 425 00:26:28,736 --> 00:26:32,046 that a computer or a robot, let's say, 426 00:26:32,046 --> 00:26:36,316 would actually interpret these as making no assumptions. 427 00:26:36,316 --> 00:26:39,826 All right, step one, go to the Annenberg lunch table. 428 00:26:39,826 --> 00:26:40,106 [laughter] Okay. 429 00:26:42,116 --> 00:26:45,586 All right let's try, let's start with the other one 430 00:26:45,586 --> 00:26:47,346 and see where this gets us. 431 00:26:47,346 --> 00:26:51,246 [laughter] So, step one here is take two slices 432 00:26:51,246 --> 00:26:51,936 of bread from the loaf. 433 00:26:52,516 --> 00:27:04,686 [ Laughter ] 434 00:27:05,186 --> 00:27:06,936 Incidentally, I should've said this before, 435 00:27:06,936 --> 00:27:08,946 you have to be comfortable appearing on camera 436 00:27:08,946 --> 00:27:11,796 and on the internet as we do this. 437 00:27:12,146 --> 00:27:19,126 Okay. All right step two, apply two tablespoons 438 00:27:19,126 --> 00:27:20,976 of jelly on both halves. 439 00:27:21,516 --> 00:27:52,836 [ Laughter ] 440 00:27:53,336 --> 00:27:55,586 Step three, apply two tablespoons 441 00:27:55,586 --> 00:27:56,956 of peanut butter in the same way. 442 00:27:57,516 --> 00:28:13,516 [ Laughter ] 443 00:28:14,016 --> 00:28:25,000 [ Applause ] 444 00:28:25,736 --> 00:28:27,976 Step four, join the two halves 445 00:28:28,516 --> 00:28:36,016 [ Laughter ] 446 00:28:36,516 --> 00:28:38,936 And step five, perhaps coupled with a round 447 00:28:38,936 --> 00:28:39,966 of applause, have fun. 448 00:28:40,516 --> 00:28:48,436 [ Applause ] 449 00:28:48,936 --> 00:28:52,876 So, thank you very much to our volunteers. 450 00:28:53,046 --> 00:28:54,956 The the sandwiches are yours. 451 00:28:55,446 --> 00:28:58,586 So, suffice it to say that there's room for improvement 452 00:28:58,586 --> 00:28:59,466 in something like this. 453 00:28:59,466 --> 00:29:01,506 And this might seem like a ridiculous visual 454 00:29:01,506 --> 00:29:03,786 but the reality is when it comes time this semester 455 00:29:03,786 --> 00:29:05,756 to instruct a computer to do something, 456 00:29:05,756 --> 00:29:08,626 you'll be surprised just how often and how bad you are 457 00:29:08,626 --> 00:29:11,096 at that when you're doing this, 458 00:29:11,236 --> 00:29:13,996 most likely for the very first time-- 459 00:29:15,036 --> 00:29:17,976 when you're doing this for the very first time. 460 00:29:18,046 --> 00:29:21,936 And so among the lessons that will become ingrained 461 00:29:21,936 --> 00:29:25,696 over time honestly is truly how to think more carefully, 462 00:29:25,696 --> 00:29:27,706 how to think more precisely and in turn, 463 00:29:27,916 --> 00:29:30,166 how to express yourself -- if you can just take the tables 464 00:29:30,166 --> 00:29:33,786 with you-- how to express yourself more methodically 465 00:29:33,786 --> 00:29:36,666 so that the person hearing your counsel, the person hearing 466 00:29:36,666 --> 00:29:40,076 and taking your instructions can actually implement 467 00:29:40,076 --> 00:29:41,086 them correctly. 468 00:29:41,226 --> 00:29:44,386 Now let's come back to this notion of numbers 469 00:29:44,386 --> 00:29:47,366 and this notion of solving things more efficiently, 470 00:29:47,366 --> 00:29:51,666 and this notion of dividing and conquering and really the notion 471 00:29:51,666 --> 00:29:55,166 of things taking more time or less time-- 472 00:29:55,606 --> 00:29:59,326 [laughter] all attention is clearly focused right here right 473 00:29:59,326 --> 00:29:59,976 now isn't it? 474 00:30:00,516 --> 00:30:04,546 [ Pause ] 475 00:30:05,046 --> 00:30:05,136 Okay. 476 00:30:05,136 --> 00:30:06,526 >> We have an algorithm too. 477 00:30:06,626 --> 00:30:07,246 >> No problem. 478 00:30:09,566 --> 00:30:10,836 Very nice. 479 00:30:10,996 --> 00:30:12,546 All over the internet this is now. 480 00:30:13,096 --> 00:30:15,586 All right thank you to the team. 481 00:30:15,676 --> 00:30:18,736 So consider this, suppose you were asked, 482 00:30:18,736 --> 00:30:21,586 and let's pick a volunteer up front here 483 00:30:21,876 --> 00:30:22,776 since you just caught my eye. 484 00:30:23,076 --> 00:30:24,706 So we can have this conversation right here. 485 00:30:24,706 --> 00:30:27,146 I will hand you a million dollars, 486 00:30:27,146 --> 00:30:29,506 I will write you a check right now for a million dollars 487 00:30:29,566 --> 00:30:34,186 or instead you can have a penny today but two pennies tomorrow, 488 00:30:34,656 --> 00:30:37,726 four pennies the next day but just for a month. 489 00:30:37,886 --> 00:30:38,736 Which would you prefer? 490 00:30:38,736 --> 00:30:38,803 >> [Inaudible] 491 00:30:38,803 --> 00:30:39,906 >> Take the pennies. 492 00:30:40,076 --> 00:30:43,476 >> All right so right, frankly, whenever asked in life 493 00:30:43,476 --> 00:30:45,356 to make a choice between something that sounds good 494 00:30:45,356 --> 00:30:47,386 and something that sounds stupid, take the stupid thing 495 00:30:47,606 --> 00:30:49,606 because there's probably a hidden lesson 496 00:30:49,606 --> 00:30:50,926 in there and indeed there is. 497 00:30:51,206 --> 00:30:54,366 If we consider this-- oh I just reneged didn't I? 498 00:30:54,436 --> 00:30:58,006 So consider this-- actually we did come prepared. 499 00:30:58,916 --> 00:31:01,016 Can't quite cover it today, but this'll get me 500 00:31:01,016 --> 00:31:02,026 through the week I think. 501 00:31:03,116 --> 00:31:06,176 [laughter] So why do I suggest we can't quite cover that? 502 00:31:06,176 --> 00:31:08,206 Well let me just open up something like Excel. 503 00:31:08,416 --> 00:31:10,306 Let me say now and just once 504 00:31:10,366 --> 00:31:14,036 that Excel is not computer science, but we'll use it simply 505 00:31:14,036 --> 00:31:16,686 because it's a nice way of just doing some numbers real quickly. 506 00:31:16,686 --> 00:31:19,886 So suppose that on day one I were given a single penny 507 00:31:20,086 --> 00:31:22,796 and on day two I get twice as many and then twice as many. 508 00:31:22,956 --> 00:31:25,216 Well I can do a silly little Excel formula here 509 00:31:25,216 --> 00:31:28,326 where I just say times, times two, 510 00:31:28,696 --> 00:31:32,596 and then I can just repeat this and repeat this and repeat this 511 00:31:32,756 --> 00:31:34,496 and repeat this, and this is getting tedious 512 00:31:34,496 --> 00:31:37,836 so let me just highlight all the way up to say 31 days in a month 513 00:31:38,116 --> 00:31:40,266 and his paste, and by the time I get 514 00:31:40,266 --> 00:31:43,596 up here you might very well have made the right choice. 515 00:31:43,596 --> 00:31:45,846 In fact just to make this point ever so clear, 516 00:31:45,846 --> 00:31:49,116 let's go up to formatting-- this too, not computer science-- 517 00:31:49,406 --> 00:31:51,186 let's go to currency, okay, 518 00:31:51,186 --> 00:31:53,406 just so we can see this a bit more visually, and my god! 519 00:31:53,796 --> 00:31:55,846 You banked 10 million dollars 520 00:31:55,846 --> 00:31:58,796 from that deal so, three weeks ago. 521 00:31:59,496 --> 00:32:01,776 So it's quite extraordinary what happens 522 00:32:01,776 --> 00:32:03,056 and what's the relationship here? 523 00:32:03,056 --> 00:32:05,116 Well the actual math behind all of this 524 00:32:05,116 --> 00:32:06,956 and the actual thinking is actually the same; 525 00:32:06,956 --> 00:32:09,776 whereas before we were dividing, dividing, dividing, and dividing 526 00:32:09,776 --> 00:32:11,646 in half again and again and that allowed us 527 00:32:11,646 --> 00:32:15,566 to solve something much faster than with some simple, if naive, 528 00:32:15,566 --> 00:32:18,156 approach, the implications are the same in reverse. 529 00:32:18,156 --> 00:32:21,376 So if you actually do something foolishly, or in this case 530 00:32:21,376 --> 00:32:25,386 without thinking, the cost can certainly pile up over time. 531 00:32:25,386 --> 00:32:26,966 And so one of the other themes in the course, 532 00:32:27,176 --> 00:32:29,476 and in programming more generally is going to be 533 00:32:29,686 --> 00:32:31,686 about the amount of time it actually takes 534 00:32:31,976 --> 00:32:33,596 for your programs to solve problems. 535 00:32:33,596 --> 00:32:36,586 Every one of us has probably gotten angry at our computers 536 00:32:36,586 --> 00:32:38,856 at some point 'cause of the stupid spinning beach ball 537 00:32:38,996 --> 00:32:40,896 or hour glass or something like that 538 00:32:41,236 --> 00:32:43,276 that means it's thinking or doing something. 539 00:32:43,276 --> 00:32:46,246 Well it's probably not doing it all that well, and once you get 540 00:32:46,246 --> 00:32:49,596 to the point of implementing the next Facebook or Google.com, 541 00:32:49,816 --> 00:32:52,756 you've got to be better than just linearly searching 542 00:32:52,756 --> 00:32:55,626 through all possible pages on the internet in order 543 00:32:55,626 --> 00:32:58,206 to find some search term of interest to you. 544 00:32:58,366 --> 00:33:02,346 Well this sort of works in the s- in a similar way too, 545 00:33:02,416 --> 00:33:05,006 and I mentioned here Facebook-- you're familiar with the notion 546 00:33:05,006 --> 00:33:08,156 of the six degrees of Kevin Bacon perhaps whereby you are 547 00:33:08,156 --> 00:33:11,776 probably connected to someone else via at least six friends. 548 00:33:11,776 --> 00:33:14,386 So I might be friends with Alice, Alice with Bob, 549 00:33:14,386 --> 00:33:16,936 Bob with Charlie and so forth and at some point, 550 00:33:17,176 --> 00:33:19,066 one of those people in that relationship is going 551 00:33:19,066 --> 00:33:20,746 to know Kevin Bacon of all people. 552 00:33:20,986 --> 00:33:22,406 But what's the implication of that? 553 00:33:22,406 --> 00:33:24,876 Well you can actually feel this all the more these days 554 00:33:24,876 --> 00:33:26,606 with Facebook and the like because even 555 00:33:26,606 --> 00:33:28,826 if I imagine something quite simple-- 556 00:33:28,826 --> 00:33:31,706 suppose I have just 100 friends. 557 00:33:32,276 --> 00:33:34,806 Well that's actually in Facebook terms these days actually 558 00:33:34,806 --> 00:33:35,926 relatively low right? 559 00:33:35,966 --> 00:33:38,836 But we'll start at that particular point and I'll see 560 00:33:38,836 --> 00:33:43,726 if I actually multiplied, let's say the previous cell up there 561 00:33:44,236 --> 00:33:49,196 by 100 again, the idea being well if I have 100 friends, 562 00:33:49,566 --> 00:33:52,246 those friends, let's assume for simplicity, have 100 friends 563 00:33:52,446 --> 00:33:54,726 and their friends of friends have 100 friends, 564 00:33:54,956 --> 00:33:56,896 how much does this blow up? 565 00:33:57,016 --> 00:33:59,956 Well let's actually do this for six degrees, up to six 566 00:33:59,956 --> 00:34:03,376 and my god, by the time you get six degrees away, 567 00:34:03,376 --> 00:34:04,856 no wonder you know Kevin Bacon 568 00:34:04,856 --> 00:34:08,626 because you have a trillion people in your social network. 569 00:34:08,826 --> 00:34:12,306 Now back in the day a few years ago when Facebook belo- 570 00:34:12,446 --> 00:34:15,126 began only at Harvard and was initially only available 571 00:34:15,126 --> 00:34:17,446 to Harvard students and then nearby universities, 572 00:34:17,656 --> 00:34:18,976 they actually had a neat feature 573 00:34:18,976 --> 00:34:21,606 where they would show you a graph, a visualization 574 00:34:21,606 --> 00:34:24,066 of your friends and your friends of friends and then they ripped 575 00:34:24,066 --> 00:34:25,736 that out and removed it altogether 576 00:34:25,736 --> 00:34:28,266 and at best these days maybe you have some kind of relationship 577 00:34:28,346 --> 00:34:31,246 with friends of friends, because to actually transitively 578 00:34:31,246 --> 00:34:34,326 continue this out, I mean my god you end up knowing everybody 579 00:34:34,326 --> 00:34:37,726 on Facebook and more people than there actually are 580 00:34:37,916 --> 00:34:39,366 in the world at this point. 581 00:34:39,536 --> 00:34:42,076 And so these numbers start to build up, 582 00:34:42,356 --> 00:34:44,226 both upwardly and downwardly. 583 00:34:44,336 --> 00:34:47,206 Well along those lines, let me tease you with this. 584 00:34:47,636 --> 00:34:50,116 So we have a lot of friends that Facebook being that it did 585 00:34:50,116 --> 00:34:53,206 in fact have its origins here and I thought I would tease you 586 00:34:53,206 --> 00:34:54,306 with a little image here. 587 00:34:54,556 --> 00:34:56,806 What we thought we would do this year is invite some 588 00:34:56,806 --> 00:34:59,846 of our friends from Facebook back to campus to some of, 589 00:34:59,926 --> 00:35:04,586 CD50 TF's no less, to help us explore some things like this. 590 00:35:04,586 --> 00:35:06,816 I won't leave this on the screen for too long. 591 00:35:06,816 --> 00:35:09,526 It will be in a PDF online on the course's website if you'd 592 00:35:09,526 --> 00:35:12,616 like to noodle through it further, but this is an example 593 00:35:12,866 --> 00:35:15,486 of a puzzle, and it's hopefully non-obvious 594 00:35:15,796 --> 00:35:17,726 and this too doesn't necessarily relate 595 00:35:17,726 --> 00:35:19,806 to computer science per se but more generally 596 00:35:20,076 --> 00:35:21,416 to the solving of problems. 597 00:35:21,416 --> 00:35:23,306 And that really is what this course is about. 598 00:35:23,306 --> 00:35:26,606 Though we will use programming as a tool to solve problems, 599 00:35:26,846 --> 00:35:30,056 the course at the end of the day is about reasoning through, 600 00:35:30,056 --> 00:35:32,826 taking inputs, producing outputs, and figuring 601 00:35:32,826 --> 00:35:34,606 out the solutions there too. 602 00:35:34,886 --> 00:35:36,206 Now what's the relevance here? 603 00:35:36,416 --> 00:35:38,466 Well our friends at Facebook have kindly offered 604 00:35:38,466 --> 00:35:40,556 to take us all out, or some subset of us, 605 00:35:40,556 --> 00:35:41,806 out to dinner on Friday. 606 00:35:42,116 --> 00:35:45,836 More on that in a little while via email this week, 607 00:35:46,176 --> 00:35:48,326 but they'll also be joining us on Saturday. 608 00:35:48,326 --> 00:35:50,416 And if of interest to you, from roughly 12 609 00:35:50,416 --> 00:35:55,306 to 3 p.m. this Saturday will we have the first ever CS50 puzzle 610 00:35:55,306 --> 00:35:57,176 day sponsored by Facebook. 611 00:35:57,176 --> 00:35:59,996 If this is of interest to you, just go at some point today 612 00:35:59,996 --> 00:36:02,626 to cs50.net/register and the way 613 00:36:02,626 --> 00:36:05,276 in which this will work is you will arrive, you'll be fed, 614 00:36:05,646 --> 00:36:09,136 you'll then be challenged with a handful of PDF's or printouts 615 00:36:09,136 --> 00:36:12,656 of seven prod- p- puzzles similar in spirit to those 616 00:36:12,656 --> 00:36:15,036 but each quite distinct that somehow spell 617 00:36:15,116 --> 00:36:17,696 out a seven letter word that's in fact going 618 00:36:17,696 --> 00:36:19,826 to be a seven letter word on campus. 619 00:36:20,096 --> 00:36:22,386 And if you then go seek that out and do that quicker 620 00:36:22,386 --> 00:36:25,216 than everyone else, you will win some fabulous prizes, 621 00:36:25,336 --> 00:36:28,246 among the first prizes for teams will be some $50 gift 622 00:36:28,246 --> 00:36:31,416 certificates, $25 gift certificates for the runners up, 623 00:36:31,626 --> 00:36:33,856 and for anyone who participates will there be 624 00:36:33,986 --> 00:36:39,186 on a raffle basis a wii given to anyone randomly who partakes, 625 00:36:39,186 --> 00:36:41,136 irrespective of performance in the puzzles. 626 00:36:41,136 --> 00:36:43,926 But, so that this is inherently a social activity 627 00:36:44,096 --> 00:36:46,426 and not a whole bunch of individual people hunkered 628 00:36:46,426 --> 00:36:49,226 down solving puzzles on their own, you'll be required to bring 629 00:36:49,226 --> 00:36:52,236 at least one friend, ideally someone from outside this room, 630 00:36:52,236 --> 00:36:53,976 outside taking CS50 this year, 631 00:36:54,236 --> 00:36:56,086 but up to a maximum of four teammates. 632 00:36:56,086 --> 00:36:58,936 So if you have some block group, blocking group friends 633 00:36:58,936 --> 00:37:01,096 or some link-mates or the like with whom you would 634 00:37:01,096 --> 00:37:03,246 like to do this, we'll post more details 635 00:37:03,246 --> 00:37:06,176 on the course's home page at cs50.net, but do take care 636 00:37:06,176 --> 00:37:10,206 to register because seats will be limited, and if an interest 637 00:37:10,206 --> 00:37:12,536 in the idea of dining with me and some of the TF's 638 00:37:12,536 --> 00:37:16,596 and CA's this Friday night, go to the cs50.net/rsvp 639 00:37:16,596 --> 00:37:20,136 and we will, if necessary, lottery things off 640 00:37:20,746 --> 00:37:22,436 so that you don't need to all be doing this now, 641 00:37:22,436 --> 00:37:24,656 especially since there's not so great wi-fi in Sanders, 642 00:37:24,916 --> 00:37:26,896 we'll actually follow up via the website 643 00:37:27,026 --> 00:37:28,616 and randomize things as needed. 644 00:37:28,616 --> 00:37:30,216 So more on that by Friday. 645 00:37:30,456 --> 00:37:31,596 So speaking of Facebook, 646 00:37:31,596 --> 00:37:33,196 a number of you found your way here 647 00:37:33,196 --> 00:37:35,926 or to other classes today via this tool of ours, 648 00:37:35,976 --> 00:37:39,196 the course's own shopping tool called Harvard courses 649 00:37:39,196 --> 00:37:40,866 that lives at that URL there. 650 00:37:41,136 --> 00:37:43,476 So this tool happens to be integrated with Facebook which, 651 00:37:43,476 --> 00:37:46,766 to be honest, is remarkably easy to do these days. 652 00:37:46,766 --> 00:37:49,266 And indeed, many of our own students do this toward term's 653 00:37:49,266 --> 00:37:51,806 end so that you no longer have to implement the notion 654 00:37:51,806 --> 00:37:53,686 of registering for accounts or remembering 655 00:37:53,686 --> 00:37:55,136 yet another username and password. 656 00:37:55,336 --> 00:37:58,066 You can integrate with Facebook and any other number 657 00:37:58,066 --> 00:38:00,786 of providers like Google and use their own usernames 658 00:38:00,786 --> 00:38:02,826 and passwords without you yourself seeing them. 659 00:38:02,956 --> 00:38:04,996 Well the upside of this too is that we too get 660 00:38:04,996 --> 00:38:07,256 to see network effects of shopping for courses 661 00:38:07,486 --> 00:38:10,176 and hopefully you found it to be a little more efficient 662 00:38:10,296 --> 00:38:11,666 than traditional approaches. 663 00:38:11,956 --> 00:38:14,656 Now with that said, let me personally apologize to any 664 00:38:14,656 --> 00:38:17,526 of you using the tool between 8 p.m. and midnight last night. 665 00:38:17,646 --> 00:38:20,946 I was sitting down preparing for a lecture and got an IM from one 666 00:38:20,946 --> 00:38:24,046 of our TF's, OMG Harvard Courses is down. 667 00:38:24,456 --> 00:38:26,726 That then delayed the preparation for this lecture 668 00:38:26,726 --> 00:38:29,536 by about four hours while we responded to the sudden spike 669 00:38:29,576 --> 00:38:31,266 of interest the night before shoppi- 670 00:38:31,456 --> 00:38:33,626 the night before classes began and actually figuring 671 00:38:33,626 --> 00:38:35,166 out what courses you want to shop. 672 00:38:35,166 --> 00:38:37,246 But we thought we would share some fun facts, 673 00:38:37,246 --> 00:38:39,516 at the moment this particular tool, if familiar with it, 674 00:38:39,516 --> 00:38:42,936 has some 2,500 Harvard undergraduates using it 675 00:38:42,936 --> 00:38:44,126 over the last week alone. 676 00:38:44,406 --> 00:38:46,406 The not- the total number of courses 677 00:38:46,406 --> 00:38:49,546 across your shopping lists collectively as of this morning 678 00:38:49,546 --> 00:38:51,706 at eight was about 25,000. 679 00:38:52,106 --> 00:38:54,376 Particularly fun was to see statistics 680 00:38:54,376 --> 00:38:55,966 like the average number of courses 681 00:38:55,966 --> 00:38:58,916 that your friends are shopping is actually only around seven 682 00:38:58,916 --> 00:39:00,486 but this is highly variant. 683 00:39:00,996 --> 00:39:02,716 This, again, is the average number 684 00:39:02,716 --> 00:39:05,986 of courses people are gonna try to check out this week and next. 685 00:39:06,336 --> 00:39:07,536 The maximum this year 686 00:39:07,536 --> 00:39:13,526 which broke last year's record is in fact, 125. 687 00:39:13,556 --> 00:39:15,876 Now you might think that's an outlier worthy 688 00:39:15,876 --> 00:39:19,676 of just dismissing, but rather, the runner-up was 123. 689 00:39:20,246 --> 00:39:25,426 So you are in good company if you are that 125. 690 00:39:25,646 --> 00:39:28,126 But not to dwell too long on Facebook but really to use it 691 00:39:28,126 --> 00:39:31,096 as a point of departure for just how applicable how things 692 00:39:31,096 --> 00:39:33,776 like computer science and programming more generally are, 693 00:39:34,256 --> 00:39:36,586 oh and I did have one more fun fact I should probably share. 694 00:39:36,936 --> 00:39:38,906 So turns out that if you look at the means 695 00:39:38,906 --> 00:39:40,956 by which people are using the imbedded calendar 696 00:39:41,016 --> 00:39:44,886 if using this tool, the most popular time to be busy is 697 00:39:44,886 --> 00:39:47,686 between 3 p.m. and 7 p.m. presumably because of sports 698 00:39:47,686 --> 00:39:48,916 and extracurriculars and the like, 699 00:39:49,226 --> 00:39:51,766 but I daresay we looked cl- a little closer at the data 700 00:39:51,766 --> 00:39:57,856 and the second most popular time to be busy is [laughter] note, 701 00:39:58,136 --> 00:40:01,196 no 9 or 8 a.m. classes it seems are of interest. 702 00:40:01,616 --> 00:40:06,106 So what are some of the opportunities here? 703 00:40:06,106 --> 00:40:08,946 Well besides doing things and building things that relate 704 00:40:08,946 --> 00:40:10,596 to the tools that you yourselves use, 705 00:40:10,866 --> 00:40:12,426 you can actually still make things 706 00:40:12,426 --> 00:40:15,286 that are just as, say technological. 707 00:40:15,286 --> 00:40:16,676 And as you'll see over the semester, 708 00:40:16,866 --> 00:40:20,196 with relatively little complexity, the margin of return 709 00:40:20,416 --> 00:40:22,746 of spending just a few weeks and the months in a course 710 00:40:22,746 --> 00:40:25,606 like this is that you learn how to build things that you take 711 00:40:25,606 --> 00:40:28,246 for granted as using these days and you take for granted 712 00:40:28,246 --> 00:40:31,186 as being accessible to you in your pocket, but it's remarkable 713 00:40:31,186 --> 00:40:33,766 as those images suggest just how much your predecessors 714 00:40:33,766 --> 00:40:36,346 accomplished over the course of just three months. 715 00:40:36,626 --> 00:40:39,356 One of the tools we built out has a course for students 716 00:40:39,356 --> 00:40:43,346 to use before the Harvard courses tool was this one, 717 00:40:43,346 --> 00:40:45,896 a much simpler tool that simply took what traditionally was 718 00:40:45,896 --> 00:40:49,946 in PDF and paper form alone, the Harvard shuttle schedule, 719 00:40:50,156 --> 00:40:53,216 and allows you to look up things well, I'm in Mem Hall, 720 00:40:53,216 --> 00:40:56,046 I'd like to go to the quad, so I might click there 721 00:40:56,046 --> 00:40:59,046 and click there and now you can see the next shuttles 722 00:40:59,046 --> 00:40:59,976 when they depart. 723 00:40:59,976 --> 00:41:02,636 Now this is becoming underwhelming these days 724 00:41:02,666 --> 00:41:04,046 but indeed this was a huge improvement 725 00:41:04,046 --> 00:41:05,556 when the alternative was just paper. 726 00:41:05,816 --> 00:41:08,096 But you can do cool things too, and as we look ahead 727 00:41:08,096 --> 00:41:10,106 in this course to the final project, 728 00:41:10,406 --> 00:41:12,466 know that you'll be able to make things like this. 729 00:41:12,466 --> 00:41:15,766 If you don't mind, just have to make a quick call. 730 00:41:16,606 --> 00:41:19,926 I've got my thing plugged into the overhead here. 731 00:41:20,516 --> 00:41:24,576 [ Pause ] 732 00:41:25,076 --> 00:41:26,576 >> This is CS50. 733 00:41:26,676 --> 00:41:28,796 For Shuttleboy, press one. 734 00:41:28,796 --> 00:41:30,546 To start over, press nine. 735 00:41:30,546 --> 00:41:30,613 . . 736 00:41:30,613 --> 00:41:32,556 >> So I've pressed one. 737 00:41:33,136 --> 00:41:34,816 >> What is your origin? 738 00:41:34,816 --> 00:41:36,936 For quad, press one. 739 00:41:37,056 --> 00:41:38,606 [Inaudible], press two. 740 00:41:38,606 --> 00:41:40,646 Boylston, press three. 741 00:41:40,646 --> 00:41:42,536 Lamont, press four. 742 00:41:42,536 --> 00:41:44,236 Mem Hall, press five. 743 00:41:44,496 --> 00:41:46,596 To start over, press zero. 744 00:41:46,596 --> 00:41:47,046 >> So I'll hit five. 745 00:41:47,046 --> 00:41:48,716 >> What is your destination? 746 00:41:49,086 --> 00:41:50,426 For quad, press one. 747 00:41:50,426 --> 00:41:50,706 [Inaudible] press two. 748 00:41:50,706 --> 00:41:51,886 To star- 749 00:41:51,886 --> 00:41:53,906 >> Let's go to the quad. 750 00:41:53,996 --> 00:41:57,886 >> The next shuttle leaves in seven minutes at 2 p.m. and then 751 00:41:57,886 --> 00:42:02,336 at 2:10 p.m., 2:20 p.m. and 2:30 p.m. 752 00:42:03,066 --> 00:42:05,236 >> So there's your exit strategy if you're getting bored already. 753 00:42:05,346 --> 00:42:08,416 Well that number was 617-BUG-CS50, 754 00:42:08,416 --> 00:42:10,636 and what's exciting about this is not so much that, 755 00:42:10,636 --> 00:42:13,596 because Frankly you can use SMS, you can use a plastic piece 756 00:42:13,596 --> 00:42:15,476 of card to look up numbers more quickly 757 00:42:15,476 --> 00:42:18,036 than the phone might recite, but that service alone 758 00:42:18,036 --> 00:42:21,006 that CS50 uses for that called CS50 voice is a tool 759 00:42:21,006 --> 00:42:23,526 that you yourselves can use at semester's end if you would 760 00:42:23,526 --> 00:42:26,726 like to build tools that actually make outbound calls, 761 00:42:26,726 --> 00:42:30,006 and or receive inbound calls and respond to some input. 762 00:42:30,006 --> 00:42:32,406 And that's all possible thanks to this notion 763 00:42:32,576 --> 00:42:34,136 of what's generally called an API, 764 00:42:34,426 --> 00:42:36,226 application programming interface. 765 00:42:36,396 --> 00:42:39,796 And these have been entering now even the co- the public lexicon. 766 00:42:39,796 --> 00:42:44,536 To use an API generally means to use data or to use functionality 767 00:42:44,736 --> 00:42:46,976 that someone else has implemented 768 00:42:47,136 --> 00:42:49,806 so that you yourself can stand on their shoulders 769 00:42:49,976 --> 00:42:52,276 and integrate really helpful, really cool, 770 00:42:52,406 --> 00:42:54,586 really useful functionality into your own program 771 00:42:54,796 --> 00:42:56,736 without reinventing that wheel yourself. 772 00:42:56,736 --> 00:42:58,746 You can liken it to the act of building a house. 773 00:42:59,026 --> 00:43:01,226 You could go out and chop down trees. 774 00:43:01,226 --> 00:43:03,986 You could go out and melt glass and make windows, 775 00:43:04,116 --> 00:43:05,166 but what do you do instead? 776 00:43:05,166 --> 00:43:06,186 You go to a store. 777 00:43:06,186 --> 00:43:07,026 You go to Home Depot. 778 00:43:07,026 --> 00:43:09,166 You buy planks of wood, you buy sheets of glass, 779 00:43:09,506 --> 00:43:12,406 and you integrate those pre-fabricated components 780 00:43:12,616 --> 00:43:15,146 into your own work so that your contribution 781 00:43:15,146 --> 00:43:18,616 to the whole process is the final output and you care less 782 00:43:18,616 --> 00:43:22,126 about the al- the underlying details of implementation. 783 00:43:22,576 --> 00:43:25,186 Well, let me go ahead in just a moment here and bring 784 00:43:25,186 --> 00:43:27,166 up our head teaching fellow Matt Chartier 785 00:43:27,386 --> 00:43:32,136 and also our other head Rob Bowden to say a quick hello. 786 00:43:32,666 --> 00:43:35,206 Rob you'll recall was the guy 787 00:43:35,436 --> 00:43:37,526 with the special loaf of bread earlier. 788 00:43:38,826 --> 00:43:41,356 You'll have to talk into my chest 789 00:43:41,586 --> 00:43:42,086 over here [laughter] [inaudible]. 790 00:43:45,686 --> 00:43:46,216 [Inaudible] okay. 791 00:43:46,216 --> 00:43:46,546 . . 792 00:43:46,546 --> 00:43:47,916 >> Less awkward. 793 00:43:47,916 --> 00:43:48,656 [laughter] 794 00:43:48,656 --> 00:43:52,156 >> Yes, much better. 795 00:43:52,606 --> 00:43:54,596 Hello everybody, my name is Matthew Chartier. 796 00:43:54,626 --> 00:43:56,156 I'm a senior in Kirkland House 797 00:43:56,416 --> 00:43:58,406 and a concentrator in computer science. 798 00:43:58,756 --> 00:44:01,556 I've also TF'd CS50 for the last two years and am returning 799 00:44:01,556 --> 00:44:04,076 for this year, this time in the role of head TF. 800 00:44:04,476 --> 00:44:06,156 I'm very excited to be back with the course 801 00:44:06,156 --> 00:44:08,826 in this capacity this year to help David organize everything 802 00:44:09,126 --> 00:44:11,496 and to make a wonderful experience for all of you just 803 00:44:11,496 --> 00:44:13,346 like the experience I was treated 804 00:44:13,346 --> 00:44:14,566 to freshman year coming in. 805 00:44:15,106 --> 00:44:17,426 My role as head TF is essentially going to be a point 806 00:44:17,426 --> 00:44:20,046 of contact, both between David and the rest 807 00:44:20,046 --> 00:44:23,166 of our teaching staff but also between the TF's 808 00:44:23,266 --> 00:44:26,346 as a organization, as a staff, and all of you. 809 00:44:26,656 --> 00:44:28,036 So if there are any point during the course 810 00:44:28,036 --> 00:44:30,386 where you have any issues that you you don't really know how 811 00:44:30,386 --> 00:44:32,426 to reach out to, I'm the person you want 812 00:44:32,426 --> 00:44:33,256 to reach out to for that. 813 00:44:33,256 --> 00:44:35,736 Contact me at heads@cs50.net. 814 00:44:35,736 --> 00:44:37,446 You can also re- reach either David 815 00:44:37,446 --> 00:44:38,466 or Rob here at that address. 816 00:44:38,996 --> 00:44:40,696 Just to talk a little about the course 817 00:44:40,766 --> 00:44:43,016 because I'm waxing nostalgic a bit now looking 818 00:44:43,016 --> 00:44:45,866 out over our first lecture for I suppose the last time 819 00:44:46,176 --> 00:44:48,126 and remembering when I came in freshman year 820 00:44:48,126 --> 00:44:49,976 and took CS50 for the first time. 821 00:44:50,336 --> 00:44:52,266 I came in without any prior experience. 822 00:44:52,266 --> 00:44:53,586 I had no formal training in CS. 823 00:44:53,876 --> 00:44:55,176 I'd maybe mucked around a little 824 00:44:55,176 --> 00:44:57,076 in a couple languages just 'cause I was curious 825 00:44:57,136 --> 00:44:58,496 but didn't really get anywhere with it. 826 00:44:58,586 --> 00:45:02,176 And coming into CS50 at the time thinking about concentrating 827 00:45:02,176 --> 00:45:03,716 in something maybe like physics or government, 828 00:45:04,136 --> 00:45:06,286 I found a whole new world opened up to me. 829 00:45:06,396 --> 00:45:08,766 I was exposed to exactly what computers could do 830 00:45:08,766 --> 00:45:11,656 and how powerful these simple programming languages, 831 00:45:11,656 --> 00:45:13,776 just typing statements in text files 832 00:45:13,776 --> 00:45:15,396 and making them do something could really be, 833 00:45:15,616 --> 00:45:18,366 and how exciting it could be to work in that sort of environment 834 00:45:18,366 --> 00:45:19,476 and to really make things happen 835 00:45:19,476 --> 00:45:21,776 with these machines we do every, we use every day. 836 00:45:22,176 --> 00:45:23,606 I also found something else. 837 00:45:24,196 --> 00:45:27,006 This isn't just an intro course, it's sort of an experience 838 00:45:27,006 --> 00:45:28,896 and an institution, and if you don't think that yet, 839 00:45:29,216 --> 00:45:32,296 I assure you that by semester's end you may have a new 840 00:45:32,296 --> 00:45:34,926 perspective for what exactly happens here. 841 00:45:34,926 --> 00:45:37,206 CS50 is one of those rare courses at Harvard College 842 00:45:37,206 --> 00:45:42,176 that is challenging, populace, elaborate, and fun enough 843 00:45:42,686 --> 00:45:43,836 to really create a sense 844 00:45:43,836 --> 00:45:46,266 of community amongst the entire course 845 00:45:46,366 --> 00:45:48,406 and to create something that's not only useful 846 00:45:48,406 --> 00:45:49,656 for you, but memorable. 847 00:45:50,166 --> 00:45:52,366 It's certainly been memorable for me and I can't wait 848 00:45:52,366 --> 00:45:54,106 for one more ride with this great course, 849 00:45:54,106 --> 00:45:55,596 and I hope that you have the same experience. 850 00:45:55,906 --> 00:45:56,926 Thanks a lot and I'll pass the mic off to Rob. 851 00:45:57,516 --> 00:46:05,276 [ Applause ] 852 00:46:05,776 --> 00:46:08,616 >> I'm Rob from Kirkland House. 853 00:46:08,876 --> 00:46:12,506 I'm a junior and this is my second year TFing CS50. 854 00:46:12,506 --> 00:46:16,316 You know we've really tried to make this course 855 00:46:16,466 --> 00:46:19,346 so that you don't really feel like you're doing work, 856 00:46:19,536 --> 00:46:20,776 you feel like you're having fun. 857 00:46:21,536 --> 00:46:23,246 You really get this sense of accomplishment 858 00:46:23,246 --> 00:46:24,366 when you finish a problem set. 859 00:46:24,366 --> 00:46:26,136 How often do you take a course 860 00:46:26,136 --> 00:46:29,086 where when you finish a problem set you can show it 861 00:46:29,086 --> 00:46:31,296 to your roommate and they can play a game, 862 00:46:31,376 --> 00:46:33,356 or you can give a URL to a friend back home 863 00:46:33,416 --> 00:46:34,486 and they can see what you've done. 864 00:46:35,086 --> 00:46:38,876 So, like Matt, like Matt said, this course does have a culture 865 00:46:38,876 --> 00:46:41,116 and I just want to encourage you to really get 866 00:46:41,116 --> 00:46:42,666 into it 'cause it's so much more fun that way. 867 00:46:43,256 --> 00:46:46,736 And especially for the largest chunk out, of you out there 868 00:46:46,826 --> 00:46:49,386 who are less comfortable, there's no reason 869 00:46:49,386 --> 00:46:51,006 to feel alone even if you get frustrated. 870 00:46:51,006 --> 00:46:53,376 We do have this staff of 87 people. 871 00:46:53,746 --> 00:46:57,996 We're all here to help you make this class the best it can be. 872 00:46:58,366 --> 00:47:00,066 So I hope you have a fun semester. 873 00:47:00,896 --> 00:47:02,286 >> Believe it or not-- thank you both-- 874 00:47:02,696 --> 00:47:04,916 believe it or not I started out in life as a, thank you. 875 00:47:05,516 --> 00:47:12,216 [ Applause ] 876 00:47:12,716 --> 00:47:13,866 So for what it's worth, 877 00:47:13,866 --> 00:47:16,396 testament to just how fun this particular world can be, 878 00:47:16,446 --> 00:47:20,356 I started out life here as an undergraduate in 1995 879 00:47:20,356 --> 00:47:23,146 and was heads down into the government department thinking 880 00:47:23,146 --> 00:47:25,716 I'd come in ha- having liked things like history 881 00:47:25,716 --> 00:47:26,656 and [inaudible] in high school and such 882 00:47:26,656 --> 00:47:28,706 and so I didn't really think 883 00:47:28,706 --> 00:47:31,356 about exploring a bit beyond my own comfort zone. 884 00:47:31,356 --> 00:47:34,536 And indeed, CS50 then and to some extent still now, 885 00:47:34,536 --> 00:47:37,036 as well as computer science more generally, has this sort 886 00:47:37,036 --> 00:47:40,726 of daunting reputation that it's not so much for the uninitiated, 887 00:47:40,886 --> 00:47:42,506 but rather for those who've been doing it 888 00:47:42,506 --> 00:47:44,026 since the beginning of their life. 889 00:47:44,026 --> 00:47:45,366 But that's indeed not the case. 890 00:47:45,366 --> 00:47:49,296 That 77% statistic has been quite consistent 891 00:47:49,486 --> 00:47:51,766 and so it wasn't myself until sophomore year 892 00:47:51,896 --> 00:47:54,966 that I finally got up the nerve to actually take the course 893 00:47:55,246 --> 00:47:56,706 but I took it pass/fail. 894 00:47:56,706 --> 00:47:59,556 I enrolled because I thought I'm on this track toward government 895 00:47:59,556 --> 00:48:01,376 but I'm gonna finally get up the nerve 896 00:48:01,376 --> 00:48:02,836 to actually dabble in this course. 897 00:48:02,836 --> 00:48:04,996 And long story short, just the end 898 00:48:04,996 --> 00:48:07,476 of that semester did I declare my concentration as CS, 899 00:48:07,476 --> 00:48:10,176 that I end up, my god, doing this here today 900 00:48:10,176 --> 00:48:11,746 for the same course I once took. 901 00:48:12,036 --> 00:48:14,676 But that's not, to be clear, the goal in this course. 902 00:48:14,676 --> 00:48:17,826 Most of the students, about oh just over half of the students 903 00:48:17,826 --> 00:48:20,416 that take 50, it is for them a terminal course 904 00:48:20,416 --> 00:48:22,336 in that they don't go on to take other courses 905 00:48:22,336 --> 00:48:25,116 in computer science, but they parlay those skills 906 00:48:25,116 --> 00:48:26,306 and the savvy they derive. 907 00:48:26,306 --> 00:48:28,936 And of course like this, back into the social science, 908 00:48:28,936 --> 00:48:30,976 the humanities, the physical sciences 909 00:48:30,976 --> 00:48:34,146 where they have large data sets or large volumes of information 910 00:48:34,146 --> 00:48:35,976 that they need to analyze or process. 911 00:48:35,976 --> 00:48:39,096 Or even in the more familiar world of running student groups, 912 00:48:39,096 --> 00:48:40,046 and you want to be able to send 913 00:48:40,046 --> 00:48:41,786 out a mass mailing to 1,000 people. 914 00:48:41,786 --> 00:48:44,856 My god, doing it manually isn't so fun using a tool 915 00:48:44,856 --> 00:48:48,166 like Microsoft Word and Excel so you can do better than that 916 00:48:48,166 --> 00:48:50,196 if you do it yourself and you have the savvy 917 00:48:50,196 --> 00:48:51,226 with which to do so. 918 00:48:51,226 --> 00:48:53,586 And that's ultimately too, some of the take-aways 919 00:48:53,586 --> 00:48:54,576 of a course like this. 920 00:48:54,926 --> 00:48:57,826 So a hello here to CS50 as to what to expect. 921 00:48:58,066 --> 00:49:00,796 So in terms of expectations, they're fairly straightforward-- 922 00:49:00,796 --> 00:49:03,416 attending lectures and sections, submitting nine problem sets, 923 00:49:03,706 --> 00:49:05,856 taking two quizzes, and a final project, 924 00:49:05,946 --> 00:49:09,376 the images of which are conveyed by the fair and Hackathon alike. 925 00:49:09,706 --> 00:49:13,196 In terms of grade, this is one that's particularly close 926 00:49:13,196 --> 00:49:16,346 to my heart; I am not a fan in general of grades. 927 00:49:16,346 --> 00:49:18,706 I think they tend to do more harm than good. 928 00:49:18,956 --> 00:49:21,956 There is value in that they certainly help motivate, 929 00:49:22,206 --> 00:49:25,336 but that of course can be to a crippling degree. 930 00:49:25,446 --> 00:49:27,246 And so we've tried in recent years 931 00:49:27,246 --> 00:49:30,496 to send the message quite ardently to do what I myself did 932 00:49:30,736 --> 00:49:33,786 to put that toe in the water and to explore what for many 933 00:49:33,786 --> 00:49:36,416 of you are indeed unfamiliar waters by taking it, 934 00:49:36,416 --> 00:49:38,056 if you so choose, pass/fail. 935 00:49:38,056 --> 00:49:39,766 You can do it letter grade or pass/fail. 936 00:49:40,016 --> 00:49:43,256 We go so far as to provide you with these pink change 937 00:49:43,256 --> 00:49:45,916 of grading status pass/fail forms at either end 938 00:49:45,916 --> 00:49:48,466 of the lecture hall and I'm happy to sign study cards 939 00:49:48,466 --> 00:49:49,686 for which you might like to do that. 940 00:49:49,936 --> 00:49:52,586 Do ultimately consult the syllabus for some fine print 941 00:49:52,586 --> 00:49:55,096 as to what courses can and cannot count 942 00:49:55,096 --> 00:49:57,866 for concentration credit if you do take it pass/fail, 943 00:49:58,126 --> 00:50:00,666 but undoubtedly if on the fence or a little bit nervous 944 00:50:00,666 --> 00:50:03,056 about putting that toe in the water, taking a course 945 00:50:03,056 --> 00:50:05,746 as I once did, pass/fail, and then having the opportunity 946 00:50:05,966 --> 00:50:08,006 to change your mind up 'til the fifth Monday 947 00:50:08,006 --> 00:50:11,136 of the term is a wonderful way of kind of getting past 948 00:50:11,226 --> 00:50:15,126 that initial fear of failure, whether failure is an E or a B, 949 00:50:15,406 --> 00:50:18,946 but to actually give you that comfort to try something new. 950 00:50:19,236 --> 00:50:21,316 So toward that end of sending the message, 951 00:50:21,316 --> 00:50:24,966 we actually have a tradition in the course of having cake 952 00:50:24,966 --> 00:50:26,076 in just a few minutes. 953 00:50:26,376 --> 00:50:29,246 We decided we'd print and emblazon on each cases, 954 00:50:29,556 --> 00:50:32,066 on each cakes the message we'd like you to take. 955 00:50:32,336 --> 00:50:34,526 We have one in chocolate, one in vanilla, 956 00:50:34,706 --> 00:50:36,316 one with some vanilla and chocolate. 957 00:50:38,266 --> 00:50:39,556 [laughter] Maybe don't eat the fourth cake, 958 00:50:40,006 --> 00:50:43,076 but that one too will await you before long. 959 00:50:43,076 --> 00:50:44,936 But what is the course ultimately about? 960 00:50:44,936 --> 00:50:47,816 It's mostly about the hands-on aspects in lectures 961 00:50:47,816 --> 00:50:51,066 where we present concepts and ideas and try as best I can, 962 00:50:51,336 --> 00:50:52,466 to get you excited and in- 963 00:50:52,466 --> 00:50:54,406 genuinely interested in some subject. 964 00:50:54,626 --> 00:50:56,806 But undoubtedly the work and the experience 965 00:50:56,806 --> 00:51:00,926 in this course derives from your working on the problem set. 966 00:51:01,186 --> 00:51:03,676 But know that, so that's the appeal 967 00:51:03,676 --> 00:51:05,966 to both those less comfortable and more comfortable alike, 968 00:51:06,216 --> 00:51:09,256 most of the problem sets we issue in two different editions 969 00:51:09,346 --> 00:51:12,586 so to speak; a standard edition that's targeted at 90% 970 00:51:12,586 --> 00:51:13,706 of the students in the course, 971 00:51:13,706 --> 00:51:16,026 and then typically a hacker edition 972 00:51:16,216 --> 00:51:18,536 which ultimately covers the same sorts of material 973 00:51:18,536 --> 00:51:21,206 but from a more sophisticated, a more challenging perspective. 974 00:51:21,206 --> 00:51:25,056 Asks you to do a bit more in terms of sophistication 975 00:51:25,056 --> 00:51:27,226 because those hacker editions assume more. 976 00:51:27,396 --> 00:51:30,526 So realize too that though I might focus verbally 977 00:51:30,526 --> 00:51:34,126 on this 77%, there is a non-trivial number of 12% 978 00:51:34,126 --> 00:51:35,896 of the class that indeed have been programming 979 00:51:35,946 --> 00:51:38,646 since they were, say, six years old, or just took one course 980 00:51:38,646 --> 00:51:40,746 in AP computer science, or didn't even do that, 981 00:51:41,086 --> 00:51:43,656 but just kind of feel that they're ready for something new. 982 00:51:43,656 --> 00:51:45,806 So realize that there are these disparate tracks 983 00:51:46,026 --> 00:51:49,016 within the course that appeal ideally to both. 984 00:51:49,086 --> 00:51:51,536 Moreover does the course provide some number of late days 985 00:51:51,536 --> 00:51:53,036 that you can spend during the semester. 986 00:51:53,036 --> 00:51:56,236 Inevitably, life happens and you need to, for instance, 987 00:51:56,286 --> 00:51:58,756 deal with some midterm or some other classes deadline, 988 00:51:58,966 --> 00:52:01,386 so realize you'll have some flexibility whereby you can 989 00:52:01,456 --> 00:52:03,796 spend late days on certain problem sets. 990 00:52:03,796 --> 00:52:05,876 And moreover, there's also the circumstances 991 00:52:05,876 --> 00:52:07,466 where life just really gets in the way 992 00:52:07,466 --> 00:52:09,386 and just a week doesn't go so well 993 00:52:09,386 --> 00:52:11,256 and so ultimately toward the end of the semester, 994 00:52:11,496 --> 00:52:14,006 at the end of the semester will we drop your lowest score. 995 00:52:14,006 --> 00:52:17,186 And again refer to the syllabus for any fine details. 996 00:52:17,436 --> 00:52:18,316 And where can you go? 997 00:52:18,636 --> 00:52:21,566 Well in this black box here CS50, and what's been exciting 998 00:52:21,566 --> 00:52:25,666 for me having been here years ago studying the same subject is 999 00:52:25,666 --> 00:52:28,586 that this chart, this flow chart whereby every arrow 1000 00:52:28,586 --> 00:52:32,916 from CS50 means what course you could take right after CS50 1001 00:52:32,916 --> 00:52:35,966 for which 50 is the only prerequisite, you can go off 1002 00:52:35,966 --> 00:52:39,416 in directions of more programming or theory or math 1003 00:52:39,666 --> 00:52:43,516 or graphics or networking or hardware or, with some bias, 1004 00:52:43,656 --> 00:52:44,996 iPhone programming this spring-- 1005 00:52:44,996 --> 00:52:47,736 a new course that I myself will be teaching. 1006 00:52:48,016 --> 00:52:51,596 And so the only prereq for that too will be 50. 1007 00:52:51,596 --> 00:52:55,276 And so this is to, testament to just how much you can do 1008 00:52:55,576 --> 00:52:58,386 and that the marginal return of some knowledge and some savvy 1009 00:52:58,386 --> 00:53:00,786 in this world of computer science is indeed 1010 00:53:00,786 --> 00:53:01,606 quite empowering. 1011 00:53:01,816 --> 00:53:03,906 Now for those of you who might have shopped the course last 1012 00:53:03,906 --> 00:53:06,746 year or heard from some friends what's in the course, 1013 00:53:07,006 --> 00:53:10,146 we like to introduce every year as many new and exciting things 1014 00:53:10,146 --> 00:53:12,916 as possible and so for the first time this year will we be 1015 00:53:12,916 --> 00:53:16,566 transitioning away from what historically was a very server 1016 00:53:16,566 --> 00:53:18,476 side centralized architecture 1017 00:53:18,476 --> 00:53:21,056 where all CS50 students would run a program on their Mac 1018 00:53:21,176 --> 00:53:24,316 or PC, it doesn't matter what OS you use, you would connect 1019 00:53:24,316 --> 00:53:27,046 to some central server where software would await you there. 1020 00:53:27,406 --> 00:53:29,056 Well more fun these days now 1021 00:53:29,056 --> 00:53:33,126 that most everyone has particularly modern computers is 1022 00:53:33,126 --> 00:53:35,056 the ability for these computers, believe it or not, 1023 00:53:35,246 --> 00:53:38,646 to run not just Mac OS or Windows as you currently are, 1024 00:53:38,876 --> 00:53:41,346 but to run yet another operating system inside 1025 00:53:41,346 --> 00:53:43,506 of a window on your own computer. 1026 00:53:43,506 --> 00:53:45,266 And not this old school approach of like having 1027 00:53:45,266 --> 00:53:47,926 to reboot your computer and then it changes operating systems. 1028 00:53:48,196 --> 00:53:49,786 Double-click an icon and walla, 1029 00:53:49,976 --> 00:53:51,786 you're running an operating system called Linux 1030 00:53:51,966 --> 00:53:53,306 which is what we'll happen to use. 1031 00:53:53,546 --> 00:53:56,466 But it will look, the CS50 appliance in a window, 1032 00:53:56,466 --> 00:53:57,846 like just some other desktop. 1033 00:53:57,846 --> 00:54:01,096 You'll have a little CS50 menu instead of a start menu 1034 00:54:01,096 --> 00:54:02,366 in the bottom left-hand corner. 1035 00:54:02,366 --> 00:54:03,426 You'll be able to navigate 1036 00:54:03,426 --> 00:54:05,816 through the very user friendly type tools 1037 00:54:05,816 --> 00:54:06,786 that we'll introduce you to, 1038 00:54:06,786 --> 00:54:09,286 all of which can be found in the real world. 1039 00:54:09,286 --> 00:54:11,946 So nothing here is just simulated for the purposes 1040 00:54:12,226 --> 00:54:13,546 of academics in the course. 1041 00:54:13,546 --> 00:54:15,346 You will be equipped throughout the semester 1042 00:54:15,576 --> 00:54:18,956 with real-world sort of de facto standard tools that you'll use 1043 00:54:18,956 --> 00:54:21,686 in your own fields, whether computer science, humanities, 1044 00:54:21,686 --> 00:54:24,126 natural sciences, anytime you need a computer 1045 00:54:24,126 --> 00:54:25,276 to solve some problem. 1046 00:54:25,496 --> 00:54:27,446 We'll also, for those more familiar, 1047 00:54:27,446 --> 00:54:29,376 perhaps for those more comfortable, introduce you 1048 00:54:29,376 --> 00:54:31,426 to things like terminal windows and SSH 1049 00:54:31,426 --> 00:54:35,116 and we'll introduce you also to graphical editors with which 1050 00:54:35,116 --> 00:54:36,496 to write code and the odds are, 1051 00:54:36,766 --> 00:54:39,116 this looks completely cryptic right now, and indeed, 1052 00:54:39,206 --> 00:54:40,956 if you're among that 77%, 1053 00:54:41,206 --> 00:54:44,296 you might not have ever seen a program's source code, 1054 00:54:44,496 --> 00:54:45,656 the thing that the human writes 1055 00:54:45,686 --> 00:54:46,936 to make the computer do something. 1056 00:54:47,216 --> 00:54:49,956 This is one of the simplest programs a human might write 1057 00:54:50,186 --> 00:54:52,086 to just make the computer do something stupid, 1058 00:54:52,286 --> 00:54:54,026 like say hello world on the screen. 1059 00:54:54,256 --> 00:54:56,916 But this year too, for the first time, will we always introduce 1060 00:54:56,916 --> 00:54:58,726 for those familiar, what's called an IDE, 1061 00:54:58,726 --> 00:55:00,686 an integrated development environment, 1062 00:55:00,886 --> 00:55:02,776 so that if at term's end you actually do want 1063 00:55:02,776 --> 00:55:05,266 to be among those who goes off and interns at Microsoft 1064 00:55:05,266 --> 00:55:08,726 or Google or Facebook or in Wall Street, 1065 00:55:09,046 --> 00:55:11,926 to actually use some coding skills to apply them 1066 00:55:11,926 --> 00:55:14,536 to some real-world problems, know that this term more 1067 00:55:14,536 --> 00:55:16,786 so than ever, you will be very well equipped 1068 00:55:16,916 --> 00:55:17,776 with what's out there. 1069 00:55:18,366 --> 00:55:20,616 Another aspect that's changing this year 1070 00:55:20,616 --> 00:55:22,636 for the first time is office hours. 1071 00:55:22,636 --> 00:55:26,056 For 20 some odd years, office hours have gotten overwhelmed, 1072 00:55:26,056 --> 00:55:27,746 and this is back when the course was smaller 1073 00:55:27,746 --> 00:55:29,646 and when you would sign up for office hours, 1074 00:55:29,646 --> 00:55:31,566 one on one assistance with the TF's and CA's 1075 00:55:31,816 --> 00:55:33,716 by writing your name on a piece of paper that's tacked 1076 00:55:34,076 --> 00:55:35,466 to the wall in the science center. 1077 00:55:35,776 --> 00:55:38,556 Well, what we're going to do entirely is reboot these. 1078 00:55:38,556 --> 00:55:41,056 So if you've heard the reputation which was quite true 1079 00:55:41,056 --> 00:55:43,716 for some years, that office hours are slow and you end 1080 00:55:43,716 --> 00:55:46,076 up waiting some amount of time, we're hoping, 1081 00:55:46,146 --> 00:55:48,616 being computer scientists, that we can now fix this. 1082 00:55:48,616 --> 00:55:52,296 So one, we are going to exit what was once a very magical, 1083 00:55:52,296 --> 00:55:55,336 wonderful place to spend an evening, but move ourselves 1084 00:55:55,336 --> 00:55:56,916 from the basement of the science center 1085 00:55:56,916 --> 00:56:00,366 and it's fluorescent lights to four ho- to dining halls 1086 00:56:00,366 --> 00:56:03,686 on campus to coincide with brain break whereby this year's office 1087 00:56:03,686 --> 00:56:05,596 hours will be Mondays and Tuesdays and Wednesdays 1088 00:56:05,596 --> 00:56:07,206 and Thursdays, 9 p.m. 1089 00:56:07,266 --> 00:56:10,496 to midnight whereby we'll have not just half a dozen or so TF's 1090 00:56:10,496 --> 00:56:14,206 and CA's on duty at once, but 10 and 20 at a time. 1091 00:56:14,206 --> 00:56:16,836 And we've coordinated with the masters of Pfoho and Lowell 1092 00:56:16,836 --> 00:56:19,696 and Leverett so supplement brain break so that there's plenty 1093 00:56:19,696 --> 00:56:21,946 of food for you and the residents. 1094 00:56:22,036 --> 00:56:23,406 But, we can do better than that. 1095 00:56:23,966 --> 00:56:25,996 What we will also have done, thanks to one 1096 00:56:25,996 --> 00:56:28,266 of our TF's Tommy MacWilliam, over the summer, 1097 00:56:28,756 --> 00:56:31,406 is we've implemented our own version 1098 00:56:31,516 --> 00:56:34,066 of say the Apple Genius Bar tool. 1099 00:56:34,186 --> 00:56:36,206 For those of you who might own a Mac or have been 1100 00:56:36,206 --> 00:56:39,636 to an Apple store, you know that there's this bar of geniuses 1101 00:56:39,636 --> 00:56:41,336 that help you with your computer problems. 1102 00:56:41,596 --> 00:56:43,796 And so rather now than have students working 1103 00:56:43,796 --> 00:56:46,816 at these older work, computer terminals in the basement 1104 00:56:46,816 --> 00:56:49,586 of the science center, we'll all gather more socially if you 1105 00:56:49,586 --> 00:56:51,756 so choose to partake, with your laptops 1106 00:56:51,756 --> 00:56:53,706 in the dining halls working alongside your friends 1107 00:56:53,706 --> 00:56:55,986 who are not even taking computer science who are just there 1108 00:56:55,986 --> 00:57:00,066 for some food or to write some p set, but to raise your hand 1109 00:57:00,066 --> 00:57:01,946 when you need help on problem sets this year, 1110 00:57:02,196 --> 00:57:04,136 you'll instead not scribble your name on the board 1111 00:57:04,136 --> 00:57:06,306 but instead you'll log in to cs50.net. 1112 00:57:06,556 --> 00:57:08,696 You'll raise your hand by telling us what are you working 1113 00:57:08,696 --> 00:57:11,366 on and what's your question, and then you like Harry, Ron, 1114 00:57:11,366 --> 00:57:14,096 Hermione, Gilderoy and others here will appear 1115 00:57:14,356 --> 00:57:18,106 on the staff screen so that we know who now has questions, 1116 00:57:18,386 --> 00:57:21,146 and they're ranked in order of who raised their hand first, 1117 00:57:21,386 --> 00:57:22,846 but also they're color-coded. 1118 00:57:23,116 --> 00:57:26,296 And you'll find that this tool allows you to communicate 1119 00:57:26,296 --> 00:57:29,306 to others in the D hall what you're in fact working on. 1120 00:57:29,306 --> 00:57:32,666 And you'll see per the course's syllabus on academic honesty 1121 00:57:32,666 --> 00:57:35,336 which we'll discuss before long in weeks to come, 1122 00:57:35,606 --> 00:57:37,496 that you are allowed to collaborate 1123 00:57:37,496 --> 00:57:40,506 and to discuss problem sets with friends so long as the line 1124 00:57:40,506 --> 00:57:42,296 of here's my code, why don't you take a look 1125 00:57:42,296 --> 00:57:43,606 at it, is not crossed. 1126 00:57:43,606 --> 00:57:46,336 So more on that in the time to come but the hope here too is 1127 00:57:46,336 --> 00:57:48,796 to make the experience of taking computer science 1128 00:57:48,796 --> 00:57:50,806 and solving problems evermore sociable 1129 00:57:51,006 --> 00:57:53,166 so that you actually do learn from each other 1130 00:57:53,426 --> 00:57:54,916 and benefit in that way. 1131 00:57:54,916 --> 00:57:58,016 Now meanwhile, much like the Apple Genius Bar has a greeter, 1132 00:57:58,246 --> 00:57:59,016 so will we. 1133 00:57:59,016 --> 00:58:01,216 We, we know a little something about programming, 1134 00:58:01,216 --> 00:58:04,516 or at least Tommy does, and so we've bought ourselves an iPad 1135 00:58:04,516 --> 00:58:07,496 and so what you'll see at CS50 office hours this year is a 1136 00:58:07,496 --> 00:58:10,036 greeter, so to speak, who isn't gonna awkwardly say hello 1137 00:58:10,036 --> 00:58:11,506 to you upon entry at office hours, 1138 00:58:11,736 --> 00:58:14,186 but rather when you raise your hand virtually, 1139 00:58:14,406 --> 00:58:16,796 he or she on the CS50 staff will see that, oh, 1140 00:58:17,106 --> 00:58:18,696 Alice has a question and then Bob. 1141 00:58:18,876 --> 00:58:21,856 On the right-hand side of this same iPad app will the staff 1142 00:58:21,856 --> 00:58:24,166 member see that Professor McGonagall and Sprout 1143 00:58:24,166 --> 00:58:26,586 and Flitwick and Snape are currently on duty-- 1144 00:58:26,586 --> 00:58:29,486 the TF's and CA's who are there waiting to help you one on one. 1145 00:58:29,756 --> 00:58:32,386 We will tap Alice on the left and Snape on the right. 1146 00:58:32,756 --> 00:58:35,966 Alice's computer screen, her own laptop will flash a message up, 1147 00:58:36,206 --> 00:58:38,466 will play a sound, and will communicate to Alice 1148 00:58:38,466 --> 00:58:40,536 that it's her time with Professor Snape. 1149 00:58:40,616 --> 00:58:43,646 So we thought we would completely overhaul office hours 1150 00:58:43,646 --> 00:58:44,946 toward an end of providing you 1151 00:58:44,946 --> 00:58:47,416 with the most support structure possible. 1152 00:58:47,816 --> 00:58:48,986 What about lectures? 1153 00:58:49,086 --> 00:58:51,766 Here we are today simply painting the trajectory 1154 00:58:51,766 --> 00:58:55,626 for the semester but joining us as well, albeit it virtually 1155 00:58:55,626 --> 00:58:56,756 with these cameras in the room, 1156 00:58:56,976 --> 00:58:58,876 are not only the Harvard extension students 1157 00:58:58,876 --> 00:59:00,686 who have been enrolled in the course for some time, 1158 00:59:00,686 --> 00:59:03,536 but for the first time this year will MBA students 1159 00:59:03,536 --> 00:59:05,526 at HBS be allowed to take CS50 1160 00:59:05,526 --> 00:59:07,056 as an [inaudible] course for credit. 1161 00:59:07,056 --> 00:59:09,216 So literally at this moment, we have, 1162 00:59:09,416 --> 00:59:12,796 well in 10 seconds the HBS students will see me waving my 1163 00:59:12,796 --> 00:59:14,706 hand because they're seated in a lecture hall 1164 00:59:14,706 --> 00:59:18,886 across the river taking now CS50 albeit from afar. 1165 00:59:18,886 --> 00:59:21,136 Similarly do we have students from Belmont High, 1166 00:59:21,136 --> 00:59:23,966 Watertown High, taking the course for the first time 1167 00:59:24,186 --> 00:59:26,226 so that they too can dive into a world 1168 00:59:26,226 --> 00:59:28,386 that their own schools might not necessarily offer 1169 00:59:28,656 --> 00:59:29,636 in the same form. 1170 00:59:29,636 --> 00:59:31,346 And similarly is this course available 1171 00:59:31,416 --> 00:59:33,256 as what's called open courseware 1172 00:59:33,426 --> 00:59:36,106 so that the entire world can indeed tune in, 1173 00:59:36,296 --> 00:59:39,516 use the CS50 appliance and learn at their own pace. 1174 00:59:39,786 --> 00:59:42,166 So what's in store for the next several weeks? 1175 00:59:42,566 --> 00:59:45,086 Well this week in particular we will introduce some 1176 00:59:45,086 --> 00:59:47,086 of the basics, the ideas of programming 1177 00:59:47,086 --> 00:59:48,416 and computer science itself. 1178 00:59:48,636 --> 00:59:49,746 We'll focus in particular 1179 00:59:49,746 --> 00:59:51,556 on a graphical language called scratch, 1180 00:59:52,156 --> 00:59:53,666 but more on that to come. 1181 00:59:53,956 --> 00:59:55,646 Next week will we dive into a language 1182 00:59:55,646 --> 00:59:58,726 which called C. It's the C language that I implemented 1183 00:59:58,726 --> 01:00:00,976 that silly little hello world program just a moment ago. 1184 01:00:01,056 --> 01:00:04,016 And even though it really might look like Greek to you now, 1185 01:00:04,256 --> 01:00:05,606 you very quickly-- trust me-- 1186 01:00:05,606 --> 01:00:07,226 will acclimate to this environment. 1187 01:00:07,226 --> 01:00:09,246 And those common mistakes you'll make initially, 1188 01:00:09,396 --> 01:00:10,866 not quite typing the right commands, 1189 01:00:11,156 --> 01:00:13,466 will very quickly become old hat. 1190 01:00:13,466 --> 01:00:17,896 In week two will we transition to more domain specific topics, 1191 01:00:17,896 --> 01:00:19,296 not so much low level details 1192 01:00:19,296 --> 01:00:20,906 but how do we now use these skills 1193 01:00:20,906 --> 01:00:22,276 to solve real-world problems? 1194 01:00:22,466 --> 01:00:26,036 We'll talk about cryptography and encryption, the arn- the art 1195 01:00:26,036 --> 01:00:28,696 of scrambling information so that things like your name 1196 01:00:28,696 --> 01:00:30,026 and your social security number 1197 01:00:30,026 --> 01:00:32,716 and credit cards are all entirely secure. 1198 01:00:33,006 --> 01:00:35,476 The week after we'll talk more about algorithms 1199 01:00:35,476 --> 01:00:37,056 and these things called data structures. 1200 01:00:37,256 --> 01:00:39,176 I actually intentionally picked an algorithm 1201 01:00:39,176 --> 01:00:41,796 for counting students that doesn't require a huge amount 1202 01:00:41,796 --> 01:00:44,236 of sophistication, just requires a whole lot of brains, 1203 01:00:44,236 --> 01:00:46,146 a whole lot of CPU's to execute it once, 1204 01:00:46,396 --> 01:00:47,656 but it was still pretty simple. 1205 01:00:47,656 --> 01:00:50,756 But when you get to the point of implementing Facebook or Google 1206 01:00:50,756 --> 01:00:53,396 or any tool that's popular on your computer, 1207 01:00:53,686 --> 01:00:57,586 you need typically to muster more intelligent resources 1208 01:00:57,586 --> 01:01:01,716 for it and we'll introduce you with those particular tool sets. 1209 01:01:02,046 --> 01:01:04,416 In week four will we continue this conversation and talk 1210 01:01:04,416 --> 01:01:06,246 about things like memory management 1211 01:01:06,246 --> 01:01:09,086 and how computers actually do what we command them to do. 1212 01:01:09,226 --> 01:01:11,876 We'll talk in week five about another domain specific area: 1213 01:01:12,016 --> 01:01:14,446 forensics, the art of recovering 1214 01:01:14,496 --> 01:01:17,776 or making sure you cannot recover sensitive information 1215 01:01:17,776 --> 01:01:20,866 on your screen whether it is some financial information 1216 01:01:20,866 --> 01:01:23,246 or photos or documents or anything that you do 1217 01:01:23,506 --> 01:01:25,026 or do not want to be recovered. 1218 01:01:25,266 --> 01:01:27,246 In week seven will we introduce mo- 1219 01:01:27,246 --> 01:01:29,706 yet more sophisticated data structures 1220 01:01:29,706 --> 01:01:31,626 so that you're equipped to solve even more 1221 01:01:31,906 --> 01:01:33,006 sophisticated problems. 1222 01:01:33,006 --> 01:01:35,776 In week eight will we transition away from C 1223 01:01:36,086 --> 01:01:38,206 and to something more, let's say, modern. 1224 01:01:38,206 --> 01:01:40,326 Something more familiar that of the web world. 1225 01:01:40,326 --> 01:01:42,676 So by the end of the semester will you be able to make, 1226 01:01:42,886 --> 01:01:45,996 certainly your own websites, but not just with html and CSS, 1227 01:01:46,136 --> 01:01:49,106 the languages with which you just make static websites. 1228 01:01:49,266 --> 01:01:52,066 We'll talk about PHP and SQL and Javascript 1229 01:01:52,066 --> 01:01:54,686 so that you can actually make things more dynamic. 1230 01:01:55,056 --> 01:01:57,426 In week nine we'll continue that conversation as well 1231 01:01:57,426 --> 01:02:00,116 as in week 10, but it's really in the week's problem sets 1232 01:02:00,756 --> 01:02:02,316 that you will dive in. 1233 01:02:02,316 --> 01:02:05,476 In sections, will be this year, particularly more hands-on. 1234 01:02:05,526 --> 01:02:08,246 Sections are led by our team of some 40 teaching fellows 1235 01:02:08,246 --> 01:02:10,276 and there'll be any number of sections that won't start 1236 01:02:10,276 --> 01:02:13,326 until week three of the course, but more on that next week. 1237 01:02:13,326 --> 01:02:14,756 But realize they'll be a combination 1238 01:02:14,756 --> 01:02:17,456 of conceptual coverage as well as hands-on activities 1239 01:02:17,506 --> 01:02:18,516 with your own laptops. 1240 01:02:18,836 --> 01:02:20,836 But the p sets themselves are what make things 1241 01:02:20,836 --> 01:02:21,546 quite memorable. 1242 01:02:21,806 --> 01:02:24,506 On Friday will we look at this graphical language called 1243 01:02:24,506 --> 01:02:26,866 Scratch and you'll program for the very first time, 1244 01:02:26,866 --> 01:02:30,726 I bet quite intuitively, by dragging puzzle pieces, 1245 01:02:30,866 --> 01:02:34,106 little graphics that interlock only if it makes sense 1246 01:02:34,336 --> 01:02:35,636 to do this and then that. 1247 01:02:35,996 --> 01:02:39,216 And you'll be able to make, in just two days, your own graphics 1248 01:02:39,216 --> 01:02:41,996 and games and interactive art in the context 1249 01:02:42,066 --> 01:02:44,586 of this particular CAT based world. 1250 01:02:44,826 --> 01:02:48,156 Next week will we, in problem set one last year did students 1251 01:02:48,156 --> 01:02:50,176 then transition to that language called C 1252 01:02:50,406 --> 01:02:52,856 and implement the basics of programming, 1253 01:02:52,856 --> 01:02:56,946 talking about things like loops and functions and jargon 1254 01:02:56,946 --> 01:02:59,036 that will very quickly become familiar. 1255 01:02:59,036 --> 01:03:00,696 But once we have just a couple weeks 1256 01:03:00,696 --> 01:03:02,586 under our belt can we start to play thi- 1257 01:03:02,586 --> 01:03:04,036 with things like cryptography. 1258 01:03:04,336 --> 01:03:07,226 In week, problem set two last year did students have 1259 01:03:07,226 --> 01:03:10,726 to write their own cipher, an algorithm that encrypted 1260 01:03:10,776 --> 01:03:12,206 and decrypted information 1261 01:03:12,206 --> 01:03:14,746 so that you might indeed send a secret message 1262 01:03:14,746 --> 01:03:15,966 to someone across the room. 1263 01:03:16,436 --> 01:03:19,106 In problem set three last year did students implement the game 1264 01:03:19,106 --> 01:03:21,496 of 15, this otherwise silly party favor 1265 01:03:21,496 --> 01:03:23,626 that you might've gotten where you move those numbers up, down, 1266 01:03:23,626 --> 01:03:25,786 left, right within the context of a computer. 1267 01:03:25,946 --> 01:03:27,236 And in that week in particular 1268 01:03:27,236 --> 01:03:29,076 for our more comfortable students, 1269 01:03:29,276 --> 01:03:31,876 the hacker edition challenges you not to implement this 1270 01:03:32,286 --> 01:03:33,766 in such a way that a human can play, 1271 01:03:34,036 --> 01:03:37,786 but rather to implement the computer to play itself 1272 01:03:37,786 --> 01:03:40,206 and solve this problem no matter what the arrangement 1273 01:03:40,206 --> 01:03:41,776 of the board is initially. 1274 01:03:42,046 --> 01:03:44,926 In problem set four last year did students implement Sudoku 1275 01:03:44,926 --> 01:03:47,516 using a graphics library with which you could get colors 1276 01:03:47,516 --> 01:03:49,886 and lines and more interesting user interfaces. 1277 01:03:49,886 --> 01:03:53,346 In problem set five last year did I stroll across campus 1278 01:03:53,656 --> 01:03:56,206 and taking photos of people and places and things 1279 01:03:56,206 --> 01:03:59,816 and like a doofus I accidentally formatted my digital camera's 1280 01:03:59,856 --> 01:04:00,966 compact flash card. 1281 01:04:01,266 --> 01:04:04,246 But never fear, I made a forensic image 1282 01:04:04,286 --> 01:04:06,926 of my camera whereby we then gave every one 1283 01:04:06,926 --> 01:04:10,496 of those 494 students a file inside of which were all 1284 01:04:10,496 --> 01:04:13,776 of the bits, all of the 0's and 1's that composed the jpegs 1285 01:04:13,806 --> 01:04:15,336 that I had taken of things on campus. 1286 01:04:15,606 --> 01:04:17,886 We handed it out and they wrote software with which 1287 01:04:17,886 --> 01:04:19,726 to recover those photos. 1288 01:04:19,726 --> 01:04:22,656 And for brownie points, once they had recovered those photos, 1289 01:04:22,656 --> 01:04:25,606 they then went and recovered the people who'd been photographed 1290 01:04:25,606 --> 01:04:27,696 and we challenged students with a fabulous prize 1291 01:04:27,696 --> 01:04:29,976 that if you photographed yourself with each 1292 01:04:29,976 --> 01:04:31,846 of the faculty members who happen to be 1293 01:04:31,926 --> 01:04:35,006 in the otherwise deleted photos you would win some 1294 01:04:35,006 --> 01:04:35,976 fabulous prize. 1295 01:04:35,976 --> 01:04:37,486 So we had a couple of sections competing 1296 01:04:37,486 --> 01:04:38,676 for that prize in the end. 1297 01:04:39,006 --> 01:04:42,306 In problem set six last year we implemented a spell checker, 1298 01:04:42,306 --> 01:04:44,866 but a spell checker that was actually a bit competitive 1299 01:04:44,866 --> 01:04:46,436 whereby if you wanted, on an opt 1300 01:04:46,436 --> 01:04:50,116 in basis you could challenge the so-called CS50 big board, 1301 01:04:50,306 --> 01:04:52,766 and run your code in such a way that we ran it 1302 01:04:52,766 --> 01:04:54,896 through a whole bunch of tests and then reported 1303 01:04:54,896 --> 01:04:57,726 on the course's home page how much memory you were using 1304 01:04:57,726 --> 01:05:00,786 and how many seconds your program took to load 1305 01:05:00,786 --> 01:05:03,076 in 150,000 English words, 1306 01:05:03,246 --> 01:05:05,706 to spell check the King James bible, 1307 01:05:05,706 --> 01:05:08,306 the Austin Powers movie script, and a whole bunch 1308 01:05:08,306 --> 01:05:10,706 of other sample inputs and what was fascinating 1309 01:05:10,706 --> 01:05:13,596 about that particular p set that year is that because 1310 01:05:13,596 --> 01:05:16,066 of this optional competitive aspect, 1311 01:05:16,296 --> 01:05:18,376 we never had people working so hard. 1312 01:05:18,376 --> 01:05:21,036 Because folks would go to dinner, they'd be number two 1313 01:05:21,036 --> 01:05:23,186 on the big board or thereabouts, they'd come back 1314 01:05:23,186 --> 01:05:24,596 and their roommate had been toiling away 1315 01:05:24,596 --> 01:05:26,266 and now they'd been bumped down to place 10. 1316 01:05:26,586 --> 01:05:29,416 And so the sort of social aspect there enabled people, 1317 01:05:29,496 --> 01:05:32,356 sort of incentivized people to go back to the drawing board 1318 01:05:32,356 --> 01:05:33,616 to outdo their roommates. 1319 01:05:34,036 --> 01:05:37,026 In problem set seven last year did we have students implement 1320 01:05:37,316 --> 01:05:40,336 CS50 finance, their own version of like an E Trade 1321 01:05:40,436 --> 01:05:42,356 like website that's integrated 1322 01:05:42,356 --> 01:05:46,236 with nearly real-time stock quote data with Yahoo Finance 1323 01:05:46,496 --> 01:05:48,816 so that you could buy and sell stocks 1324 01:05:48,816 --> 01:05:52,566 and get nearly real-time stock quotes with your very own tool. 1325 01:05:52,866 --> 01:05:55,616 Now we also ran a simulated stock competition 1326 01:05:55,616 --> 01:05:58,716 where we gave all 500 students 10,000 virtual dollars 1327 01:05:58,716 --> 01:05:59,316 to play with. 1328 01:05:59,616 --> 01:06:02,606 I did not implement that big board all that well since m- 1329 01:06:02,606 --> 01:06:08,976 a couple of our students, who are now on staff, crafted out of 1330 01:06:08,976 --> 01:06:10,576 that 10,000 virtual dollars, 1331 01:06:10,776 --> 01:06:13,046 I think 20 billion a week or two later. 1332 01:06:13,386 --> 01:06:15,086 So there were some holes in the system. 1333 01:06:15,086 --> 01:06:17,376 In particular when you use something like Yahoo Finance, 1334 01:06:17,376 --> 01:06:18,296 which you're not paying for, 1335 01:06:18,576 --> 01:06:20,306 when I say nearly real-time I mean there's 1336 01:06:20,306 --> 01:06:22,026 like a five or a 15 minute delay. 1337 01:06:22,406 --> 01:06:25,046 Problem with that of course is that you can see the future 1338 01:06:25,046 --> 01:06:28,326 by just watching TV seeing what the stock price is 1339 01:06:28,326 --> 01:06:29,416 and you still have 15 minutes 1340 01:06:29,416 --> 01:06:31,556 to buy the stock that's about to go up. 1341 01:06:32,536 --> 01:06:35,156 [laughter] So there are some real-world issues 1342 01:06:35,156 --> 01:06:37,196 in at least our simulation there of fun. 1343 01:06:37,406 --> 01:06:39,806 And in problem set eight last year did we challenge students 1344 01:06:39,806 --> 01:06:43,526 to implement CS50 shuttle which integrated a website 1345 01:06:43,526 --> 01:06:45,216 that students wrote with a plug-in 1346 01:06:45,216 --> 01:06:47,546 by Google called Google Earth which allowed them 1347 01:06:47,546 --> 01:06:50,876 to implement their own shuttle service whereby you could take, 1348 01:06:51,166 --> 01:06:56,566 open a web browser here, you could then go to your keyboard 1349 01:06:56,566 --> 01:07:02,796 and start driving around campus like this, the goal being 1350 01:07:02,796 --> 01:07:06,206 to pick up the TF's and CA's whose heads are looming large 1351 01:07:06,206 --> 01:07:08,496 here in the distance, put them in your shuttle 1352 01:07:08,496 --> 01:07:10,536 and then bring them back to their particular house. 1353 01:07:11,036 --> 01:07:12,976 So there's the Inn at Harvard. 1354 01:07:13,376 --> 01:07:15,246 Let's see if we can make our way to the quad here. 1355 01:07:15,976 --> 01:07:16,746 All right [inaudible]. 1356 01:07:18,586 --> 01:07:23,816 Take a l- right here, and a left here, 1357 01:07:23,946 --> 01:07:25,706 shortcut through the grass [laughter]. 1358 01:07:26,326 --> 01:07:29,526 All right we're on Garden Street now. 1359 01:07:31,296 --> 01:07:32,696 Registrar. 1360 01:07:33,736 --> 01:07:37,136 And here we are, little shortcut to Pfoho [laugher] okay. 1361 01:07:38,486 --> 01:07:41,816 And there we are at Pforzheimer's House. 1362 01:07:41,816 --> 01:07:44,616 And so that was a tool that our own students implemented last 1363 01:07:44,616 --> 01:07:48,326 year for the climax of those, that year's problem sets. 1364 01:07:48,636 --> 01:07:51,816 So what resources exist to empower you yourself 1365 01:07:51,816 --> 01:07:53,296 to make sure you s- can succeed? 1366 01:07:53,496 --> 01:07:54,986 Know too, in addition to sections 1367 01:07:54,986 --> 01:07:56,836 and lectures there are these things called walk-throughs, 1368 01:07:56,836 --> 01:08:00,346 these optional sessions once a week that walk you through how 1369 01:08:00,346 --> 01:08:02,356 to get started on a problem set so that 1370 01:08:02,356 --> 01:08:04,846 when you read these PDF's and stare at the screen and you have 1371 01:08:04,846 --> 01:08:06,946 that very common question with any homework, 1372 01:08:07,146 --> 01:08:08,506 my god where do I begin? 1373 01:08:08,706 --> 01:08:10,766 Well these walk-throughs that are videotaped and led 1374 01:08:10,766 --> 01:08:12,066 by the staff will walk you 1375 01:08:12,066 --> 01:08:14,156 through the process of getting started. 1376 01:08:14,496 --> 01:08:16,746 And in terms of the community that Matt hinted at before, 1377 01:08:17,046 --> 01:08:19,306 know that very shortly you will have swipe access 1378 01:08:19,306 --> 01:08:21,836 to the CS50 lounge which looks a little something like this 1379 01:08:22,136 --> 01:08:25,676 and has such amenities as a Wii, and an Xbox and PS3, 1380 01:08:25,906 --> 01:08:28,616 some foosball tables there, a candy machine 1381 01:08:28,616 --> 01:08:30,756 and for those familiar, a cat in the ceiling. 1382 01:08:31,396 --> 01:08:35,596 So [laughter] know too that the course's website will become 1383 01:08:35,596 --> 01:08:38,256 your window into the course and rather than just put videos 1384 01:08:38,256 --> 01:08:39,876 of lectures up there on the screen we 1385 01:08:39,876 --> 01:08:42,686 like to do something a little different and transcribe all 1386 01:08:42,686 --> 01:08:44,566 of the words that might come out of my mouth 1387 01:08:44,566 --> 01:08:46,506 so that you can search these lectures and jump 1388 01:08:46,506 --> 01:08:48,466 around by clicking the transcripts 1389 01:08:48,506 --> 01:08:51,246 that appear there on CS50 TV. 1390 01:08:51,426 --> 01:08:53,826 But it's these images that you should keep in mind. 1391 01:08:53,826 --> 01:08:57,386 Of the CS50 fair and the CS50 Hackathon, the course culminates 1392 01:08:57,386 --> 01:09:00,516 in this final project that is entirely your own to devise, 1393 01:09:00,756 --> 01:09:03,306 and when you implement your final project it will then be 1394 01:09:03,306 --> 01:09:07,326 on display to-- last year, some 2,000 students and faculty 1395 01:09:07,326 --> 01:09:08,906 and staff across campus. 1396 01:09:09,276 --> 01:09:10,126 And these are the kinds 1397 01:09:10,126 --> 01:09:12,556 of images you saw just a moment ago. 1398 01:09:12,886 --> 01:09:15,736 This was the CS50 Hackathon which toward semester's end 1399 01:09:15,736 --> 01:09:17,916 and about a week before the final project is due, 1400 01:09:18,166 --> 01:09:21,766 we as a class will be invited to drive down in the CS50 shuttle, 1401 01:09:21,766 --> 01:09:24,886 literally, to Microsoft's campus at NERD. 1402 01:09:24,886 --> 01:09:27,996 N-E-R-D which is a brilliant acronym for New England Research 1403 01:09:27,996 --> 01:09:32,306 and Development and spend on evening from 8 p.m. until 7 a.m. 1404 01:09:32,556 --> 01:09:36,396 in a space that looks a little something like this. 1405 01:09:37,046 --> 01:09:40,416 Take away today that 77% of the people 1406 01:09:40,416 --> 01:09:42,846 around you have no prior experience 1407 01:09:42,846 --> 01:09:45,666 and you too can accomplish the sorts of things that you've seen 1408 01:09:45,666 --> 01:09:49,116 on display here so that your faces too will look a little 1409 01:09:49,116 --> 01:09:51,536 something like this over the next several months. 1410 01:09:51,906 --> 01:09:54,106 But for now, cake awaits you outside. 1411 01:09:54,516 --> 01:09:56,976 This is CS50 and we'll see you on Friday. 1412 01:09:57,516 --> 01:10:08,800 [ Applause ]