1 00:00:08,976 --> 00:00:16,546 >> Hello this is CS50 my name is David Malan 2 00:00:16,546 --> 00:00:18,596 and I will be your instructor this semester; 3 00:00:18,596 --> 00:00:21,756 and some of you are here because you saw someone tear a phone 4 00:00:21,756 --> 00:00:24,596 book in half at something called Harvard Thinks Big last year; 5 00:00:24,806 --> 00:00:25,856 and some of you may be here 6 00:00:25,856 --> 00:00:27,646 because you've been using a little tool called 7 00:00:27,646 --> 00:00:30,956 HarvardCourses and we just so happened to put CS50 8 00:00:30,956 --> 00:00:31,966 on your shopping list. 9 00:00:31,966 --> 00:00:34,696 But whatever your reason for being here this is 10 00:00:34,696 --> 00:00:37,646 in fact our introduction to Computer Science; and contrary 11 00:00:37,646 --> 00:00:40,816 to what you might have heard or seen or perceived 12 00:00:40,816 --> 00:00:43,616 in high school, odds are computer science is not quite 13 00:00:43,656 --> 00:00:45,126 what you imagined it to be. 14 00:00:45,126 --> 00:00:47,006 First and foremost it is not ultimately 15 00:00:47,236 --> 00:00:49,896 about programming even though this is unfortunately the 16 00:00:49,896 --> 00:00:52,416 message that's conveyed, but in light of a lot 17 00:00:52,416 --> 00:00:55,386 of high school curricula rather, programming is just a tool 18 00:00:55,606 --> 00:00:57,686 that computer scientists and engineers 19 00:00:57,686 --> 00:01:00,846 and increasingly humanists and folks from all sorts 20 00:01:00,846 --> 00:01:03,966 of fields use to actually solve problems of interest to them. 21 00:01:03,966 --> 00:01:07,016 The programming aspect is just a means to an end; 22 00:01:07,016 --> 00:01:09,416 and so this phone book in my hand is just representative 23 00:01:09,416 --> 00:01:11,556 to a problem one person might solve, 24 00:01:11,556 --> 00:01:13,146 completely non-digital this one, 25 00:01:13,146 --> 00:01:16,316 but very much real world whereby there is some person 26 00:01:16,316 --> 00:01:20,176 or something in a large chunk of data here; thousand 27 00:01:20,176 --> 00:01:24,896 or more pages of text and I want to find someone like Mike Smith. 28 00:01:24,896 --> 00:01:27,906 Now at Harvard Thinks Big I happened to tear 29 00:01:27,906 --> 00:01:30,496 into this thing myself and it would seem a little pointless 30 00:01:30,496 --> 00:01:31,986 to re-hash that same demo 31 00:01:31,986 --> 00:01:36,376 so instead I thought I'd solicit an ideally sufficiently strong 32 00:01:36,376 --> 00:01:38,086 volunteer to come on up. 33 00:01:38,426 --> 00:01:41,746 You have to be comfy on camera but this is your first chance 34 00:01:41,776 --> 00:01:43,796 to say hello to mom and dad on camera. 35 00:01:45,786 --> 00:01:47,686 One volunteer, yes come on up what's your name? 36 00:01:48,456 --> 00:01:48,666 >> Sumit. 37 00:01:49,006 --> 00:01:50,096 >> Sumit, all right come on up 38 00:01:50,976 --> 00:01:53,276 and if you could awkwardly hold this up front here for a moment. 39 00:01:53,776 --> 00:01:56,986 [ Applause ] 40 00:01:57,486 --> 00:01:58,566 >> David Malan: So if you want to just hang here 41 00:01:58,566 --> 00:02:01,466 for just a moment let's walk through the problem at hand. 42 00:02:01,466 --> 00:02:02,716 I'm looking for Mike Smith. 43 00:02:02,966 --> 00:02:05,486 There are some thousand pages in this book, 44 00:02:05,666 --> 00:02:09,586 and I the human could certainly find Mike Smith every easily, 45 00:02:09,586 --> 00:02:13,336 very correctly by starting, if you'll simulate from the front 46 00:02:13,446 --> 00:02:17,286 of the phone book on page 1, looking for Mike Smith. 47 00:02:17,286 --> 00:02:20,456 I see no Mike Smiths because I'm on page 1 48 00:02:20,816 --> 00:02:24,336 where the A's simply are so I turn to the B's and the C's 49 00:02:24,336 --> 00:02:26,436 and the D's and so forth and finally I get to the S's 50 00:02:26,436 --> 00:02:28,296 but in the worst case I've looked 51 00:02:28,296 --> 00:02:30,396 through 1,000 or so pages. 52 00:02:30,396 --> 00:02:32,266 Now you the smart human 53 00:02:32,266 --> 00:02:35,186 with just gut instincts probably would not be so naive 54 00:02:35,186 --> 00:02:37,436 as to start from the left and work your way forward. 55 00:02:37,696 --> 00:02:39,046 What would you do? 56 00:02:39,046 --> 00:02:40,906 >> Dive right into the middle. 57 00:02:40,966 --> 00:02:42,536 >> So dive right into the middle 58 00:02:42,536 --> 00:02:47,316 so if you would now simulate would a typical human might do, 59 00:02:47,726 --> 00:02:49,956 where would you dive in first to find Mike Smith? 60 00:02:50,976 --> 00:02:57,006 All right so roughly into the middle (oh this will be 61 00:02:57,006 --> 00:02:58,836 over too fast) roughly into the middle 62 00:02:58,836 --> 00:03:00,466 and at this point you realize what letter 63 00:03:00,466 --> 00:03:01,526 of the alphabet are you on? 64 00:03:01,856 --> 00:03:02,056 >> Student: L. 65 00:03:02,056 --> 00:03:04,446 >> David: All right so we're on L so roughly half way through; 66 00:03:04,606 --> 00:03:07,096 so the intuitive now is of course that Mike is not 67 00:03:07,166 --> 00:03:09,666 to the left of the phone book because that's L and prior, 68 00:03:09,666 --> 00:03:10,886 but rather he is to the right 69 00:03:11,056 --> 00:03:14,076 so we can literally tear this problem in half-- 70 00:03:14,076 --> 00:03:14,886 cue tearing-- cue tearing. 71 00:03:15,076 --> 00:03:16,766 >> Student: Are you serious? 72 00:03:17,296 --> 00:03:19,296 >> David: I am very serious. 73 00:03:19,396 --> 00:03:21,856 I need you tear not the page out; 74 00:03:21,856 --> 00:03:23,816 I need you to tear this phone book in half 75 00:03:23,816 --> 00:03:25,606 in front of 500 of your peers. 76 00:03:25,606 --> 00:03:26,036 [ Applause ] 77 00:03:26,036 --> 00:03:26,406 >> David: Excellent. 78 00:03:30,466 --> 00:03:32,666 So we've now whittled this problem down into half 79 00:03:33,056 --> 00:03:34,446 and so we can literally 80 00:03:34,446 --> 00:03:37,056 and dramatically throw half of the problem away. 81 00:03:37,196 --> 00:03:44,106 So now we're left with a problem that's but 500 pages large 82 00:03:44,106 --> 00:03:47,706 and so what might a human do now to find Mike even more closely? 83 00:03:48,766 --> 00:03:50,486 Dive in straight to the half again 84 00:03:50,486 --> 00:03:52,326 and so now we end up on what letter? 85 00:03:52,616 --> 00:03:52,746 >> Student: P. 86 00:03:53,026 --> 00:03:55,246 >> David: So P so we're getting closer but we're not quite there 87 00:03:55,246 --> 00:03:59,076 yet and so we tear this problem in half, whittling that problem 88 00:03:59,076 --> 00:04:03,986 down although it is getting a little easier; 89 00:04:04,486 --> 00:04:06,206 whittling the problem down further into half 90 00:04:06,316 --> 00:04:08,626 and if we do this again and again and again we've gone 91 00:04:08,626 --> 00:04:12,776 from 1,000 pages, to 500 pages, to 250 to 125 and so forth; 92 00:04:12,936 --> 00:04:15,466 and so after just a few relatively speaking 93 00:04:15,466 --> 00:04:18,546 of these page tears we've hopefully found Mike Smith's 94 00:04:18,546 --> 00:04:21,566 location; and so in computer science terms we actually say 95 00:04:21,566 --> 00:04:22,956 that this algorithm or this process, 96 00:04:22,956 --> 00:04:24,936 this program is logarithmic. 97 00:04:24,936 --> 00:04:27,396 You might remember vaguely logarithms from high school math 98 00:04:27,396 --> 00:04:29,266 and such but what this suggests for us , 99 00:04:29,266 --> 00:04:30,256 the computer scientists, is 100 00:04:30,256 --> 00:04:33,616 that this is certainly a smarter, a faster algorithm. 101 00:04:33,616 --> 00:04:36,216 So put this into perspective, imagine now not a phone book 102 00:04:36,216 --> 00:04:39,366 with 1,000 pages but like a search engine's index 103 00:04:39,366 --> 00:04:43,586 with say 1 million pages or even bigger, 4 billion pages, 104 00:04:43,586 --> 00:04:45,936 which isn't even as many web pages as might be out there 105 00:04:46,006 --> 00:04:47,456 so if you have 4 billion 106 00:04:47,456 --> 00:04:50,916 of something how many times could you tear a 4 billion page 107 00:04:50,916 --> 00:04:52,696 phone book in half, in half, 108 00:04:52,856 --> 00:04:55,286 in half until you find the person you're looking for? 109 00:04:55,896 --> 00:05:00,826 Anyone? How many times can you tear a 4 billion page phone book 110 00:05:00,826 --> 00:05:02,046 in half? 111 00:05:03,936 --> 00:05:08,776 It's 33, 32, it's only 32 times and you can check that math 112 00:05:08,776 --> 00:05:11,716 at home but here lies the power of algorithmic thinking, 113 00:05:11,716 --> 00:05:13,486 of computational thinking as they say. 114 00:05:13,726 --> 00:05:17,016 You can take a problem that might be relatively intuitive 115 00:05:17,016 --> 00:05:18,616 to solve but when you scale this thing 116 00:05:18,616 --> 00:05:21,026 up as is increasingly the case in the web, 117 00:05:21,026 --> 00:05:23,246 in large data systems, and so forth, you actually have 118 00:05:23,246 --> 00:05:26,046 to now think smart, you actually have to think efficiently 119 00:05:26,046 --> 00:05:28,366 and you have to solve this problem effectively. 120 00:05:28,366 --> 00:05:31,506 And that is ultimately what Computer Science 50 is going 121 00:05:31,506 --> 00:05:32,036 to be about. 122 00:05:32,036 --> 00:05:34,126 A big round of applause for our volunteer here. 123 00:05:34,126 --> 00:05:35,216 [ Applause ] 124 00:05:35,216 --> 00:05:35,746 >> David: Thank you. 125 00:05:39,156 --> 00:05:40,676 We have this one parting gift-- 126 00:05:40,676 --> 00:05:43,166 just a little legal waiver for the cameras if you would. 127 00:05:45,956 --> 00:05:50,806 So let's not put him only on the spot; there's a whole bunch 128 00:05:50,806 --> 00:05:53,146 of us in this room and we can actually apply this same idea 129 00:05:53,146 --> 00:05:55,936 not to these phone books but actually 130 00:05:55,936 --> 00:05:58,316 to other real world problems, there's a whole bunch 131 00:05:58,316 --> 00:05:59,266 of people in this room. 132 00:05:59,536 --> 00:06:01,836 And frankly it would be incredibly time-consuming 133 00:06:01,836 --> 00:06:04,256 and tedious for me, to count this room full 134 00:06:04,256 --> 00:06:08,536 of people old school style-- 1, 2, 3 and so forth. 135 00:06:08,536 --> 00:06:10,196 So what do you do when you're a kid and you want 136 00:06:10,196 --> 00:06:12,506 to count a little faster than 1 and 2 and 3 137 00:06:12,506 --> 00:06:14,076 and 4 what is the simplest thing you do? 138 00:06:14,076 --> 00:06:17,626 So try 2m 4, 6, 8 and that's good right? 139 00:06:17,856 --> 00:06:19,606 This is not to belittle that simplicity 140 00:06:19,606 --> 00:06:20,796 of the idea; that's wonderful. 141 00:06:20,796 --> 00:06:23,676 It literally halves the amount of time it takes to solve 142 00:06:23,676 --> 00:06:25,986 that problem but we can actually do better. 143 00:06:26,266 --> 00:06:30,396 So I propose this algorithm, this program, this process 144 00:06:30,716 --> 00:06:32,656 for counting people in this room. 145 00:06:32,956 --> 00:06:35,696 In a moment I'm going to ask you to humor us and stand up 146 00:06:35,696 --> 00:06:38,046 but not just yet; and then you're going to each take 147 00:06:38,046 --> 00:06:41,566 on the number 1-- think to yourself I am number 1. 148 00:06:41,606 --> 00:06:42,966 Then you're going to pair off 149 00:06:42,966 --> 00:06:45,256 with someone else who's standing next to you, you're going 150 00:06:45,326 --> 00:06:47,306 to sum your numbers together and one 151 00:06:47,306 --> 00:06:49,696 of you whoever is fastest probably is going to sit down 152 00:06:49,916 --> 00:06:52,486 and the other person is going to take on his or her number, 153 00:06:52,696 --> 00:06:56,156 the summation of those numbers; and then you're going to repeat 154 00:06:56,156 --> 00:06:58,616 and if you follow the logic here in just a few moments, 155 00:06:58,616 --> 00:07:01,266 there should be just one of you very awkwardly standing. 156 00:07:01,566 --> 00:07:06,976 So if you would everyone stand up, take on the number 1 and go. 157 00:07:07,516 --> 00:08:07,906 [Talking and music] 158 00:08:08,406 --> 00:08:10,956 >> All right at this point I see 1, 159 00:08:10,956 --> 00:08:13,356 2 lone souls standing; anyone else? 160 00:08:13,356 --> 00:08:16,776 3, all right so you have two partners potentially, 4 of you, 161 00:08:17,146 --> 00:08:17,906 this should be easy then. 162 00:08:18,506 --> 00:08:24,406 Oh and up there, anyone else need a partner up there? 163 00:08:24,406 --> 00:08:27,636 Hence the title of this slide all right so 2, 164 00:08:28,016 --> 00:08:33,906 we've got you two paired off? 165 00:08:34,166 --> 00:08:39,626 Okay so exchange numbers; okay good half 166 00:08:39,836 --> 00:08:45,616 of that problem is gone now we have just these two left. 167 00:08:45,906 --> 00:08:48,176 Yes? Oh 3 okay. 168 00:08:48,176 --> 00:08:51,846 This is when the addition gets very publically awkward so. 169 00:08:51,846 --> 00:08:52,216 [ Laughter and Applause ] 170 00:08:52,216 --> 00:09:07,296 >> Okay 210 and? 171 00:09:09,546 --> 00:09:13,576 >> Student: 233. 172 00:09:13,826 --> 00:09:17,546 >> Wow 210 and 233 and the total 173 00:09:17,546 --> 00:09:21,646 that the teaching fellows got was 550 give or take 174 00:09:22,036 --> 00:09:27,446 so a little take maybe, but let's call it a success. 175 00:09:27,446 --> 00:09:28,956 Congrats to yourself here. 176 00:09:29,456 --> 00:09:32,316 [ Applause ] 177 00:09:32,816 --> 00:09:37,536 >> So now that might not have felt like the fastest algorithm 178 00:09:37,536 --> 00:09:40,166 but think about what you could have done with that algorithm 179 00:09:40,166 --> 00:09:42,896 in each iteration, much like the phonebook up front here, 180 00:09:43,106 --> 00:09:47,656 you literally split that problem in two 181 00:09:47,656 --> 00:09:50,486 because on each iteration roughly half of you were sitting 182 00:09:50,486 --> 00:09:52,476 down and then another half and then another half. 183 00:09:52,596 --> 00:09:53,616 So even though we might have started 184 00:09:53,616 --> 00:09:55,116 with 500 some odd people, 185 00:09:55,256 --> 00:09:57,866 it very quickly became a 250 person problem 186 00:09:57,866 --> 00:09:59,676 and then a 125 person problem. 187 00:09:59,906 --> 00:10:03,386 And so in theory after just 2 or 3 steps you were in order 188 00:10:03,386 --> 00:10:06,776 of magnitude farther along in this counting process 189 00:10:06,776 --> 00:10:08,336 than I would be because I'd still be 190 00:10:08,336 --> 00:10:10,876 on person literally 3 or 4. 191 00:10:10,956 --> 00:10:14,496 Now consider suppose a whole another 500 people walk 192 00:10:14,496 --> 00:10:16,776 into this room suddenly, now there's 1,000 people. 193 00:10:16,936 --> 00:10:19,236 Well how many more steps does this algorithm take? 194 00:10:19,496 --> 00:10:21,146 Well here is the power-- 1. 195 00:10:21,566 --> 00:10:23,356 And that's when things really get interesting 196 00:10:23,356 --> 00:10:25,726 and so this just hints at the types of thinking 197 00:10:25,726 --> 00:10:28,296 that one can derive from the field of computer science 198 00:10:28,296 --> 00:10:31,296 and apply either to the field itself of computer science, 199 00:10:31,296 --> 00:10:35,486 or whatever domain it is that you are here too study. 200 00:10:35,486 --> 00:10:39,356 So where can you actually apply these kinds of tricks? 201 00:10:39,356 --> 00:10:42,146 Well a number of you have spent this past week playing 202 00:10:42,146 --> 00:10:43,186 with this particular tool 203 00:10:43,186 --> 00:10:44,806 which is a project the course has been working 204 00:10:44,806 --> 00:10:48,516 on for some time in an effort to make it easier and more social 205 00:10:48,626 --> 00:10:50,306 to actually shop for courses. 206 00:10:50,306 --> 00:10:51,546 A natural question the first week 207 00:10:51,546 --> 00:10:53,426 of school is what are you shopping? 208 00:10:53,816 --> 00:10:57,716 Well our goal here was to answer that question for people 209 00:10:57,716 --> 00:11:00,396 and then hopefully facilitate friends getting together, 210 00:11:00,396 --> 00:11:02,546 shopping courses with each other, for each other, 211 00:11:02,546 --> 00:11:05,086 picking up syllabi and thus was born what we dub 212 00:11:05,326 --> 00:11:06,176 Harvard Courses. 213 00:11:06,176 --> 00:11:09,646 For those unfamiliar this is a website at courses.cs50.net 214 00:11:09,816 --> 00:11:12,216 and has the entire Harvard Course catalog in it 215 00:11:12,436 --> 00:11:13,686 and what it has at top left 216 00:11:13,686 --> 00:11:16,186 as you might see is definitely your Facebook login button. 217 00:11:16,456 --> 00:11:19,006 Simply by clicking that link you can then log into your account; 218 00:11:19,226 --> 00:11:21,666 and then on the left hand side what appears is a little menu 219 00:11:21,766 --> 00:11:24,286 of all of your friends who are also using this tool 220 00:11:24,286 --> 00:11:26,516 and you can select any one of them and actually see what 221 00:11:26,646 --> 00:11:27,886 that person is shopping. 222 00:11:27,886 --> 00:11:31,126 You can search obviously by any of the fields up top by days 223 00:11:31,126 --> 00:11:32,326 of the week you want a class; 224 00:11:32,376 --> 00:11:35,006 days of the week you don't want a class; grad level 225 00:11:35,006 --> 00:11:38,266 or undergrad level, faculty scores that are 4.0 and higher, 226 00:11:38,266 --> 00:11:40,586 course overall scores that are 4.0 and higher; 227 00:11:40,846 --> 00:11:42,706 and a whole number of other features including 228 00:11:42,706 --> 00:11:44,306 synchronization with Google calendar. 229 00:11:44,656 --> 00:11:48,646 And this is exactly the kind of project that everyone 230 00:11:48,646 --> 00:11:51,516 in this room 11 weeks hence could absolutely tackle 231 00:11:51,756 --> 00:11:52,796 as a final project. 232 00:11:52,796 --> 00:11:55,766 The pieces that we pulled off the shelf here were ultimately 233 00:11:55,766 --> 00:11:59,456 reduced to things like 4 loops and what we'll call functions 234 00:11:59,556 --> 00:12:03,046 and what we'll call abstraction; and all these fundamentals 235 00:12:03,046 --> 00:12:05,456 that at first glance might have some fairly RK 236 00:12:05,456 --> 00:12:06,836 and jargon associated with them. 237 00:12:06,836 --> 00:12:09,076 At the end of the day this is all about equipping you 238 00:12:09,076 --> 00:12:11,186 with skills and knowledge and understanding with which 239 00:12:11,396 --> 00:12:13,956 to take a problem, take a large data set maybe 240 00:12:14,116 --> 00:12:15,786 and actually produce something useful-- 241 00:12:15,786 --> 00:12:18,906 produce a project that is of interest to you. 242 00:12:19,006 --> 00:12:21,936 Fun facts for those of you who might have been diving 243 00:12:21,936 --> 00:12:25,626 into this application already, I looked through the logs 244 00:12:25,626 --> 00:12:27,376 and the statistics that we maintain on the site 245 00:12:27,606 --> 00:12:29,366 to get a sense of what's working well and what's not 246 00:12:29,636 --> 00:12:31,106 and some fun facts include these-- 247 00:12:31,326 --> 00:12:36,466 11,782 courses are on shopping list at the moment; 248 00:12:36,466 --> 00:12:39,826 1,384 Harvard Facebook users are actively using this; 249 00:12:40,306 --> 00:12:43,186 607 people have synchronized their shopping schedules 250 00:12:43,186 --> 00:12:45,926 with Google Calendar, and for the curious if you want 251 00:12:45,926 --> 00:12:48,346 to decide if you are average in terms 252 00:12:48,346 --> 00:12:51,226 of how much shopping you're doing, 10 is the average number 253 00:12:51,226 --> 00:12:54,006 of courses as best we can tell that a student is shopping 254 00:12:54,316 --> 00:12:55,876 and it wouldn't be a fun fact 255 00:12:55,876 --> 00:12:57,486 if we also didn't look at the scary fact. 256 00:12:57,766 --> 00:12:59,556 The maximum number of courses someone 257 00:12:59,556 --> 00:13:01,126 on this campus is shopping this week-- 258 00:13:02,276 --> 00:13:07,436 not an outlier followed by closely 70, 66, 259 00:13:07,556 --> 00:13:14,456 63 on down so that is quite a lot of shopping to do. 260 00:13:14,456 --> 00:13:17,396 So you see a problem like this in the real world; 261 00:13:17,396 --> 00:13:19,636 you see a problem on campus you might want to solve. 262 00:13:19,636 --> 00:13:20,856 Ultimately you'll end 263 00:13:20,856 --> 00:13:22,976 up employing something called programming, 264 00:13:22,976 --> 00:13:27,366 the act of constructing, telling a computer to do your bidding. 265 00:13:27,596 --> 00:13:29,806 Well what form does this actually take? 266 00:13:29,806 --> 00:13:31,466 Well in this course you'll see over the course 267 00:13:31,466 --> 00:13:33,936 of the next several weeks a number of languages; 268 00:13:33,936 --> 00:13:36,056 because here too is there an interest in takeaway; 269 00:13:36,386 --> 00:13:38,796 what language you learn in an introductory course, 270 00:13:38,796 --> 00:13:41,356 what languages you know is not so much important 271 00:13:41,356 --> 00:13:44,636 as it is understanding how these languages work, learning one 272 00:13:44,636 --> 00:13:46,546 or two different types of languages 273 00:13:46,546 --> 00:13:49,426 and then very easily can you parlay your skills in a language 274 00:13:49,426 --> 00:13:52,786 like C or PHP or JAVA or any other number 275 00:13:52,786 --> 00:13:54,236 of languages to others. 276 00:13:54,236 --> 00:13:57,146 And so what's really empowering about this particular course is 277 00:13:57,146 --> 00:13:59,386 that it ultimately one of the goals is 278 00:13:59,386 --> 00:14:02,986 to help you help yourself; so that even if 50 proves 279 00:14:02,986 --> 00:14:06,756 to be a terminal course for you, you decide CS is not necessarily 280 00:14:06,756 --> 00:14:09,666 for me, you none the less exit this course with a whole bunch 281 00:14:09,666 --> 00:14:11,836 of skills and savvy that you can go off 282 00:14:11,836 --> 00:14:14,646 and apply wherever it is you're most interested in. 283 00:14:14,646 --> 00:14:17,406 In fact I just met a few weeks ago with a former student 284 00:14:17,596 --> 00:14:19,996 who is not a computer scientist, not even an engineering student; 285 00:14:19,996 --> 00:14:22,896 he's actually pre-med and he was working for some MDs this summer 286 00:14:23,396 --> 00:14:27,196 and they had gave him a huge text file containing like tens 287 00:14:27,196 --> 00:14:30,546 of thousands of patient records, and tens of thousands 288 00:14:30,756 --> 00:14:35,656 of doctor records, and they asked him just one semester 289 00:14:35,766 --> 00:14:39,136 ahead of CS50 can you tell us exactly which patients met 290 00:14:39,136 --> 00:14:41,186 with which doctors and how many times? 291 00:14:41,546 --> 00:14:42,126 All right this is kind 292 00:14:42,126 --> 00:14:44,596 of the Microsoft Excel problem from hell here right? 293 00:14:44,596 --> 00:14:47,156 Like how can you possibly figure that out 294 00:14:47,336 --> 00:14:49,756 with actually compelling a machine to do it for you 295 00:14:49,756 --> 00:14:52,056 and sure enough we chatted for a few moments, 296 00:14:52,056 --> 00:14:54,096 I kind of gently pointed out well it's kind 297 00:14:54,096 --> 00:14:55,826 of like problem 7 last year. 298 00:14:56,046 --> 00:14:58,816 And so sure enough he took this really large text file, 299 00:14:59,006 --> 00:15:02,426 he wrote a program in a language called PHP that's not even 300 00:15:02,426 --> 00:15:05,996 that long, a few lines of code yeah big, ran that big data file 301 00:15:05,996 --> 00:15:08,576 through it, imported it into what's called a database 302 00:15:08,966 --> 00:15:12,116 which is really just a super fancy version of Microsoft Excel 303 00:15:12,116 --> 00:15:15,286 or similar, and then he was able to write lines of code 304 00:15:15,416 --> 00:15:18,076 that allowed him to select some patients, select some doctors 305 00:15:18,266 --> 00:15:19,906 and look at where the intersection was 306 00:15:19,906 --> 00:15:23,816 so that the output for his bosses was exactly the answer 307 00:15:24,096 --> 00:15:25,016 they were looking for. 308 00:15:25,016 --> 00:15:27,956 It's just not possible to solve some of these problems by hand 309 00:15:28,156 --> 00:15:31,066 and this isn't even a domain that's necessarily 310 00:15:31,066 --> 00:15:32,636 into the world of CS but speaks 311 00:15:32,636 --> 00:15:34,626 to you the applicability of it all. 312 00:15:34,886 --> 00:15:37,086 So what does it mean to actually program? 313 00:15:37,086 --> 00:15:39,846 Well within the next few weeks we will dive into all sorts 314 00:15:39,846 --> 00:15:42,526 of languages but the first one is a little something 315 00:15:42,526 --> 00:15:43,346 called Scratch. 316 00:15:43,346 --> 00:15:46,476 It turns out that Scratch, a programming language developed 317 00:15:46,476 --> 00:15:49,276 by MIT's media lab, provides us with a nice, 318 00:15:49,426 --> 00:15:51,686 sort of user friendly graphical environment 319 00:15:51,896 --> 00:15:53,646 that thought it might look rather cute, 320 00:15:53,796 --> 00:15:57,196 it really is just a pictorial incarnation 321 00:15:57,196 --> 00:15:59,906 of the very same ideas we're going to be exploring next week 322 00:16:00,126 --> 00:16:01,656 with just a blinking cursor and text. 323 00:16:01,776 --> 00:16:04,266 We'll come full circle later in the semester and actually begin 324 00:16:04,266 --> 00:16:06,136 to create things just as animated again. 325 00:16:06,546 --> 00:16:08,546 Programming in this context boils 326 00:16:08,576 --> 00:16:10,536 down to telling the computer what to do. 327 00:16:10,796 --> 00:16:13,766 So on the left hand side of this particular languages environment 328 00:16:14,006 --> 00:16:16,676 I have some puzzle pieces and they are shaped and colored 329 00:16:16,946 --> 00:16:19,806 in a manner that hints out their functionality; 330 00:16:19,806 --> 00:16:23,106 any blocks that tell the Cat as we'll see in a moment, 331 00:16:23,106 --> 00:16:25,216 what to do something happen to be orange. 332 00:16:25,216 --> 00:16:28,416 Anything that tells him to sense something like the user's mouse 333 00:16:28,416 --> 00:16:31,896 or the edge of his screen is actually purple in color; 334 00:16:31,896 --> 00:16:34,186 and so they're nicely colorized and all this 335 00:16:34,226 --> 00:16:36,246 but the one that's adventurous right now is this. 336 00:16:36,426 --> 00:16:37,756 It's a little puzzle piece that says 337 00:16:37,756 --> 00:16:40,386 when the green flag is clicked and this is kind 338 00:16:40,386 --> 00:16:42,096 of like the beginning of a program; 339 00:16:42,096 --> 00:16:43,246 when you double click an icon 340 00:16:43,246 --> 00:16:45,476 on your desktop this is how something 341 00:16:45,476 --> 00:16:48,856 like that is implemented; it's listening for that double click, 342 00:16:48,856 --> 00:16:50,576 it's listening for that green flag. 343 00:16:50,776 --> 00:16:52,066 I'm going to go ahead and change 344 00:16:52,066 --> 00:16:53,966 to this Looks pallet over here. 345 00:16:54,166 --> 00:16:55,816 There's a whole bunch of blocks that we'll look 346 00:16:55,986 --> 00:16:58,306 at in more fun detail on Friday but I'm going 347 00:16:58,306 --> 00:17:00,416 to pick the easiest one here and I'm going to type 348 00:17:00,416 --> 00:17:03,296 in this string, "Hello CS50", 349 00:17:03,296 --> 00:17:06,416 zooming in say how nice the puzzle pieces are 350 00:17:06,416 --> 00:17:07,536 nicely interlocked? 351 00:17:07,536 --> 00:17:10,486 And then here is this green flag, I go up here and click, 352 00:17:10,986 --> 00:17:14,486 and sure enough hello CS50 and this is a program-- 353 00:17:14,676 --> 00:17:17,906 trivial though this is, this hints at the relative ease 354 00:17:17,906 --> 00:17:20,256 with which you can start wiring your thoughts together, 355 00:17:20,456 --> 00:17:23,626 instructing a computer line by line to do something for you; 356 00:17:23,816 --> 00:17:26,986 and we can very quickly go from something simple like this 357 00:17:27,276 --> 00:17:30,166 to something much more dynamic with a few more puzzle pieces 358 00:17:30,396 --> 00:17:34,146 but something that testament to what you can achieve 359 00:17:34,146 --> 00:17:36,286 in just a few weeks was implemented 360 00:17:36,286 --> 00:17:38,856 by a former student in a prior term. 361 00:17:38,856 --> 00:17:43,516 I give you a little animation that was implemented 362 00:17:43,516 --> 00:17:44,846 with this programming language 363 00:17:44,846 --> 00:17:48,226 in just a night called Raining Men. 364 00:17:49,516 --> 00:19:21,516 [ Music ] 365 00:19:22,016 --> 00:19:22,083 [ Applause ] 366 00:19:27,116 --> 00:19:30,016 >> So what you start to see even in programs like this, 367 00:19:30,076 --> 00:19:32,616 that they're actually very methodical underneath the hood 368 00:19:32,616 --> 00:19:34,636 and even though at first glance you might think to yourself, 369 00:19:34,696 --> 00:19:37,426 "I have never done anything like that, I've never used a program 370 00:19:37,426 --> 00:19:40,026 that hasn't been re-informing," if you start to look closely 371 00:19:40,026 --> 00:19:42,776 at what's up on the screen, you realize oh if I just focus 372 00:19:42,776 --> 00:19:46,046 on one of those singers at first, I first have this sprite 373 00:19:46,046 --> 00:19:48,886 as it's called, this animated character, but it's not animated 374 00:19:48,886 --> 00:19:50,896 by default much like the cat didn't move 375 00:19:50,996 --> 00:19:53,226 and so I need something that we'll call a loop-- 376 00:19:53,226 --> 00:19:56,356 something that makes this sprite move from side to side 377 00:19:56,356 --> 00:19:57,986 but I can't let it go all the way to the edge. 378 00:19:57,986 --> 00:20:00,416 As soon as I detect with what we'll call a condition 379 00:20:00,496 --> 00:20:03,036 if I'm touching the edge I have to essentially spin 380 00:20:03,036 --> 00:20:06,116 around 180 degrees and then continue looping. 381 00:20:06,116 --> 00:20:08,536 And so with these basic building blocks, can you build 382 00:20:08,536 --> 00:20:10,656 up much more interesting things and they don't have 383 00:20:10,656 --> 00:20:12,426 to be static animations like this. 384 00:20:12,686 --> 00:20:15,496 You can even implement your own versions of some 385 00:20:15,496 --> 00:20:17,876 of the most popular console games today 386 00:20:18,146 --> 00:20:20,146 for which I need another volunteer. 387 00:20:21,476 --> 00:20:22,296 Yes come on up. 388 00:20:22,296 --> 00:20:22,736 What's your name? 389 00:20:23,356 --> 00:20:23,736 >> Fox. 390 00:20:23,856 --> 00:20:28,976 >> Fox come on up and for your we have-- come on up yep-- 391 00:20:29,756 --> 00:20:31,046 so the keyboard this time 392 00:20:32,646 --> 00:20:36,096 for you we have Scratch, Scratch Revolution. 393 00:20:36,286 --> 00:20:42,256 So in a moment you're going to go ahead and hit the spacebar 394 00:20:42,306 --> 00:20:44,606 and then as things fall from the screen when they line 395 00:20:44,606 --> 00:20:46,256 up with the left arrow, hit the left arrow 396 00:20:46,256 --> 00:20:47,566 with a different arrow, hit that arrow 397 00:20:47,566 --> 00:20:48,986 and see how good a score you can get. 398 00:20:49,076 --> 00:20:51,586 So whenever you are ready hit the space. 399 00:20:53,516 --> 00:21:46,566 [ Music ] 400 00:21:47,066 --> 00:21:47,976 >> A big round of applause. 401 00:21:48,146 --> 00:21:54,846 Very well done. 402 00:21:54,846 --> 00:21:54,913 [ Applause ] 403 00:21:54,913 --> 00:21:57,886 >> So this tune made by one of our former students; 404 00:21:58,406 --> 00:22:00,916 but it doesn't have to be something written in Scratch, 405 00:22:00,916 --> 00:22:02,016 it doesn't have to be a game 406 00:22:02,016 --> 00:22:05,156 or animation it can simply be an incredibly, 407 00:22:05,156 --> 00:22:08,926 wonderfully way to spend time. 408 00:22:08,926 --> 00:22:11,726 So this is perhaps a site that some 409 00:22:11,726 --> 00:22:14,456 of you have spent way too much time on last year, 410 00:22:14,456 --> 00:22:18,676 if not in the past week or so, this is isawyouharvard.com. 411 00:22:18,676 --> 00:22:20,546 This was made by Tej Toor, 412 00:22:20,656 --> 00:22:23,566 an economics concentrator in Mather House, 413 00:22:23,676 --> 00:22:26,046 this past year for her final project; 414 00:22:26,046 --> 00:22:29,296 and Tej prior to 50 had never programmed before 415 00:22:29,296 --> 00:22:33,946 and she found herself completely ill-prepared for final exams 416 00:22:33,946 --> 00:22:37,586 as a result of this thing having taken off the night before the 417 00:22:37,656 --> 00:22:40,816 CS50 Fair which we'll discuss in just a bit; 418 00:22:41,276 --> 00:22:44,116 before which she sent out an e-mail to her house list 419 00:22:44,456 --> 00:22:47,976 and bam--a thousand posts later was she scrambling 420 00:22:47,976 --> 00:22:50,096 to add features, add functionality 421 00:22:50,266 --> 00:22:52,226 or start moderating some of the posts. 422 00:22:52,476 --> 00:22:56,486 It was a wonderfully good problem to have this too 423 00:22:56,486 --> 00:22:58,336 at the culmination of just a few weeks. 424 00:22:58,336 --> 00:23:00,576 So what are the expectations 425 00:23:00,576 --> 00:23:02,236 over the course of these few weeks? 426 00:23:02,436 --> 00:23:04,316 To attend these lectures in sections-- 427 00:23:04,316 --> 00:23:06,746 more on that in a moment; to submit 9 problem sets, 428 00:23:06,986 --> 00:23:11,186 take two quizzes and ultimately design a final project. 429 00:23:11,486 --> 00:23:15,296 A word about grades-- you may in fact take this course pass-fail. 430 00:23:15,296 --> 00:23:19,076 In fact one of the frankly best things I ever did 431 00:23:19,076 --> 00:23:22,116 as an undergraduate was, perhaps fittingly, 432 00:23:22,116 --> 00:23:24,556 take this course pass-fail. 433 00:23:24,556 --> 00:23:27,896 I was an undergraduate here in 1995 as a freshman, 434 00:23:28,096 --> 00:23:30,816 I came in thinking I was going to major in government 435 00:23:30,996 --> 00:23:33,606 and sure enough I started off on the track; I'd like history, 436 00:23:33,606 --> 00:23:34,776 I'd like government, English, 437 00:23:34,776 --> 00:23:36,186 these kinds of things in high school. 438 00:23:36,386 --> 00:23:40,026 I knew from the relatively limited set of course offerings 439 00:23:40,026 --> 00:23:42,356 that my school had the things I felt I was good at 440 00:23:42,356 --> 00:23:44,156 and so I went off on the path. 441 00:23:44,156 --> 00:23:46,566 I was curious; I was even a user assistant at the time, 442 00:23:46,566 --> 00:23:48,486 I was certainly a geek at the time and 443 00:23:48,486 --> 00:23:52,266 yet I had no sense really of what actually went 444 00:23:52,266 --> 00:23:53,596 on in a classroom like this. 445 00:23:53,596 --> 00:23:55,746 In fact I used to glance in the window 446 00:23:55,746 --> 00:23:58,086 at the computer science classes that my high school had 447 00:23:58,086 --> 00:23:59,316 that some of my friends were taking, 448 00:23:59,606 --> 00:24:01,006 and they just weren't interesting, 449 00:24:01,006 --> 00:24:02,486 the problems they were working on were 450 00:24:02,486 --> 00:24:05,326 like adding some numbers together and moving a cursor 451 00:24:05,326 --> 00:24:07,916 around the screen-- it was incredibly underwhelming 452 00:24:07,916 --> 00:24:09,556 and it wasn't until I dived 453 00:24:09,556 --> 00:24:11,806 into this particular course sophomore year, 454 00:24:11,806 --> 00:24:14,486 having only gotten over the threshold of discomfort 455 00:24:14,646 --> 00:24:17,376 by filling out a little pink slip like this that said I'd 456 00:24:17,376 --> 00:24:19,096 like to enroll in this course pass-fail, 457 00:24:19,366 --> 00:24:21,726 but I honestly had the courage to venture 458 00:24:21,726 --> 00:24:23,566 out beyond my comfort zone. 459 00:24:23,566 --> 00:24:27,396 And five weeks less one day later I decided you know what 460 00:24:27,516 --> 00:24:30,646 this might actually be for me and I switched from pass-fail 461 00:24:31,306 --> 00:24:35,016 to letter graded status at that point in time. 462 00:24:35,326 --> 00:24:37,986 It's an unfortunate thing I think pedagogically 463 00:24:37,986 --> 00:24:40,356 at this school that there's really not this mindset, 464 00:24:40,386 --> 00:24:43,636 this mentality on campus that actually exploring new waters, 465 00:24:43,796 --> 00:24:45,616 perhaps by way of mechanisms 466 00:24:45,616 --> 00:24:48,886 like pass-fail is actually the norm; I think it's just not part 467 00:24:48,886 --> 00:24:51,556 of the culture here and I also think that there saying 468 00:24:51,876 --> 00:24:53,986 in a demographic like this there's perhaps this 469 00:24:54,206 --> 00:24:55,856 disinclination to say, 470 00:24:56,616 --> 00:24:59,136 especially when you need an instructor's signature I would 471 00:24:59,136 --> 00:25:00,796 like to take this course pass-fail, 472 00:25:00,996 --> 00:25:04,046 let's you think quite reasonably that your peers might think 473 00:25:04,276 --> 00:25:06,626 that maybe you're taking it pass-fail because you can't 474 00:25:06,766 --> 00:25:08,586 in fact cut it in a course like this. 475 00:25:08,586 --> 00:25:10,146 And this is absolutely not true; 476 00:25:10,406 --> 00:25:13,936 it's for the most part the entire freshman year 477 00:25:13,936 --> 00:25:16,116 for instance at MIT is taking pass-fail. 478 00:25:16,116 --> 00:25:18,996 You can similarly explore your sophomore year 479 00:25:18,996 --> 00:25:21,446 and Harvard thankfully does have this mechanism. 480 00:25:21,636 --> 00:25:23,266 And so ultimately one of the messages we'd 481 00:25:23,266 --> 00:25:26,406 like to send today is that if you are the type who's kind 482 00:25:26,406 --> 00:25:27,976 of on-the-fence don't think this is for you, 483 00:25:27,976 --> 00:25:31,006 worried about hurting your GPA or anything like that. 484 00:25:31,226 --> 00:25:33,716 Realize that there's this wonderful mechanism in place 485 00:25:33,716 --> 00:25:35,636 that allows you to put your toe in the water 486 00:25:35,746 --> 00:25:38,406 for several weeks no less and then get a sense, 487 00:25:38,406 --> 00:25:41,396 and then decide whether or not this is something for you. 488 00:25:41,396 --> 00:25:43,776 So you may take this course ultimately via pass-fail 489 00:25:43,776 --> 00:25:46,476 or letter grade and I am more than happy to chat with you 490 00:25:46,476 --> 00:25:49,466 about the implications and to sign any paper work 491 00:25:49,526 --> 00:25:52,006 such as the stack here that you might need. 492 00:25:52,006 --> 00:25:55,056 So what are you all like? 493 00:25:55,376 --> 00:25:58,646 If history is any indication 72% of the people 494 00:25:58,646 --> 00:26:02,006 in the theater have no prior programming experience; 495 00:26:02,166 --> 00:26:04,786 despite what you may think and despite the fact that some 496 00:26:04,786 --> 00:26:05,986 of you may very well be thinking, 497 00:26:06,226 --> 00:26:09,366 odds are I know the least about computers than anyone in here, 498 00:26:09,676 --> 00:26:11,436 I'm actually a little scared of my computer. 499 00:26:11,786 --> 00:26:13,956 There are lots of other people in this course 500 00:26:13,956 --> 00:26:15,716 and there have been lots of other people 501 00:26:15,716 --> 00:26:16,686 in this course like you. 502 00:26:17,336 --> 00:26:20,406 The chart you see here suggests that 72% 503 00:26:20,406 --> 00:26:23,226 of last year's students had zero prior computer 504 00:26:23,226 --> 00:26:24,246 science background. 505 00:26:24,476 --> 00:26:27,156 Moreover there really isn't a typical student in this course. 506 00:26:27,156 --> 00:26:28,806 We asked students as we will this year 507 00:26:28,996 --> 00:26:31,776 to describe themselves based on gut instinct early on, 508 00:26:32,016 --> 00:26:34,596 do you consider yourselves among those less comfortable 509 00:26:34,706 --> 00:26:37,546 with computers or just the mere idea of being in this class? 510 00:26:37,866 --> 00:26:39,486 Are you among those more comfortable, 511 00:26:39,486 --> 00:26:41,906 have you taken any computer science, were you programming 512 00:26:41,906 --> 00:26:44,406 at the age of 10 but you'd actually like to learn a bit 513 00:26:44,496 --> 00:26:48,086 about things you don't yet know and challenge yourself 514 00:26:48,126 --> 00:26:51,226 with new content or are you somewhere in between? 515 00:26:51,546 --> 00:26:54,296 And so the breakdown that we've had in past terms are just 516 00:26:54,296 --> 00:26:56,326 under half of the students describe themselves 517 00:26:56,326 --> 00:26:58,196 as among those less comfortable just 518 00:26:58,196 --> 00:27:00,656 over 10% among those more comfortable, 519 00:27:00,816 --> 00:27:03,906 and then with the remaining students are indeed somewhere 520 00:27:03,906 --> 00:27:04,456 in between. 521 00:27:04,626 --> 00:27:08,106 And what the course has done to accommodate these varying levels 522 00:27:08,106 --> 00:27:09,786 of background that come into this course, 523 00:27:10,076 --> 00:27:12,276 is we offer not only multiple tracks 524 00:27:12,556 --> 00:27:14,926 so to speak of sections, we'll see in a moment 525 00:27:14,926 --> 00:27:17,206 that we have different tracts for students less comfortable, 526 00:27:17,206 --> 00:27:19,746 more comfortable and somewhere in between, and particularly 527 00:27:19,746 --> 00:27:21,466 for those students more comfortable who are coming 528 00:27:21,466 --> 00:27:23,356 in with say an AP computer science background, 529 00:27:23,546 --> 00:27:26,236 may very well know some of the content on the syllabus but like 530 00:27:26,236 --> 00:27:27,466 to push themselves further. 531 00:27:27,736 --> 00:27:31,246 Do we offer what we dub packer editions of problem sets 532 00:27:31,246 --> 00:27:33,076 which extensively cover the same material 533 00:27:33,246 --> 00:27:35,196 but with a more technical sophistication, 534 00:27:35,196 --> 00:27:39,046 with more detail, and these are simply options that students 535 00:27:39,046 --> 00:27:41,516 in this course can elect as per the syllabus. 536 00:27:41,886 --> 00:27:44,666 So there are also an increasing number of women 537 00:27:44,666 --> 00:27:46,756 in computer science and particular this course 538 00:27:47,046 --> 00:27:48,526 which we are thrilled about. 539 00:27:48,526 --> 00:27:51,286 Over the past couple of years there have been record numbers 540 00:27:51,286 --> 00:27:53,476 of women enrolling in CS50 specifically 541 00:27:53,476 --> 00:27:56,566 up from single digits and 20% range years past; 542 00:27:56,906 --> 00:27:59,726 and this is wonderful because we absolutely think despite the 543 00:27:59,786 --> 00:28:02,796 faces you may see in high school classes, the faces you may see 544 00:28:02,796 --> 00:28:05,866 in industry and the press, it is absolutely a field 545 00:28:05,866 --> 00:28:08,846 that is equally accessible to men and women alike 546 00:28:08,946 --> 00:28:11,346 so it is 50-50 that we hope to see as a result 547 00:28:11,346 --> 00:28:13,566 of that reality before long. 548 00:28:13,566 --> 00:28:15,736 So what is it you actually do? 549 00:28:15,736 --> 00:28:19,026 As much as I might talk on stage twice a week it turns 550 00:28:19,026 --> 00:28:21,906 out that it's really by doing and really by diving in 551 00:28:21,906 --> 00:28:22,836 and getting your hands dirty 552 00:28:22,836 --> 00:28:25,626 that you really take away the course's lessons. 553 00:28:25,626 --> 00:28:29,016 Last year for the pieces that do vary year to year a bit, 554 00:28:29,286 --> 00:28:31,766 last year's first problem set challenged students 555 00:28:31,766 --> 00:28:34,236 to write their first or maybe second 556 00:28:34,236 --> 00:28:37,146 or third program using this environment called Scratch. 557 00:28:37,406 --> 00:28:41,096 And after just a few words on Scratch which we'll look 558 00:28:41,096 --> 00:28:43,516 at in more detail on Friday will you actually feel 559 00:28:43,516 --> 00:28:45,676 that you know what, this is actually very intuitive. 560 00:28:45,676 --> 00:28:48,696 Once you know what pieces to look for, what mental constructs 561 00:28:48,696 --> 00:28:50,696 to reach for, can you realize all right I want 562 00:28:50,696 --> 00:28:52,986 to make some dancing figures go back and forth, 563 00:28:52,986 --> 00:28:56,206 I need to loop this way and loop this way and check if I'm 564 00:28:56,206 --> 00:28:57,236 on the edge and so forth. 565 00:28:57,406 --> 00:28:58,616 You begin to realize that all 566 00:28:58,616 --> 00:29:01,696 of these big seemingly complicated pieces of software 567 00:29:01,696 --> 00:29:04,786 in websites that you use, if you just hone in on little pieces 568 00:29:04,786 --> 00:29:06,696 of them at a time and you realize oh I can do 569 00:29:06,696 --> 00:29:08,246 that and oh I can do that. 570 00:29:08,556 --> 00:29:10,936 And then really the fun begins when you realize all you have 571 00:29:10,936 --> 00:29:13,366 to do is now start wiring these ideas together; 572 00:29:13,536 --> 00:29:16,446 wiring these little bite size problems together and so 573 00:29:16,446 --> 00:29:18,206 in the end that actually make, per Tej's project, 574 00:29:18,246 --> 00:29:21,156 a really impressive whole. 575 00:29:22,036 --> 00:29:26,676 And for Problem Set 0, too, those of you might think Scratch kind 576 00:29:26,676 --> 00:29:30,076 of imploding since I was 6, well then we'll hand you some 577 00:29:30,076 --> 00:29:31,976 of these little logic boards which are a variety 578 00:29:31,976 --> 00:29:34,246 of real world sensors you can connect to your Mac or PC 579 00:29:34,246 --> 00:29:35,956 and push yourself a little further 580 00:29:35,956 --> 00:29:37,476 with interactions, with the real world. 581 00:29:37,686 --> 00:29:40,556 In problem set 1 last year we introduced students to C, 582 00:29:40,556 --> 00:29:42,336 this is the language we use for a good deal 583 00:29:42,336 --> 00:29:44,816 of the course before we transition it or it turns 584 00:29:44,816 --> 00:29:47,786 into a web program but you'll implement a number of problems 585 00:29:47,786 --> 00:29:49,076 that really get you comfortable 586 00:29:49,286 --> 00:29:52,496 in what's called the command line environment for lack 587 00:29:52,496 --> 00:29:54,276 of a more friendly sounding term; 588 00:29:54,576 --> 00:29:57,656 and an environment called Linux or UNEX 589 00:29:57,886 --> 00:30:00,946 and really this is not something that might be as foreign to you 590 00:30:00,946 --> 00:30:02,666 in a week as might be right now. 591 00:30:02,666 --> 00:30:04,976 We introduce throughout this semester real world 592 00:30:04,976 --> 00:30:06,016 problem domains. 593 00:30:06,016 --> 00:30:07,406 Last year we challenged students 594 00:30:07,406 --> 00:30:10,236 to implement their own encryptions ciphers that's 595 00:30:10,456 --> 00:30:13,946 perhaps a common need these days to want to scramble or encrypt, 596 00:30:13,946 --> 00:30:16,396 to secure your information; whether it's a credit card, 597 00:30:16,676 --> 00:30:19,396 whether it's instant messages, or e-mails; simply any kind 598 00:30:19,396 --> 00:30:21,166 of information you don't want people to see-- 599 00:30:21,296 --> 00:30:23,076 well we talk about how you yourselves 600 00:30:23,076 --> 00:30:26,796 in the second week can implement some of these so-called ciphers 601 00:30:26,796 --> 00:30:30,236 with which to protect your own privacy and security. 602 00:30:30,236 --> 00:30:33,106 The week after we implemented the so-called game of 15, 603 00:30:33,106 --> 00:30:34,036 this little party favor 604 00:30:34,036 --> 00:30:36,066 where you move the numbers up, down, left or right. 605 00:30:36,306 --> 00:30:38,536 In just a couple of weeks can you start implementing things 606 00:30:38,756 --> 00:30:41,406 that take input from users; and if you really want 607 00:30:41,406 --> 00:30:43,536 to push yourselves with that particular week can you 608 00:30:43,536 --> 00:30:45,316 implement what we dub God mode. 609 00:30:45,316 --> 00:30:47,306 You can play not against yourself; 610 00:30:47,566 --> 00:30:49,866 you can program the computer to play against yourself-- 611 00:30:49,866 --> 00:30:51,336 you can program the computer to play against you. 612 00:30:51,336 --> 00:30:53,046 And so that's a little something for those 613 00:30:53,046 --> 00:30:54,066 of you more comfortable. 614 00:30:54,066 --> 00:30:55,756 And then Sudoku we did last year 615 00:30:55,986 --> 00:30:57,616 where it actually becomes a little more interesting 616 00:30:57,616 --> 00:31:00,156 where we start providing students not with a blank slate, 617 00:31:00,306 --> 00:31:02,436 but with some distribution code. 618 00:31:02,436 --> 00:31:04,916 We hand you a bunch of programming code that we wrote 619 00:31:04,996 --> 00:31:07,066 because this is very much the norm in the real world. 620 00:31:07,066 --> 00:31:09,366 You're not going to start for the rest of your life 621 00:31:09,366 --> 00:31:11,336 if you ever need to solve a problem with a computer 622 00:31:11,576 --> 00:31:13,516 from scratch, odds are you're going to reach 623 00:31:13,576 --> 00:31:17,206 for some off the shelf packages or libraries or tools 624 00:31:17,346 --> 00:31:20,416 that other people wrote so that people like us don't have 625 00:31:20,456 --> 00:31:22,406 to reinvent the wheel again and again. 626 00:31:22,406 --> 00:31:23,376 What do I mean by wheel? 627 00:31:23,576 --> 00:31:25,446 If you want to get some input from the user, 628 00:31:25,656 --> 00:31:28,586 my God I don't want to have to program it to low level zero 629 00:31:28,586 --> 00:31:30,866 and 1 just to get keys from the keyboard; 630 00:31:30,866 --> 00:31:33,156 please let there have been someone who does that for me 631 00:31:33,406 --> 00:31:36,216 and indeed there are an increasingly sophisticated 632 00:31:36,216 --> 00:31:38,156 options that you can pull off the shelf. 633 00:31:38,156 --> 00:31:42,406 In problem set 5, last year I took a stroll around campus 634 00:31:42,406 --> 00:31:44,566 with one of the teaching fellows with his digital camera, 635 00:31:44,836 --> 00:31:47,176 we shot photographs of identifiable 636 00:31:47,176 --> 00:31:49,766 but non-obvious spots on campus and then 637 00:31:49,766 --> 00:31:51,066 like an idiot I always seem 638 00:31:51,066 --> 00:31:53,846 to erase my compact flashcard accidentally. 639 00:31:54,066 --> 00:31:55,906 But no matter, I spent a year 640 00:31:56,346 --> 00:31:58,976 in graduate school doing forensic research and working 641 00:31:58,976 --> 00:32:01,486 for the local Middlesex DA's office where I learned how 642 00:32:01,486 --> 00:32:03,246 to make a so-called forensic image 643 00:32:03,286 --> 00:32:05,676 of a digital camera's media card. 644 00:32:05,676 --> 00:32:09,426 And so we do this very much real world, we grab all of the 0's 645 00:32:09,426 --> 00:32:13,746 and 1's that have been erased or mangled somehow by my mistake, 646 00:32:14,016 --> 00:32:16,886 I then hand that to every student in the class a file 647 00:32:17,086 --> 00:32:19,586 that contains all of those 0's and 1's 648 00:32:19,586 --> 00:32:22,496 and they're then challenged to recover those jpegs 649 00:32:22,756 --> 00:32:26,296 by writing a program from the start of those 0's and 1's 650 00:32:26,366 --> 00:32:28,816 to the end of them, looking for the patterns that it turns 651 00:32:28,816 --> 00:32:32,666 out identify these things all of you know as jpegs or photographs 652 00:32:32,666 --> 00:32:35,476 that you probably everyday upload or look at on sites 653 00:32:35,536 --> 00:32:36,836 like Facebook and the like. 654 00:32:37,046 --> 00:32:40,506 It turns out they're relatively simple to find even 655 00:32:40,506 --> 00:32:42,316 when they've been deleted whether accidentally 656 00:32:42,316 --> 00:32:44,346 or in some cases intentionally-- 657 00:32:45,046 --> 00:32:47,486 that too is part of the job undeleting things 658 00:32:47,486 --> 00:32:48,446 that people had deleted. 659 00:32:48,796 --> 00:32:52,436 And then we hand you 140,000 English words in the form 660 00:32:52,436 --> 00:32:56,666 of a big text file much like our aspiring pre-med students 661 00:32:56,666 --> 00:32:58,326 in recent months, and we challenge you 662 00:32:58,326 --> 00:33:01,216 to implement the fastest spellchecker possible. 663 00:33:01,416 --> 00:33:05,686 We challenge you to use little RAM, memory as few CPU cycles 664 00:33:05,726 --> 00:33:08,106 to write your program as fast as possible 665 00:33:08,256 --> 00:33:10,426 and the funny thing here is, is that this tends 666 00:33:10,426 --> 00:33:11,596 to be historically the piece 667 00:33:11,596 --> 00:33:13,796 that students put the most time into; 668 00:33:14,006 --> 00:33:16,306 not at all because it requires the most time; 669 00:33:16,306 --> 00:33:18,736 not at all because it's the hardest or anything like that, 670 00:33:19,006 --> 00:33:22,246 but because we add on an often basis those sufficiently 671 00:33:22,246 --> 00:33:24,756 comfortable with the idea of displaying their name 672 00:33:24,756 --> 00:33:26,446 on the course's website you can choose 673 00:33:26,446 --> 00:33:29,786 to show your running time; show the amount of RAM you're using 674 00:33:30,046 --> 00:33:31,436 on the course's homepage, 675 00:33:31,586 --> 00:33:34,626 and it's this fascinating pedagogical motivational tool 676 00:33:34,626 --> 00:33:35,316 where you do this. 677 00:33:35,556 --> 00:33:37,706 You then go to dinner, you come back and you realize 678 00:33:37,706 --> 00:33:40,386 that your roommate has now vested you by five seconds 679 00:33:40,746 --> 00:33:43,186 and three hours later you've inched ahead again 680 00:33:43,186 --> 00:33:46,056 so it's a wonderfully motivational tool; 681 00:33:46,696 --> 00:33:50,626 and speaks to just how addictive frankly this stuff was 682 00:33:50,626 --> 00:33:51,636 and that too for me. 683 00:33:51,756 --> 00:33:53,966 And this may or may not be the case for you yourself, 684 00:33:54,256 --> 00:33:56,466 but one of the realizations I had in college 685 00:33:56,466 --> 00:33:59,836 when venturing beyond my comfort zone engulfed toward these 686 00:33:59,836 --> 00:34:02,546 waters of CS was wow like there's no cliche. 687 00:34:02,726 --> 00:34:05,776 Like homework for me at the time was actually fun 688 00:34:05,816 --> 00:34:07,516 and there is some addictive about this; 689 00:34:07,516 --> 00:34:13,036 and I even asked Tej during last year's final exam period. 690 00:34:13,286 --> 00:34:15,806 And then toward the end of the semester do we transition away 691 00:34:15,806 --> 00:34:19,036 from this lower level language known as C and certainly Scratch 692 00:34:19,336 --> 00:34:20,656 to things more familiar. 693 00:34:20,866 --> 00:34:23,386 Towards the end of the semester do we introduce what languages 694 00:34:23,386 --> 00:34:28,176 like PHP and SQL, HTML, CSS, to varying degrees, 695 00:34:28,436 --> 00:34:31,616 but with them can you implement the same kinds of ideas 696 00:34:31,616 --> 00:34:34,526 that you might have in your mind in the context of a web page. 697 00:34:34,526 --> 00:34:35,806 And increasingly that is 698 00:34:35,806 --> 00:34:38,256 where the human computer interaction is, 699 00:34:38,466 --> 00:34:40,736 and so will you be empowered by terms and not to just 700 00:34:40,736 --> 00:34:43,876 to make a website per se but to make an application, 701 00:34:43,956 --> 00:34:45,076 something that's of interest to you, 702 00:34:45,076 --> 00:34:46,156 something that solves problems, 703 00:34:46,376 --> 00:34:48,786 something that lets you tell someone 704 00:34:48,786 --> 00:34:50,726 through the most electronic means possible 705 00:34:50,726 --> 00:34:53,916 that you saw them somewhere on campus. 706 00:34:53,916 --> 00:34:57,056 In the case of last year we did hand students some code 707 00:34:57,056 --> 00:34:59,446 with which they could write programs that talked 708 00:34:59,446 --> 00:35:02,746 to Yahoo Finance, finance.yahoo.com, free website. 709 00:35:02,966 --> 00:35:04,786 Turns out they make stock data and the 710 00:35:04,786 --> 00:35:07,646 like available essentially via text files 711 00:35:07,646 --> 00:35:11,186 or via a simple API application programming interface 712 00:35:11,486 --> 00:35:12,846 which will be one of the themes of the course. 713 00:35:13,036 --> 00:35:16,036 And with this data, where students were able 714 00:35:16,036 --> 00:35:19,036 to implement last year their own E-trade-like website; 715 00:35:19,216 --> 00:35:21,996 whereby you have accounts and you log in your hand age 716 00:35:21,996 --> 00:35:24,446 of your users 10,000 virtual dollars 717 00:35:24,446 --> 00:35:27,796 and with them can they get stock quotes, by stocks, sell stocks 718 00:35:27,796 --> 00:35:29,796 and the like, all of this accomplished just 719 00:35:29,796 --> 00:35:31,506 after a few weeks time. 720 00:35:31,506 --> 00:35:33,916 And last year to did we hand students Google maps, 721 00:35:33,916 --> 00:35:37,076 Google news, asked them to mash those two very familiar real 722 00:35:37,076 --> 00:35:39,106 world products together so that they had a map 723 00:35:39,246 --> 00:35:41,566 of the United States, little markers sprinkled throughout, 724 00:35:41,776 --> 00:35:43,296 that indicated exactly 725 00:35:43,296 --> 00:35:46,746 where there were current events going on. 726 00:35:46,746 --> 00:35:49,986 So how do we get you from for many of you zero 727 00:35:49,986 --> 00:35:52,546 to 60 miles per hour after just 11 weeks, 728 00:35:52,806 --> 00:35:54,876 well like many courses here is the course structured 729 00:35:54,876 --> 00:35:57,286 around not only lectures for conceptual introductions, 730 00:35:57,526 --> 00:35:59,736 but sections, office hours and walkthroughs. 731 00:35:59,956 --> 00:36:03,256 So in sections where you have the opportunity to work 732 00:36:03,256 --> 00:36:05,646 in smaller environments with one of the teaching fellows, 733 00:36:06,496 --> 00:36:09,166 in office hours we have an opportunity to work one on one, 734 00:36:09,166 --> 00:36:11,416 hands-on in the computer lab or else we're on campus 735 00:36:11,416 --> 00:36:13,796 and really get personalized attention when it comes 736 00:36:13,796 --> 00:36:15,506 to diving into these problems. 737 00:36:15,896 --> 00:36:18,706 And similarly, particularly for those less comfortable, 738 00:36:18,706 --> 00:36:21,586 do we offer prior to the start of each week for a new piece 739 00:36:21,586 --> 00:36:23,926 at what we dub a walkthrough whereby one 740 00:36:23,926 --> 00:36:25,896 of the teaching fellows will literally start 741 00:36:25,896 --> 00:36:28,626 on the first page, give you a mental framework 742 00:36:28,626 --> 00:36:31,156 for the week's problems and talk about the ideas that it covers, 743 00:36:31,376 --> 00:36:33,986 and then walk through the piece set so that you have a roadmap 744 00:36:34,106 --> 00:36:35,416 of sorts that you can follow. 745 00:36:35,416 --> 00:36:37,756 So that you're not just handed something that's entirely new 746 00:36:37,756 --> 00:36:40,376 to you with no idea which direction to go, 747 00:36:40,486 --> 00:36:44,046 we actually do set you off on an appropriate path. 748 00:36:44,046 --> 00:36:46,306 And towards that end to give you a sense of the size 749 00:36:46,306 --> 00:36:48,346 of the support structure in place for this course, 750 00:36:48,776 --> 00:36:52,166 this is the size at the moment of CS50's staff inclusive 751 00:36:52,246 --> 00:36:54,616 of teaching fellows, course assistants, myself, 752 00:36:54,906 --> 00:36:55,926 as well as folks who help 753 00:36:55,926 --> 00:36:57,466 with our video production and the like. 754 00:36:57,686 --> 00:37:02,496 Course assistants as we use the jargon are alumni of CS50 755 00:37:02,586 --> 00:37:04,386 who return to the course for a couple 756 00:37:04,386 --> 00:37:07,346 of hours a week having taken it in prior years, to help you, 757 00:37:07,346 --> 00:37:10,286 the newest batch of students, one on one with office hours, 758 00:37:10,286 --> 00:37:13,016 with problem sets; and similarly do the CS function 759 00:37:13,266 --> 00:37:14,886 as they might in many courses. 760 00:37:15,126 --> 00:37:18,006 Office hours tend to happen in this very beautiful place, 761 00:37:18,006 --> 00:37:20,506 at least beautiful according to this picture, never quite feels 762 00:37:20,506 --> 00:37:23,106 like that when you're walking in to it; but we're very excited 763 00:37:23,106 --> 00:37:25,336 to say that one of the directions 764 00:37:25,336 --> 00:37:27,316 in which the Harvard School of Engineering 765 00:37:27,316 --> 00:37:28,676 which is a relatively new entity 766 00:37:28,676 --> 00:37:32,246 on campus has been putting together this summer 767 00:37:32,246 --> 00:37:37,666 with four undergraduates on campus social and learning 768 00:37:37,666 --> 00:37:40,116 and teaching space; whereby the goal is 769 00:37:40,116 --> 00:37:42,016 to actually provide students like yourselves 770 00:37:42,016 --> 00:37:44,396 with an opportunity to interact with each other whether it's 771 00:37:44,396 --> 00:37:49,376 to work on P sets, talk, relax, and as you'll see game. 772 00:37:49,376 --> 00:37:50,886 It turns out that this space 773 00:37:50,886 --> 00:37:54,086 to which you'll have access throughout the year dubbed the 774 00:37:54,086 --> 00:37:56,636 lounge, has not only white boards and screens 775 00:37:56,636 --> 00:38:00,596 for teaching purposes; we may have also slipped in an Xbox, 776 00:38:00,596 --> 00:38:01,996 a Wii and the PlayStation 777 00:38:02,416 --> 00:38:06,726 which actually does help make homework fun. 778 00:38:06,726 --> 00:38:08,916 Thanks to some friends there's a foosball table, 779 00:38:08,916 --> 00:38:09,896 there's a candy machine 780 00:38:09,896 --> 00:38:11,466 and there's also a cat in the ceiling. 781 00:38:12,096 --> 00:38:16,486 So the so-called lounge what you'll be able to find 782 00:38:16,486 --> 00:38:18,156 in just a week or so is timed with the first 783 00:38:18,156 --> 00:38:21,576 of the office hours if you so choose to join us for them. 784 00:38:21,836 --> 00:38:24,786 Also one of the most useful resources you'll find is the 785 00:38:24,786 --> 00:38:27,466 course's website; where not only will the obvious be posted 786 00:38:27,466 --> 00:38:30,256 like handouts and such, pests in the syllabus, 787 00:38:30,496 --> 00:38:32,996 but there will also be a variety of tools that you can turn 788 00:38:32,996 --> 00:38:33,686 to over the course 789 00:38:33,686 --> 00:38:36,336 of the semester including our own videos. 790 00:38:36,336 --> 00:38:37,946 As you can tell from the cameras, the course is 791 00:38:37,946 --> 00:38:40,696 in fact filmed for reasons of distance education 792 00:38:40,696 --> 00:38:43,696 and your benefit for review; we've been working 793 00:38:43,846 --> 00:38:47,266 on this past summer what we dubbed cs50.tv 794 00:38:47,266 --> 00:38:49,866 which is our own delivery mechanism for these videos. 795 00:38:49,866 --> 00:38:51,746 Though this is always a bit awkward since you're 796 00:38:51,746 --> 00:38:54,416 about to see myself seeing myself, 797 00:38:54,816 --> 00:38:57,786 we have put together this new 798 00:38:57,786 --> 00:39:01,556 and improved user interface this year whereby 799 00:39:01,726 --> 00:39:05,046 after a few days time will each lecture be available via the 800 00:39:05,046 --> 00:39:07,366 website, and which you'll notice too flanking it 801 00:39:07,366 --> 00:39:12,766 on the right hand side will be a complete English transcript 802 00:39:12,766 --> 00:39:16,526 of everything that comes up during lecture. 803 00:39:16,526 --> 00:39:18,286 And so being computer scientists, 804 00:39:18,286 --> 00:39:21,426 being programmers having taken CS50 that we read a little code 805 00:39:21,606 --> 00:39:24,006 that synchronizes the words that are highlighted in the screen 806 00:39:24,006 --> 00:39:26,636 with the words that though on this very dark screen are coming 807 00:39:26,636 --> 00:39:27,796 out of my mouth in your hands; 808 00:39:28,026 --> 00:39:30,796 we also thought it would be a little fun just partly 809 00:39:30,796 --> 00:39:35,246 because we can, and partly for accessibility purposes for folks 810 00:39:35,246 --> 00:39:38,456 who might tune into the course's open courseware material thanks 811 00:39:38,456 --> 00:39:42,466 to Google translate, do I now speak nearly fluent Spanish. 812 00:39:42,496 --> 00:39:44,316 If you'd like to see me subtitled 813 00:39:44,316 --> 00:39:48,236 in Spanish can you actually watch CS50 this year in Spanish 814 00:39:48,236 --> 00:39:50,666 and soon two dozen languages? 815 00:39:50,996 --> 00:39:53,906 It's imperfect, though the English is quite spot on, 816 00:39:53,906 --> 00:39:55,866 I call myself during this lecture a couple 817 00:39:55,866 --> 00:39:57,576 of times a major government 818 00:39:57,916 --> 00:40:01,566 because gov major didn't quite translate very perfectly. 819 00:40:02,376 --> 00:40:07,876 So what can you expect in terms of the preparation 820 00:40:07,876 --> 00:40:10,496 and the fundamentals that will empower you ultimately 821 00:40:10,496 --> 00:40:12,046 to tackle projects like these? 822 00:40:12,266 --> 00:40:14,866 Well this Friday when we start our lucky computer science 823 00:40:14,866 --> 00:40:18,806 itself and introduce Scratch, the programming language 824 00:40:18,806 --> 00:40:20,686 in an environment we looked at, but also some 825 00:40:20,686 --> 00:40:22,686 of the fundamentals that we'll lace throughout the course. 826 00:40:22,916 --> 00:40:26,866 In week 1 computer scientists for those unindoctrinated yet, 827 00:40:27,086 --> 00:40:30,586 start counting from 0 typically, you may notice the astute 828 00:40:30,626 --> 00:40:32,696 that when we did our self-counting exercise I had 829 00:40:32,696 --> 00:40:34,356 to number the steps from 1 to 4; 830 00:40:34,466 --> 00:40:37,136 it's only because Keynote does not actually let you start at 0 831 00:40:37,136 --> 00:40:39,206 which is perhaps the norm for normal people anyway; 832 00:40:39,506 --> 00:40:42,686 but with Week 1 we'll look at C and some of the basics 833 00:40:42,686 --> 00:40:44,446 of computer science as they relate 834 00:40:44,446 --> 00:40:46,266 to actually manipulating a computer. 835 00:40:46,466 --> 00:40:50,096 In Week 2 we'll look at things like cryptography and functions 836 00:40:50,096 --> 00:40:53,606 and the tools that by which you begin to assemble solutions 837 00:40:53,606 --> 00:40:56,646 to problems; in Week 3 we'll introduce what are generally 838 00:40:56,646 --> 00:40:59,226 known as algorithms and data structures; 839 00:40:59,226 --> 00:41:02,476 mechanisms by which you can solve problems more efficiently, 840 00:41:02,476 --> 00:41:03,376 effectively. 841 00:41:03,656 --> 00:41:08,196 What we'll introduce in Week 4 additional lower level details 842 00:41:08,196 --> 00:41:10,406 which really interesting about a computer is 843 00:41:10,406 --> 00:41:13,196 that there are these very familiar things like RAM 844 00:41:13,196 --> 00:41:16,416 and disk space and the like, but it terms out with just a modicum 845 00:41:16,416 --> 00:41:19,296 of experience with manipulating the computer by way 846 00:41:19,296 --> 00:41:22,286 of programming, can you actually now use that memory 847 00:41:22,426 --> 00:41:25,956 as you see fit, put 0's and 1's in data wherever you see fit; 848 00:41:25,956 --> 00:41:29,296 and in the case of the forensic problem set even extract it 849 00:41:29,296 --> 00:41:31,836 as someone perhaps did not want you to find. 850 00:41:32,016 --> 00:41:35,446 For those perhaps familiar with some 851 00:41:35,446 --> 00:41:38,056 of the jargon do we introduce what we call link lists 852 00:41:38,056 --> 00:41:39,386 and hash tables and tries, 853 00:41:39,386 --> 00:41:42,126 increasingly sophisticated data structures, that allow us 854 00:41:42,126 --> 00:41:45,746 to solve problems that are much bigger and much more interesting 855 00:41:45,926 --> 00:41:48,286 than the very familiar one that we started with here. 856 00:41:48,486 --> 00:41:51,216 We transition to actually real world applications later 857 00:41:51,216 --> 00:41:54,456 on like a compression-- how do you take a huge amount of data 858 00:41:54,676 --> 00:41:57,196 and actually whittle it down into something more manageable; 859 00:41:57,196 --> 00:41:59,136 something that uses less of your disk space. 860 00:41:59,446 --> 00:42:01,766 We then look toward the end of the semester at these languages 861 00:42:01,766 --> 00:42:03,916 that you've might have heard of now, the acronyms therefore 862 00:42:04,146 --> 00:42:08,966 like HTML and HTTP, PHP and SQL and the like. 863 00:42:08,966 --> 00:42:10,246 And then after that we look 864 00:42:10,246 --> 00:42:12,436 at what's increasingly trendy and compelling. 865 00:42:12,436 --> 00:42:14,016 A lot of the features you yourself use 866 00:42:14,016 --> 00:42:16,356 in Facebook these days are very much dynamic. 867 00:42:16,406 --> 00:42:17,736 Things are moving and changing 868 00:42:17,816 --> 00:42:19,546 without the whole page reloading; 869 00:42:19,546 --> 00:42:21,276 when we looked towards the end of the semester 870 00:42:21,276 --> 00:42:23,436 at implementing these increasingly dynamic, 871 00:42:24,016 --> 00:42:28,946 Ajax enabled websites much like the ones we all use today. 872 00:42:28,946 --> 00:42:32,766 But truly the climax of this course is what we've dubbed the 873 00:42:32,766 --> 00:42:33,706 CS50 Fair. 874 00:42:33,706 --> 00:42:35,966 Towards semester's end you will have the opportunity 875 00:42:36,316 --> 00:42:41,156 to choose a project to work on, choose a project 876 00:42:41,316 --> 00:42:45,306 that is entirely of your own choice to execute. 877 00:42:45,676 --> 00:42:49,616 And waiting for you across the street ultimately will be a 878 00:42:49,616 --> 00:42:52,486 whole lot of balloons, a whole lot of candy, family, friends. 879 00:42:52,706 --> 00:42:55,956 Last year's event was attended by 1,000 plus attendees 880 00:42:55,956 --> 00:42:59,326 and it will be an opportunity for you to really mingle 881 00:42:59,506 --> 00:43:01,586 and to conclude the course with a look at your 882 00:43:01,726 --> 00:43:03,206 and other friends' projects. 883 00:43:03,256 --> 00:43:08,936 But also this year you will see a whole variety of achievements. 884 00:43:08,936 --> 00:43:10,496 So though you'll find yourself playing 885 00:43:10,496 --> 00:43:14,776 with Scratch toward term's start, playing with C 886 00:43:14,776 --> 00:43:17,056 and similar languages toward term's middle, 887 00:43:17,296 --> 00:43:20,166 you'll see last year that when you end up producing yourselves 888 00:43:20,166 --> 00:43:23,766 and seeing ads for CS50 Fair are all types of problems 889 00:43:23,766 --> 00:43:25,096 and applications being solved. 890 00:43:25,096 --> 00:43:28,046 This quick list here suggests last year's students implemented 891 00:43:28,046 --> 00:43:31,196 Android apps for their phones, Facebook apps, applications 892 00:43:31,196 --> 00:43:33,426 for iPhone and iPods; applications for Mac OS; 893 00:43:33,426 --> 00:43:34,936 things involving SOS and the 894 00:43:35,426 --> 00:43:40,266 like whereby you can actually send text messages 895 00:43:40,466 --> 00:43:43,176 to a program you wrote and get back a response, 896 00:43:43,206 --> 00:43:44,876 much like you can for those familiar 897 00:43:45,116 --> 00:43:48,256 with this other CS50 App called Shuttleboy. 898 00:43:48,256 --> 00:43:52,766 The images you'll see are a little something like this-- 899 00:43:52,766 --> 00:43:56,396 absolutely mesmerizing what will be on each of your screens 900 00:43:56,396 --> 00:43:59,886 and oh there is also some popcorn toward term's end. 901 00:44:00,156 --> 00:44:03,006 But we will also introduce towards the end of this semester 902 00:44:03,006 --> 00:44:08,726 in an effort to really make it okay to stay up all night, 903 00:44:08,726 --> 00:44:10,726 will be the first ever CS50 hack-a-thon. 904 00:44:10,976 --> 00:44:13,846 This will be optional, given the late hour, 905 00:44:14,086 --> 00:44:16,916 this will be probably bean innovation I will completely 906 00:44:16,916 --> 00:44:21,756 regret to the night before; but what we will do is model this 907 00:44:21,756 --> 00:44:25,216 after an event that happens at MIT quite often, 908 00:44:25,216 --> 00:44:26,676 at Facebook quite often; 909 00:44:26,886 --> 00:44:29,516 at 9 p.m. there will be served some pizza; 910 00:44:29,516 --> 00:44:32,146 at 2 a.m. there will be Chinese food 911 00:44:32,326 --> 00:44:33,556 and for anyone left standing 912 00:44:33,556 --> 00:44:36,406 at 6 a.m. there will be a field trip to IHOP in the square. 913 00:44:36,706 --> 00:44:38,446 What is the goal of these 10 hours? 914 00:44:38,626 --> 00:44:40,576 Well partly this is just for fun-- 915 00:44:40,686 --> 00:44:44,066 this is what computer people sometimes do, intentionally 916 00:44:44,066 --> 00:44:47,556 or unintentionally but as also will see a really nice way 917 00:44:47,556 --> 00:44:49,656 to culminate the semester and frankly carve 918 00:44:49,656 --> 00:44:52,096 out a 10 hour block where you can bite off your final 919 00:44:52,096 --> 00:44:55,086 project's implementation surrounded by friends 920 00:44:55,086 --> 00:44:55,906 and the course's staff. 921 00:44:56,296 --> 00:44:58,826 But if you're the type who prefers to be bed by midnight, 922 00:44:59,036 --> 00:45:00,966 that's quite okay too; there'll be plenty of time 923 00:45:00,966 --> 00:45:02,566 to work on the project. 924 00:45:02,806 --> 00:45:05,946 Why don't we go ahead for those of you who need a bit 925 00:45:05,946 --> 00:45:08,876 of a rest bit, let's take a two minute break and we'll resume 926 00:45:08,876 --> 00:45:10,976 with just some final thoughts on 50. 927 00:45:11,516 --> 00:45:15,636 [ Break ] 928 00:45:16,136 --> 00:45:21,006 >> We are back so a quote that's been on CS50's website 929 00:45:21,006 --> 00:45:22,256 for several years now, 930 00:45:22,256 --> 00:45:24,126 long enough that we're not actually not sure 931 00:45:24,126 --> 00:45:26,796 who first said it; but that really captures we all think the 932 00:45:26,796 --> 00:45:29,276 spirit of this course is this one here, "Demanding 933 00:45:29,276 --> 00:45:33,116 but definitely doable, social but educational, a focused topic 934 00:45:33,116 --> 00:45:34,676 but broadly applicable skills, 935 00:45:34,736 --> 00:45:37,426 CS50 is the quintessential Harvard course." 936 00:45:37,426 --> 00:45:40,816 Every one of you standing behind me and this is only like half 937 00:45:40,816 --> 00:45:44,756 of them, have taken this course or one like it and are here 938 00:45:44,976 --> 00:45:47,506 as your support for the entire semester. 939 00:45:47,966 --> 00:45:50,856 In particular let me draw your attention to these two folks 940 00:45:50,856 --> 00:45:52,666 on the end who's probably come a little close 941 00:45:52,666 --> 00:45:54,276 to my microphone to say hello. 942 00:45:54,626 --> 00:45:58,766 Cansu Aydede and Yuhki Yamashita, the course's head teaching fellows [applause] 943 00:46:01,026 --> 00:46:03,686 and our leaders from Mather House 944 00:46:03,686 --> 00:46:06,226 and Eliot House respectively would 945 00:46:06,226 --> 00:46:09,606 like to say a little hello to you. 946 00:46:12,626 --> 00:46:16,046 >> Hello, welcome to CS50. 947 00:46:16,916 --> 00:46:18,856 Well I've been taking this course or I've been part 948 00:46:18,856 --> 00:46:21,176 of this course for the last three years so every years 949 00:46:21,176 --> 00:46:22,566 at Harvard I've been part of CS50 950 00:46:22,606 --> 00:46:27,236 and it's a really special class or organization 951 00:46:27,236 --> 00:46:28,696 to be a part of-- really a family 952 00:46:28,696 --> 00:46:30,586 and I think Cansu will talk a little bit 953 00:46:30,586 --> 00:46:32,316 about that. 954 00:46:34,116 --> 00:46:38,446 But yeah we're all excited to have you here 955 00:46:38,446 --> 00:46:42,046 and we have all sorts of things planned outside of problem sets 956 00:46:42,046 --> 00:46:44,056 and we have the Fair and everything 957 00:46:44,056 --> 00:46:45,756 that David has been talking 958 00:46:45,756 --> 00:46:49,426 about so we're really excited to start so. 959 00:46:49,676 --> 00:46:53,346 >> Thanks Yuhki, so CS50 is a family. 960 00:46:54,196 --> 00:46:55,606 This is what I'm supposed to tell you guys 961 00:46:55,606 --> 00:46:57,556 and we're all here to help you out. 962 00:46:57,556 --> 00:47:01,086 I am a senior in Eliot House 963 00:47:01,086 --> 00:47:04,726 and this is my fourth year getting involved with CS50 964 00:47:04,726 --> 00:47:07,656 and that's the reason why a lot of CS 965 00:47:07,656 --> 00:47:11,086 and everybody else comes back on this stage 966 00:47:11,086 --> 00:47:15,386 because we all love CS50 and we all love to be a part 967 00:47:15,386 --> 00:47:18,156 of this family again; so welcome to the family. 968 00:47:18,156 --> 00:47:20,346 And if you have any questions we're here for you. 969 00:47:20,346 --> 00:47:21,486 >> David: So we're here for you 970 00:47:22,086 --> 00:47:23,976 and we asked last year's students 971 00:47:24,006 --> 00:47:28,136 for some choice words we could offer to this year's students. 972 00:47:28,246 --> 00:47:29,476 There's of course the queue guy 973 00:47:29,476 --> 00:47:31,016 but we survey students throughout the term 974 00:47:31,016 --> 00:47:34,566 and we asked them a matter of fact what should we communicate 975 00:47:34,736 --> 00:47:36,346 to this semester's student body. 976 00:47:36,566 --> 00:47:39,806 Perhaps a mistake with some of the answers we got but one 977 00:47:39,806 --> 00:47:41,576 of our choice favorites was this one 978 00:47:41,576 --> 00:47:44,916 and it's actually fairly worth drawing one's attention to 979 00:47:44,916 --> 00:47:46,776 and that's this: I planned on taking the class 980 00:47:46,776 --> 00:47:48,976 as a freshman then convinced myself otherwise 981 00:47:48,976 --> 00:47:51,136 because I couldn't fit it into my workload. 982 00:47:51,386 --> 00:47:54,216 Same story for sophomore, same story for junior year, 983 00:47:54,286 --> 00:47:55,906 I finally took it senior year 984 00:47:56,006 --> 00:47:58,716 because they wouldn't get another chance even though it 985 00:47:58,746 --> 00:48:01,126 still doesn't fit in the workload ha ha. 986 00:48:01,806 --> 00:48:05,056 So I pulled this one out of our archives 987 00:48:05,126 --> 00:48:07,646 because of precisely that reason. 988 00:48:07,646 --> 00:48:10,126 It's very easy to get caught up in one's own studies here; 989 00:48:10,126 --> 00:48:13,496 and even I freshman year, dove into a world very much familiar 990 00:48:13,496 --> 00:48:16,556 to me-- a world that I did like but I just didn't realize 991 00:48:16,556 --> 00:48:17,926 that there were in fact worlds 992 00:48:17,926 --> 00:48:23,106 that I loved well beyond my domain of familiarity. 993 00:48:23,356 --> 00:48:25,956 In a few moments we will adjourn to the transept 994 00:48:26,196 --> 00:48:27,996 where cake happens to await. 995 00:48:28,056 --> 00:48:30,656 For those who don't know what this cake means-- 996 00:48:30,656 --> 00:48:34,786 fix this in post production. 997 00:48:34,986 --> 00:48:39,346 In a moment we will adjoin to the transept where cake awaits 998 00:48:39,346 --> 00:48:41,726 and in just a few quotes will you actually see a picture 999 00:48:41,726 --> 00:48:45,306 of said cake, but we thought we'd paw off a few quotes 1000 00:48:45,306 --> 00:48:47,816 who tend to have appeared on campus 1001 00:48:47,816 --> 00:48:49,536 at some websites familiar to you. 1002 00:48:49,536 --> 00:48:51,416 This one was among our favorite-- 1003 00:48:51,706 --> 00:48:54,746 "I was you at the CS50 Fair; I went to your station 1004 00:48:54,746 --> 00:48:56,996 to see your program, you were my best friend; 1005 00:48:56,996 --> 00:48:58,386 but when our hands touched 1006 00:48:58,386 --> 00:49:00,336 as you handed me a Smiley face sticker, 1007 00:49:00,886 --> 00:49:02,576 my heart skipped a beat. 1008 00:49:03,246 --> 00:49:05,266 There's a lot of love in CS50." 1009 00:49:06,136 --> 00:49:09,456 Some folks on this particular website are a little more 1010 00:49:09,456 --> 00:49:10,106 to the point. 1011 00:49:10,396 --> 00:49:13,306 "I saw you at the CS50 Fair; you were with your friends, 1012 00:49:14,146 --> 00:49:16,666 wearing a tight white polo looking hawt." 1013 00:49:17,586 --> 00:49:22,066 And this one too, "I saw you walking around the CS50 Fair 1014 00:49:22,066 --> 00:49:23,906 with a name tag that said you were in the class. 1015 00:49:24,386 --> 00:49:25,806 You were smart and adorable 1016 00:49:26,066 --> 00:49:31,506 and all this time I assumed you were dumb and adorable. 1017 00:49:31,656 --> 00:49:33,036 You just became so much hotter." 1018 00:49:35,196 --> 00:49:38,426 So in a moment a cake much like this awaits. 1019 00:49:38,426 --> 00:49:40,456 If you don't know why you're about to eat cake 1020 00:49:40,456 --> 00:49:42,886 like that you will soon, but you know this. 1021 00:49:43,296 --> 00:49:47,296 My path in life was fundamentally altered 1022 00:49:47,466 --> 00:49:49,726 by just a handful of courses at this place 1023 00:49:49,966 --> 00:49:51,876 and this was in fact one of them. 1024 00:49:52,066 --> 00:49:55,586 There will in fact never be a good time to try something new, 1025 00:49:55,586 --> 00:49:58,296 and there will actually never be a semester 1026 00:49:58,466 --> 00:50:00,876 where you do have that more time. 1027 00:50:00,876 --> 00:50:04,376 So we do hope that you bear that in mind 1028 00:50:04,596 --> 00:50:06,806 as we continue this discussion on Friday. 1029 00:50:07,246 --> 00:50:08,906 This is CS50. 1030 00:50:09,516 --> 00:50:17,516 [ Applause ] 1031 00:50:18,016 --> 00:50:29,006 [ Music ]