1 00:00:00,000 --> 00:00:11,178 2 00:00:11,178 --> 00:00:13,500 DAVID MALAN: All right, welcome to computer science 50, 3 00:00:13,500 --> 00:00:15,780 introduction to computer science 1. 4 00:00:15,780 --> 00:00:19,720 My name is David Malan, and I will be your instructor this semester. 5 00:00:19,720 --> 00:00:22,560 So even if you have no idea how the computer you own, 6 00:00:22,560 --> 00:00:24,480 or the laptop you own, works-- 7 00:00:24,480 --> 00:00:27,570 and perhaps some of you are just a little bit scared of it-- you probably 8 00:00:27,570 --> 00:00:30,690 know at the end of the day, everything that goes on inside that computer 9 00:00:30,690 --> 00:00:33,450 boils down to zeros and ones, a.k.a. 10 00:00:33,450 --> 00:00:34,080 bits. 11 00:00:34,080 --> 00:00:36,060 So where are all these zeros and ones stored? 12 00:00:36,060 --> 00:00:38,940 Well, you probably also know that inside your computer somewhere is 13 00:00:38,940 --> 00:00:41,610 this thing called a hard drive, whether you have a desktop, 14 00:00:41,610 --> 00:00:43,397 you'll have something like this, a laptop, 15 00:00:43,397 --> 00:00:44,730 you'll have something like this. 16 00:00:44,730 --> 00:00:46,772 But mechanically, they pretty much work the same. 17 00:00:46,772 --> 00:00:49,890 In fact, in some of your iPods, or devices much like these-- 18 00:00:49,890 --> 00:00:52,830 quick question, how do these things work? 19 00:00:52,830 --> 00:00:55,230 This is literally like a 200 gigabyte hard 20 00:00:55,230 --> 00:00:58,350 drive that I pulled from a non-functioning desktop computer. 21 00:00:58,350 --> 00:00:59,760 What goes on inside these things? 22 00:00:59,760 --> 00:01:02,280 Well, as you can kind of tell-- and I'll start passing this around-- 23 00:01:02,280 --> 00:01:03,905 there are these things called platters. 24 00:01:03,905 --> 00:01:06,600 Essentially, these metal disks inside of hard drives 25 00:01:06,600 --> 00:01:11,110 that have millions, billions of tiny magnetic particles on top of them. 26 00:01:11,110 --> 00:01:13,840 And essentially, if you align these magnetic particles, 27 00:01:13,840 --> 00:01:18,180 say north-south, we might say that that particle is simply representing a 1. 28 00:01:18,180 --> 00:01:20,460 By contrast, if you flip that magnetic particle 29 00:01:20,460 --> 00:01:24,660 over putting it south to north, well we might say that particle is essentially 30 00:01:24,660 --> 00:01:25,893 representing a 0. 31 00:01:25,893 --> 00:01:28,060 And it's certainly a bit more complicated than that, 32 00:01:28,060 --> 00:01:30,660 but at the end of the day, the storage of zeros and ones-- 33 00:01:30,660 --> 00:01:34,920 the so-called language of computers-- all boils down to-- on hard drives, 34 00:01:34,920 --> 00:01:35,550 at least-- 35 00:01:35,550 --> 00:01:38,310 the storage of these magnetic particles. 36 00:01:38,310 --> 00:01:42,840 Well, it turns out that these larger devices are much like these floppies, 37 00:01:42,840 --> 00:01:45,807 that probably most of you in this room don't even use anymore, 38 00:01:45,807 --> 00:01:48,390 and most of your computers probably don't even come with them. 39 00:01:48,390 --> 00:01:52,650 But go ahead and very carefully slide this little silver metal piece-- 40 00:01:52,650 --> 00:01:56,160 if you took a floppy on your way in-- and you can sort of see 41 00:01:56,160 --> 00:01:58,590 just part of one of these circles. 42 00:01:58,590 --> 00:02:02,460 This one is in fact floppy, as the name of the disks implies. 43 00:02:02,460 --> 00:02:05,800 But it functionally works almost exactly the same as the hard drive. 44 00:02:05,800 --> 00:02:09,180 So let's go ahead and turn our attention for a moment to little video-- granted, 45 00:02:09,180 --> 00:02:12,653 a cheesy video-- but nonetheless, a bit illustrative. 46 00:02:12,653 --> 00:02:13,320 [VIDEO PLAYBACK] 47 00:02:13,320 --> 00:02:15,790 - [INAUDIBLE] works with 3 and 1/2 inch floppy disks. 48 00:02:15,790 --> 00:02:17,325 DAVID MALAN: Let's not, actually. 49 00:02:17,325 --> 00:02:18,323 50 00:02:18,323 --> 00:02:18,990 [VIDEO PLAYBACK] 51 00:02:18,990 --> 00:02:20,460 - The floppy drive you see here-- 52 00:02:20,460 --> 00:02:21,418 DAVID MALAN: All right. 53 00:02:21,418 --> 00:02:23,250 What a perfect way to begin today. 54 00:02:23,250 --> 00:02:23,860 [LAUGHTER] 55 00:02:23,860 --> 00:02:26,235 - They're the type most often used to carry new programs. 56 00:02:26,235 --> 00:02:28,170 DAVID MALAN: I'm the only one that doesn't see 57 00:02:28,170 --> 00:02:29,795 where this program is actually running. 58 00:02:29,795 --> 00:02:31,013 [LAUGHTER] 59 00:02:31,013 --> 00:02:31,680 [VIDEO PLAYBACK] 60 00:02:31,680 --> 00:02:33,788 - See it's actually just a hard plastic-- 61 00:02:33,788 --> 00:02:34,830 DAVID MALAN: There we go. 62 00:02:34,830 --> 00:02:36,540 All right, it opened the wrong part. 63 00:02:36,540 --> 00:02:40,470 Wow, it makes you want to start this lecture all over again, huh? 64 00:02:40,470 --> 00:02:45,630 All right, let's go ahead and play it with the right software this way. 65 00:02:45,630 --> 00:02:46,480 And here we go. 66 00:02:46,480 --> 00:02:47,147 [VIDEO PLAYBACK] 67 00:02:47,147 --> 00:02:50,890 - The floppy drive you see here works with 3 and 1/2 inch floppy disks. 68 00:02:50,890 --> 00:02:54,900 They're the type most often used to carry new programs, same data, 69 00:02:54,900 --> 00:02:58,260 or a new file from one PC to another. 70 00:02:58,260 --> 00:03:02,640 So part of the disk we see is actually just a hard plastic shell. 71 00:03:02,640 --> 00:03:07,320 The working disk, which is inside, is protected by a sliding metal shutter. 72 00:03:07,320 --> 00:03:10,260 This thin, inner disk, called the cookie, 73 00:03:10,260 --> 00:03:12,240 is coated not with chocolate chips, 74 00:03:12,240 --> 00:03:14,110 [LAUGHTER] 75 00:03:14,110 --> 00:03:16,570 --layer of magnetic material. 76 00:03:16,570 --> 00:03:20,500 When you slip the disk into your floppy drive, a system of levers 77 00:03:20,500 --> 00:03:22,660 pushes back the metal shutter. 78 00:03:22,660 --> 00:03:28,480 The levers also pinch to read/write as closer so they almost touch the cookie. 79 00:03:28,480 --> 00:03:31,030 A motor at the base of the drive spins the cookie 80 00:03:31,030 --> 00:03:33,310 based on commands from your PC. 81 00:03:33,310 --> 00:03:37,030 The PC also signals another motor to move the read/write heads 82 00:03:37,030 --> 00:03:42,010 back and forth over the surface of the disk so they can read or write data. 83 00:03:42,010 --> 00:03:45,250 Before your PC writes data, your drive first 84 00:03:45,250 --> 00:03:49,150 checks the write protect tab of the corner of the floppy disk. 85 00:03:49,150 --> 00:03:53,170 If it is open, light from a tiny diode shines through 86 00:03:53,170 --> 00:03:55,810 and strikes a diode on the other side. 87 00:03:55,810 --> 00:04:00,010 This diode then says to your PC, go write on this disk. 88 00:04:00,010 --> 00:04:00,760 [LAUGHTER] 89 00:04:00,760 --> 00:04:03,700 But if the tab is closed, no light gets through, 90 00:04:03,700 --> 00:04:06,447 and the PC knows it's OK to write data. 91 00:04:06,447 --> 00:04:07,030 [END PLAYBACK] 92 00:04:07,030 --> 00:04:08,680 DAVID MALAN: All right, so admittedly, it's a little embarrassing 93 00:04:08,680 --> 00:04:09,760 even showing you that video. 94 00:04:09,760 --> 00:04:11,740 I have never once, other than this man's voice, 95 00:04:11,740 --> 00:04:14,282 heard the thing inside of this thing referred to as a cookie. 96 00:04:14,282 --> 00:04:15,940 [LAUGHTER] 97 00:04:15,940 --> 00:04:18,430 But nonetheless, let's go ahead and do the following. 98 00:04:18,430 --> 00:04:22,300 Ultimately, this course is about tearing apart conceptually, a lot of which 99 00:04:22,300 --> 00:04:24,070 is currently unfamiliar to you. 100 00:04:24,070 --> 00:04:26,110 Go ahead-- watching out for your neighbors eyes, 101 00:04:26,110 --> 00:04:28,402 though, since there's a little spring in these things-- 102 00:04:28,402 --> 00:04:30,370 and just go ahead and pull off the metal tab 103 00:04:30,370 --> 00:04:32,270 that you slid over just a moment ago. 104 00:04:32,270 --> 00:04:35,860 So now you can actually push your finger against that little floppy disk, 105 00:04:35,860 --> 00:04:36,590 so to speak. 106 00:04:36,590 --> 00:04:39,880 And let's take this one step further, if only for the sake of drama here. 107 00:04:39,880 --> 00:04:42,670 Go ahead and insert your fingers wherever it seems possible, 108 00:04:42,670 --> 00:04:44,860 and just take the plastic cover off this thing, 109 00:04:44,860 --> 00:04:48,205 and literally take out the so-called floppy disk. 110 00:04:48,205 --> 00:05:09,680 111 00:05:09,680 --> 00:05:10,460 I know, right? 112 00:05:10,460 --> 00:05:13,910 So pretty underwhelming once you actually get inside there. 113 00:05:13,910 --> 00:05:15,410 But that's exactly the takeaway. 114 00:05:15,410 --> 00:05:17,960 Underneath all of this technology, at the end of the day, 115 00:05:17,960 --> 00:05:19,460 are fairly simple things. 116 00:05:19,460 --> 00:05:21,540 You can't see these magnetic particles. 117 00:05:21,540 --> 00:05:24,380 But if you do go ahead and wipe your fingers across this disk, 118 00:05:24,380 --> 00:05:27,787 you've certainly hurt or corrupted any of the data that might, in fact, have 119 00:05:27,787 --> 00:05:28,745 been on these floppies. 120 00:05:28,745 --> 00:05:29,245 [LAUGHTER] 121 00:05:29,245 --> 00:05:32,210 But again, the takeaway is just the simplicity of it all. 122 00:05:32,210 --> 00:05:34,460 And those of you who are sitting in this room thinking 123 00:05:34,460 --> 00:05:38,270 that, computer science is perhaps not for you, technology in general 124 00:05:38,270 --> 00:05:40,850 has never been for you, just realize that all of this stuff 125 00:05:40,850 --> 00:05:42,320 has been man made over the years. 126 00:05:42,320 --> 00:05:44,940 And at its core, some of these things are fairly simple. 127 00:05:44,940 --> 00:05:47,870 It's just that we have 30, 40 years of technology 128 00:05:47,870 --> 00:05:51,650 built on top of some of these simplest technologies to get us to the point 129 00:05:51,650 --> 00:05:52,730 where we are today. 130 00:05:52,730 --> 00:05:55,337 Just to make this a bit more technical now-- 131 00:05:55,337 --> 00:05:57,920 and this is not an electrical engineering course by any means, 132 00:05:57,920 --> 00:06:01,280 especially as this topic is about to be introduced by this same voice 133 00:06:01,280 --> 00:06:05,030 again-- let's just take a look at exactly how these here 134 00:06:05,030 --> 00:06:09,943 magnetic particles are, in fact, aligned in the spirit of ones and zeros. 135 00:06:09,943 --> 00:06:10,610 [VIDEO PLAYBACK] 136 00:06:10,610 --> 00:06:13,490 - To write data on your floppy disk, your PC 137 00:06:13,490 --> 00:06:17,390 tells the drive to send tiny pulses of electricity through the head. 138 00:06:17,390 --> 00:06:20,900 The pulses make the head act like little electromagnets. 139 00:06:20,900 --> 00:06:24,830 Each head creates a magnetic field that reaches the surface of the disk. 140 00:06:24,830 --> 00:06:27,530 Remember the magnetic coating on the cookie? 141 00:06:27,530 --> 00:06:31,070 The magnetic field alters the tiny particles in this coating. 142 00:06:31,070 --> 00:06:33,140 Its current runs through the heads one way. 143 00:06:33,140 --> 00:06:36,920 The particles are arranged at the north and south poles in one direction. 144 00:06:36,920 --> 00:06:39,620 But if current flows through the head the opposite way, 145 00:06:39,620 --> 00:06:41,270 the polarity reverses. 146 00:06:41,270 --> 00:06:43,850 To read data from the disk, the read/write 147 00:06:43,850 --> 00:06:46,580 heads move into the same position over the cookie. 148 00:06:46,580 --> 00:06:49,280 But this time, the process is reversed. 149 00:06:49,280 --> 00:06:52,550 The cookie particles create a magnetic field in the coils of wire, 150 00:06:52,550 --> 00:06:55,580 and this creates a current in the read/write head. 151 00:06:55,580 --> 00:07:00,500 The disk drive detects this flow of electricity and passes it onto the PC. 152 00:07:00,500 --> 00:07:03,560 The PC translates the back and forth current changes 153 00:07:03,560 --> 00:07:08,257 into a series of ones and zeros, the binary language of computer data. 154 00:07:08,257 --> 00:07:08,840 [END PLAYBACK] 155 00:07:08,840 --> 00:07:11,002 DAVID MALAN: OK, so at the end of the day, 156 00:07:11,002 --> 00:07:13,460 it just boils down to the magnetization of these particles. 157 00:07:13,460 --> 00:07:14,600 You get zeros and ones. 158 00:07:14,600 --> 00:07:16,610 But let's ask the more interesting question now. 159 00:07:16,610 --> 00:07:17,330 Who cares? 160 00:07:17,330 --> 00:07:21,320 So suppose you do have this ability to store nothing other than zeros 161 00:07:21,320 --> 00:07:22,670 and ones inside of a computer. 162 00:07:22,670 --> 00:07:25,440 Well why is that, in fact, even useful? 163 00:07:25,440 --> 00:07:27,530 Well, it turns out-- as this woman's voice now 164 00:07:27,530 --> 00:07:32,000 suggested-- that using the so-called binary alphabet of zeros and ones, 165 00:07:32,000 --> 00:07:34,190 you can represent any possible number. 166 00:07:34,190 --> 00:07:36,080 We all speak the so-called decimal system-- 167 00:07:36,080 --> 00:07:38,690 0 through 9, and then combinations thereof. 168 00:07:38,690 --> 00:07:41,967 Computers only speak binary combinations of zeros and two. 169 00:07:41,967 --> 00:07:44,300 So let's take a moment here-- and for those unfamiliar-- 170 00:07:44,300 --> 00:07:46,700 teach you how to count, not in decimal-- 171 00:07:46,700 --> 00:07:50,690 1,2,3, 4,5,6, 7,8, 9, 10-- but instead, in binary. 172 00:07:50,690 --> 00:07:52,370 And I'll toss a softball out there. 173 00:07:52,370 --> 00:07:56,720 If all you have in the world are zeros and ones, just take a stab at it. 174 00:07:56,720 --> 00:08:00,630 How would you go about representing the decimal number we know as zero? 175 00:08:00,630 --> 00:08:02,310 AUDIENCE: Zero. 176 00:08:02,310 --> 00:08:04,800 DAVID MALAN: OK, so not a hard class thus far. 177 00:08:04,800 --> 00:08:05,990 So in fact, it's true. 178 00:08:05,990 --> 00:08:07,460 So it's just all zeros. 179 00:08:07,460 --> 00:08:10,970 So you often hear of zeros and ones talked about in terms 180 00:08:10,970 --> 00:08:12,500 of turning something on-- 181 00:08:12,500 --> 00:08:14,270 a one, turning something off. 182 00:08:14,270 --> 00:08:16,790 A zero, like a light bulb is on, might represent a one. 183 00:08:16,790 --> 00:08:19,460 A light bulb is off, it might represent a zero. 184 00:08:19,460 --> 00:08:21,500 Often intertwined in that kind of conversation 185 00:08:21,500 --> 00:08:24,057 is mentioned of fairly technical things like transistors, 186 00:08:24,057 --> 00:08:26,390 which are nothing more than switches that turn something 187 00:08:26,390 --> 00:08:27,920 on or turn something off. 188 00:08:27,920 --> 00:08:29,990 So we might represent 8 bits-- 189 00:08:29,990 --> 00:08:32,870 that is 8 zeros and ones-- by say, these light bulbs here. 190 00:08:32,870 --> 00:08:34,820 And if all eight of those bulbs-- 191 00:08:34,820 --> 00:08:39,710 a byte, B-Y-T-E of bits, if you will-- if are all set to off, 192 00:08:39,710 --> 00:08:42,770 well that number there is simply representing zero. 193 00:08:42,770 --> 00:08:44,090 Now take another stab. 194 00:08:44,090 --> 00:08:45,980 If you have only zeros and ones in the world, 195 00:08:45,980 --> 00:08:47,840 how do you go about representing the number one? 196 00:08:47,840 --> 00:08:48,545 AUDIENCE: One. 197 00:08:48,545 --> 00:08:52,190 DAVID MALAN: All right, so again, not all that non-obvious. 198 00:08:52,190 --> 00:08:54,680 All the things to the left are just like the leading zeros. 199 00:08:54,680 --> 00:08:58,340 You could put as many zeros to the left of a decimal number as you want, 200 00:08:58,340 --> 00:09:02,990 but 00123 is still the number we know as 123. 201 00:09:02,990 --> 00:09:03,810 Same in this case. 202 00:09:03,810 --> 00:09:06,560 We've got 8 bits, but we only needed one of them, so that's fine. 203 00:09:06,560 --> 00:09:08,210 The rest are assumed to be zeros. 204 00:09:08,210 --> 00:09:09,930 Well, how do you count up from there? 205 00:09:09,930 --> 00:09:12,440 Well, then you start toggling these bits, so to speak. 206 00:09:12,440 --> 00:09:13,310 You turn one off. 207 00:09:13,310 --> 00:09:15,950 You turn the next one over to the left on. 208 00:09:15,950 --> 00:09:18,308 How would you go now to the number three? 209 00:09:18,308 --> 00:09:19,100 Well, take a guess. 210 00:09:19,100 --> 00:09:23,540 If we've now got represented on the board zero, one, two, intuitively, 211 00:09:23,540 --> 00:09:25,008 what's probably the pattern here? 212 00:09:25,008 --> 00:09:25,800 AUDIENCE: One, one. 213 00:09:25,800 --> 00:09:26,842 DAVID MALAN: So one, one. 214 00:09:26,842 --> 00:09:29,570 Just flip on the bit that's still off. 215 00:09:29,570 --> 00:09:31,670 And so now we have one, one. 216 00:09:31,670 --> 00:09:33,800 So now, we're sort of in this situation where, 217 00:09:33,800 --> 00:09:36,770 if we want to represent the number four, we can't just 218 00:09:36,770 --> 00:09:39,020 use those two right most bits, because it 219 00:09:39,020 --> 00:09:41,120 looks like the biggest number we can represent 220 00:09:41,120 --> 00:09:45,200 with just two light bulbs, two bits, looks like the number three. 221 00:09:45,200 --> 00:09:47,870 Well, how do we go about making room for the number four? 222 00:09:47,870 --> 00:09:48,690 Well, take a guess. 223 00:09:48,690 --> 00:09:51,357 What do we do with these bits to get to the decimal number four? 224 00:09:51,357 --> 00:09:52,640 AUDIENCE: [INAUDIBLE] 225 00:09:52,640 --> 00:09:56,580 DAVID MALAN: So turn off those two, but flip the next one on. 226 00:09:56,580 --> 00:10:01,460 So now we have light bulb on, light bulb off, light bulb off. 227 00:10:01,460 --> 00:10:05,960 Now how do you actually-- and just to make this more real, here's the before. 228 00:10:05,960 --> 00:10:09,470 Turn those light bulbs into zeros and ones after. 229 00:10:09,470 --> 00:10:11,022 So before, after. 230 00:10:11,022 --> 00:10:12,730 What you have here is what we simply know 231 00:10:12,730 --> 00:10:15,160 as bytes of bits in the binary system. 232 00:10:15,160 --> 00:10:16,640 So what's really the pattern here? 233 00:10:16,640 --> 00:10:19,690 Well, as you might have noticed that the top row of this little chart, 234 00:10:19,690 --> 00:10:21,820 there's these column headers, which I've labeled 235 00:10:21,820 --> 00:10:26,830 the ones column, the twos column, the fours column, the eights column. 236 00:10:26,830 --> 00:10:29,170 There's clearly a pattern there-- multiples of two 237 00:10:29,170 --> 00:10:31,060 going on up from right to left. 238 00:10:31,060 --> 00:10:33,820 But why are those placeholders actually useful? 239 00:10:33,820 --> 00:10:37,420 Well, take note of say, this last row of bits that we have here. 240 00:10:37,420 --> 00:10:39,340 One, zero, zero. 241 00:10:39,340 --> 00:10:43,000 Well, why does that represent what we know as the decimal number four? 242 00:10:43,000 --> 00:10:43,780 Well, take a look. 243 00:10:43,780 --> 00:10:45,760 In the fours column, we have a one. 244 00:10:45,760 --> 00:10:48,130 So that's like 4 times 1 is 4. 245 00:10:48,130 --> 00:10:52,120 So plus a 0 in the twos column, a 0 in the ones column, 246 00:10:52,120 --> 00:10:54,970 and so the additive sum is just 4. 247 00:10:54,970 --> 00:10:56,890 You use that same logic for the number three. 248 00:10:56,890 --> 00:10:59,600 So for the number three, in the second to last row, 249 00:10:59,600 --> 00:11:04,480 we had nothing in those 128s through the fours columns. 250 00:11:04,480 --> 00:11:07,790 But in the twos column and the ones column, we had ones. 251 00:11:07,790 --> 00:11:12,400 So we have one 2, plus one 1 gives us the decimal number we know as three. 252 00:11:12,400 --> 00:11:16,600 And just to make this more clear, this is not wholly unfamiliar to us. 253 00:11:16,600 --> 00:11:22,180 If you consider what we know as the decimal number 123 from grade school, 254 00:11:22,180 --> 00:11:25,720 why is that the decimal number 123? 255 00:11:25,720 --> 00:11:28,030 Well, recall the same system, the same trick. 256 00:11:28,030 --> 00:11:32,260 We had the ones place, we had the tens place, we had the hundreds place. 257 00:11:32,260 --> 00:11:34,390 So why is this 123? 258 00:11:34,390 --> 00:11:41,770 It's one 100, plus 2 times 10, plus 3 times 1, gives us what we know as 123. 259 00:11:41,770 --> 00:11:45,280 So this idea of binary, or base 2, as it might be known, 260 00:11:45,280 --> 00:11:46,630 is not so foreign to you. 261 00:11:46,630 --> 00:11:49,120 It's simply all you have at your disposal, ultimately, 262 00:11:49,120 --> 00:11:51,190 is just two values, zeros and ones. 263 00:11:51,190 --> 00:11:52,900 Where as, from grade school onward, we've 264 00:11:52,900 --> 00:11:57,580 been used to having 10 digits at our disposal, 0 through 9. 265 00:11:57,580 --> 00:12:02,950 So with that said, a little application of knowledge, just learned perhaps-- 266 00:12:02,950 --> 00:12:06,040 Cambridge's zip code is 0 2 1 3 8. 267 00:12:06,040 --> 00:12:08,920 If you're a freshman and don't know that yet, you will soon. 268 00:12:08,920 --> 00:12:10,990 0 2 1 3 8-- 269 00:12:10,990 --> 00:12:14,255 what is that in binary? 270 00:12:14,255 --> 00:12:16,630 Granted, the easiest way to answer this is skipping ahead 271 00:12:16,630 --> 00:12:20,050 in your lecture notes, but there are dashed lines here 272 00:12:20,050 --> 00:12:25,020 for your intellectual stimulation. 273 00:12:25,020 --> 00:12:31,020 0 2 1 3 8 is what in binary, from top to bottom row? 274 00:12:31,020 --> 00:13:07,555 275 00:13:07,555 --> 00:13:08,055 All right. 276 00:13:08,055 --> 00:13:10,770 277 00:13:10,770 --> 00:13:13,020 The solution is now on the board. 278 00:13:13,020 --> 00:13:16,710 Hopefully, the first row, everyone got zero, all zeros. 279 00:13:16,710 --> 00:13:19,498 One, similarly pretty easy, because we just did that a moment ago. 280 00:13:19,498 --> 00:13:21,540 But hopefully your answers check up against this. 281 00:13:21,540 --> 00:13:24,360 Turns out, the only value we haven't already seen on the board 282 00:13:24,360 --> 00:13:25,290 is that eight. 283 00:13:25,290 --> 00:13:26,410 Well, why does that work? 284 00:13:26,410 --> 00:13:31,710 Well, one, zero, zero, zero on that last row is obviously one 8, plus zero 4s, 285 00:13:31,710 --> 00:13:34,285 plus zero 2s, plus zero 1s. 286 00:13:34,285 --> 00:13:35,160 All right, that's it. 287 00:13:35,160 --> 00:13:39,000 That is all there is to binary, to the so-called zeros and ones 288 00:13:39,000 --> 00:13:40,410 that only computers speak. 289 00:13:40,410 --> 00:13:45,720 And sad to say is perhaps, aspiring computer scientist, you 290 00:13:45,720 --> 00:13:49,890 can now appreciate the, dare say, humor of such comics as these. 291 00:13:49,890 --> 00:13:57,610 292 00:13:57,610 --> 00:14:00,520 Yeah, if you're laughing you belong in computer science perhaps. 293 00:14:00,520 --> 00:14:01,660 [LAUGHTER] 294 00:14:01,660 --> 00:14:04,030 So, all right, so that's all fine and good. 295 00:14:04,030 --> 00:14:07,540 You can represent number 0 through 8 certainly, and beyond, 296 00:14:07,540 --> 00:14:09,880 if we just keep using more and more of these bits, more 297 00:14:09,880 --> 00:14:11,300 and more of these zeros and ones. 298 00:14:11,300 --> 00:14:14,500 But that's not all that useful when computers today don't obviously 299 00:14:14,500 --> 00:14:16,150 just calculate numbers. 300 00:14:16,150 --> 00:14:19,023 They have graphics and they display characters of text. 301 00:14:19,023 --> 00:14:20,440 They allow you to write documents. 302 00:14:20,440 --> 00:14:23,148 Well, it turns out-- and we'll revisit this later in the course-- 303 00:14:23,148 --> 00:14:25,660 that computers are as sophisticated as they are today 304 00:14:25,660 --> 00:14:29,770 because they use those zeros and ones, this trivial alphabet of zeros 305 00:14:29,770 --> 00:14:35,290 and ones, to represent any possible types of data, including, for instance, 306 00:14:35,290 --> 00:14:36,340 alphabetical letters. 307 00:14:36,340 --> 00:14:39,940 So this chart-- scary or overwhelming as it might seem now-- 308 00:14:39,940 --> 00:14:44,710 is simply a mapping, using what's called the ASCII coding system, where 309 00:14:44,710 --> 00:14:47,740 in the right hand columns that are each in red, 310 00:14:47,740 --> 00:14:50,150 you have some familiar characters in red. 311 00:14:50,150 --> 00:14:52,150 These are like characters on the keyboard. 312 00:14:52,150 --> 00:14:53,800 So you have A through A in lowercase-- 313 00:14:53,800 --> 00:14:57,190 A through Z in lowercase, A through Z in uppercase, 314 00:14:57,190 --> 00:14:58,930 a whole bunch of punctuation. 315 00:14:58,930 --> 00:15:00,940 And then next to each of those red characters, 316 00:15:00,940 --> 00:15:04,510 you essentially have the numeric codes that computers traditionally 317 00:15:04,510 --> 00:15:06,890 used to represent those values. 318 00:15:06,890 --> 00:15:10,480 So with that said-- and the left most column under dec just means decimal-- 319 00:15:10,480 --> 00:15:15,940 what is the decimal value that a computer uses to represent internally 320 00:15:15,940 --> 00:15:18,880 the letter capital A? 321 00:15:18,880 --> 00:15:20,230 AUDIENCE: 65. 322 00:15:20,230 --> 00:15:22,150 DAVID MALAN: All right, so 65. 323 00:15:22,150 --> 00:15:23,710 And how about lowercase A? 324 00:15:23,710 --> 00:15:24,710 AUDIENCE: 97. 325 00:15:24,710 --> 00:15:25,990 DAVID MALAN: 97. 326 00:15:25,990 --> 00:15:30,280 OK, if you take away no two other numbers from this so-called ASCII 327 00:15:30,280 --> 00:15:33,610 coding system two weeks from now in a forthcoming problem, 328 00:15:33,610 --> 00:15:37,210 know that by just remembering 65 and 97 turns out 329 00:15:37,210 --> 00:15:41,380 you can remember 50 other additional characters, as well, because they're 330 00:15:41,380 --> 00:15:44,020 all obviously linearly increasing. 331 00:15:44,020 --> 00:15:45,430 So that's it for today. 332 00:15:45,430 --> 00:15:48,580 That's the hardcore Introduction to zeros and ones, binaries, 333 00:15:48,580 --> 00:15:49,990 how computers speak. 334 00:15:49,990 --> 00:15:53,270 What then is this course all about? 335 00:15:53,270 --> 00:15:54,220 So here's the deal. 336 00:15:54,220 --> 00:15:57,640 CS50 certainly has a reputation, and it has for 10, 337 00:15:57,640 --> 00:16:01,420 20 or so years since it's been around, even if some of its prior forms. 338 00:16:01,420 --> 00:16:04,660 I, myself, was an undergrad in '95 to '99, 339 00:16:04,660 --> 00:16:07,990 and I was a gov major for the first year and a half that I was here. 340 00:16:07,990 --> 00:16:10,450 And I certainly came into this school as sort 341 00:16:10,450 --> 00:16:13,178 of a geek, the kind of kid who, I heard it up here, 342 00:16:13,178 --> 00:16:15,970 might have laughed at like the fox trot cartoon once I knew binary. 343 00:16:15,970 --> 00:16:16,630 [LAUGHTER] 344 00:16:16,630 --> 00:16:19,810 But even so-- and I was a UA at the time, too-- 345 00:16:19,810 --> 00:16:23,290 even so, CS50 had this reputation that I think 346 00:16:23,290 --> 00:16:25,450 it's still, to a large extent, has today, which 347 00:16:25,450 --> 00:16:27,260 is that it takes a lot of work. 348 00:16:27,260 --> 00:16:28,090 It's really hard. 349 00:16:28,090 --> 00:16:30,940 It's really only for those computer genius friends of yours. 350 00:16:30,940 --> 00:16:36,070 Or in any case, it has a reputation that I think is much larger, much scarier, 351 00:16:36,070 --> 00:16:37,900 than say, the course actually is itself. 352 00:16:37,900 --> 00:16:40,810 And just on a whim really, or finally come sophomore year, 353 00:16:40,810 --> 00:16:43,400 I had some additional confidence perhaps, and I decided, 354 00:16:43,400 --> 00:16:43,990 all right, what the heck. 355 00:16:43,990 --> 00:16:44,695 I'll take CS50. 356 00:16:44,695 --> 00:16:46,660 I know I like this kind of stuff. 357 00:16:46,660 --> 00:16:49,120 I'll just ignore all of the sort of advice 358 00:16:49,120 --> 00:16:51,220 that my friends have given me to the contrary. 359 00:16:51,220 --> 00:16:54,400 I took the course pass/fail up until the last possible day 360 00:16:54,400 --> 00:16:56,110 when you could switch to a letter grade. 361 00:16:56,110 --> 00:17:00,040 And for me, the change was simply because, for the first time, 362 00:17:00,040 --> 00:17:03,580 in really of any of the courses I had taken thus far as an undergrad-- like, 363 00:17:03,580 --> 00:17:04,790 I love this stuff. 364 00:17:04,790 --> 00:17:07,869 And it was the first time for me-- and you can make fun of me for this 365 00:17:07,869 --> 00:17:09,220 in subsequent classes-- 366 00:17:09,220 --> 00:17:12,339 it was the first time for me that homework honestly was fun. 367 00:17:12,339 --> 00:17:15,490 And there was this coincidence of sort of my interest 368 00:17:15,490 --> 00:17:17,680 sort of on an extracurricular level-- 369 00:17:17,680 --> 00:17:20,770 and though, I did other things besides computers extracurricularly-- 370 00:17:20,770 --> 00:17:22,990 and what actually was assigned work. 371 00:17:22,990 --> 00:17:27,700 And this is absolutely more of a commentary on perhaps my social life 372 00:17:27,700 --> 00:17:29,690 at the time than on computer science 50-- 373 00:17:29,690 --> 00:17:30,190 [LAUGHTER] 374 00:17:30,190 --> 00:17:34,090 --but I used to look forward, frankly, to sitting down on Friday 375 00:17:34,090 --> 00:17:37,450 night, and tackling the newest problem sets. 376 00:17:37,450 --> 00:17:41,090 And that, too, is worthy of making fun of me for in the future. 377 00:17:41,090 --> 00:17:43,480 But this is only to say that this course certainly 378 00:17:43,480 --> 00:17:44,817 has personal significance to me. 379 00:17:44,817 --> 00:17:47,650 And all of these folks you see sitting here in these blue t-shirts-- 380 00:17:47,650 --> 00:17:49,780 the teaching fellows, who I'll introduce again in a bit-- 381 00:17:49,780 --> 00:17:51,790 really feel passionately about this course. 382 00:17:51,790 --> 00:17:56,020 For me, it really turned me on to an academic field, and ultimately 383 00:17:56,020 --> 00:17:59,470 a degree program, that I just had no idea I would take such an interest in. 384 00:17:59,470 --> 00:18:02,140 And the funny thing is, these days, last year, 385 00:18:02,140 --> 00:18:04,540 the past five years, most of you in this room 386 00:18:04,540 --> 00:18:06,460 are certainly not going to become-- 387 00:18:06,460 --> 00:18:09,200 certainly, as a result of this class-- computer science majors. 388 00:18:09,200 --> 00:18:12,820 In fact, CS majors constitute the significant minority 389 00:18:12,820 --> 00:18:15,790 of the students in CS50 these days, because rather, we 390 00:18:15,790 --> 00:18:18,160 have students taking this class as an elective, 391 00:18:18,160 --> 00:18:21,490 as a related field requirement for their own concentration. 392 00:18:21,490 --> 00:18:24,880 And the fact of the matter is, because this course really 393 00:18:24,880 --> 00:18:29,560 is sort of a side effect, or as a framework for introducing computer 394 00:18:29,560 --> 00:18:32,350 science, teaches you programming. 395 00:18:32,350 --> 00:18:36,010 Honestly, the rewards of a course like this, an introductory course 396 00:18:36,010 --> 00:18:38,980 in computer science, really are huge in that they really 397 00:18:38,980 --> 00:18:41,750 can be applicable to your own field, whether you're a science 398 00:18:41,750 --> 00:18:44,500 major, whether you're a math major, whether you're simply involved 399 00:18:44,500 --> 00:18:46,330 in a student group and need to actually use 400 00:18:46,330 --> 00:18:49,660 computers to use websites to actually make your lives easier, 401 00:18:49,660 --> 00:18:51,260 and automate some processes. 402 00:18:51,260 --> 00:18:53,650 So just realize that the takeaways from this course 403 00:18:53,650 --> 00:18:57,880 are far more than I think than can be conveyed in this fairly arcane language 404 00:18:57,880 --> 00:18:59,470 that you see in the course catalog. 405 00:18:59,470 --> 00:19:01,660 Frankly, you read this description, and it doesn't 406 00:19:01,660 --> 00:19:03,380 sound like the course for most people. 407 00:19:03,380 --> 00:19:06,220 But if you dive deeper into the syllabus, the course's website, 408 00:19:06,220 --> 00:19:09,440 conversations with these folks here who have all taken the course, 409 00:19:09,440 --> 00:19:12,820 hopefully you'll realize that this course is not 410 00:19:12,820 --> 00:19:16,940 what its reputation perhaps makes itself out to be. 411 00:19:16,940 --> 00:19:19,090 So with that said, what are the expectations 412 00:19:19,090 --> 00:19:21,520 of students who do, in fact, take this course? 413 00:19:21,520 --> 00:19:24,970 Quite simply, attend all lectures and sections, complete eight problem sets, 414 00:19:24,970 --> 00:19:27,550 take three quizzes, produce a final project. 415 00:19:27,550 --> 00:19:30,010 A popular question to address at the start of the term 416 00:19:30,010 --> 00:19:31,430 is is there a final exam? 417 00:19:31,430 --> 00:19:33,220 And the answer is no. 418 00:19:33,220 --> 00:19:36,230 Grades are computed and will be weighted as follows. 419 00:19:36,230 --> 00:19:39,220 Essentially, the breakdown will be as such-- this is elaborated on 420 00:19:39,220 --> 00:19:40,070 in the syllabus. 421 00:19:40,070 --> 00:19:43,120 But realize, because this course is certainly a lot of work, 422 00:19:43,120 --> 00:19:44,350 it does have this reputation. 423 00:19:44,350 --> 00:19:45,880 And I should make this point clear. 424 00:19:45,880 --> 00:19:50,860 Undoubtedly, computer science 50 comes with a non-trivial workload. 425 00:19:50,860 --> 00:19:54,790 And by that, we mean 10 plus hours a week, 10, 15 hours a week. 426 00:19:54,790 --> 00:19:59,260 For many of you freshmen in the room, that sounds like a scary lot of hours. 427 00:19:59,260 --> 00:20:02,530 Hopefully, if you're sophomore, junior, senior, or beyond, 428 00:20:02,530 --> 00:20:06,130 you realize that, ha ha, 10 hours, that wasn't so bad back in the day. 429 00:20:06,130 --> 00:20:07,908 So just realize that your-- 430 00:20:07,908 --> 00:20:10,660 [LAUGHTER] 431 00:20:10,660 --> 00:20:14,983 --perception of courses and course loads, I do think, changes over time. 432 00:20:14,983 --> 00:20:16,900 And just to give you the extreme counterpoint, 433 00:20:16,900 --> 00:20:18,733 perhaps to scare you out of computer science 434 00:20:18,733 --> 00:20:22,330 altogether-- when I took computer science 161, operating systems, 435 00:20:22,330 --> 00:20:26,230 when I was in undergrad, that course, by contrast-- and it's an elective. 436 00:20:26,230 --> 00:20:30,137 You don't have to take this course-- was about 40 hours a week every other week. 437 00:20:30,137 --> 00:20:33,220 So that's sort of the other extreme, and that explains my Saturday nights, 438 00:20:33,220 --> 00:20:34,210 as well, that semester. 439 00:20:34,210 --> 00:20:35,570 [LAUGHTER] 440 00:20:35,570 --> 00:20:39,550 So with that said, the course definitely comes with its own workload, 441 00:20:39,550 --> 00:20:40,510 a non-trivial amount. 442 00:20:40,510 --> 00:20:43,360 But the thing is, you're not going to learn computer science. 443 00:20:43,360 --> 00:20:47,020 You're not going to learn how to program listening to a guy like me up here, 444 00:20:47,020 --> 00:20:49,420 or even listening to your teaching fellow once a week. 445 00:20:49,420 --> 00:20:52,330 It's only in sitting down in front of your own machine 446 00:20:52,330 --> 00:20:55,240 and actually solving problems, fighting with the computer, 447 00:20:55,240 --> 00:20:59,140 making it do what you want it to do, and getting your programs to work, 448 00:20:59,140 --> 00:21:02,000 that you really exit with a new skill set. 449 00:21:02,000 --> 00:21:05,020 So it is simply par for the course, frankly, putting a lot of time 450 00:21:05,020 --> 00:21:06,590 into a course like this. 451 00:21:06,590 --> 00:21:09,970 But again, what you get out of it, hopefully, is the ability to one, 452 00:21:09,970 --> 00:21:13,690 solve problems in ways that your peers simply cannot, without say, 453 00:21:13,690 --> 00:21:18,200 even that skill of programming alone, and honestly, at speeds that others, 454 00:21:18,200 --> 00:21:21,910 including yourself as of now perhaps, could not solve those same problems 455 00:21:21,910 --> 00:21:25,127 that computers facilitate precisely those kinds of solutions. 456 00:21:25,127 --> 00:21:27,460 However, because there is a lot of work and we certainly 457 00:21:27,460 --> 00:21:30,700 appreciate that we all have occasional bad days or weeks, 458 00:21:30,700 --> 00:21:33,110 you will be able to drop your lowest problem set. 459 00:21:33,110 --> 00:21:35,260 You'll be able to drop your lowest quiz score. 460 00:21:35,260 --> 00:21:37,330 And there's a great deal more infrastructure 461 00:21:37,330 --> 00:21:40,450 in place of support structure for you throughout the semester. 462 00:21:40,450 --> 00:21:43,810 You may, as I started two years ago, take the course pass/fail, 463 00:21:43,810 --> 00:21:47,200 simply come up to me or one of the teaching fellows to discuss as much. 464 00:21:47,200 --> 00:21:49,480 But we are fine, certainly, with that. 465 00:21:49,480 --> 00:21:52,630 The course's website will contain much of what you need 466 00:21:52,630 --> 00:21:55,390 to succeed or to review in this course. 467 00:21:55,390 --> 00:21:59,500 We'll defer a walkthrough of salient features in the future. 468 00:21:59,500 --> 00:22:03,130 For your keystroke saving convenience, you can also just 469 00:22:03,130 --> 00:22:06,250 type CS50.org these days, and it will redirect you 470 00:22:06,250 --> 00:22:09,100 to the FAS address, which is a little harder to remember. 471 00:22:09,100 --> 00:22:12,310 The email address for the staff on which I and all the teaching fellows are, 472 00:22:12,310 --> 00:22:15,190 is simply cs50@fas. 473 00:22:15,190 --> 00:22:17,830 But one of the features of this course that, over the years, 474 00:22:17,830 --> 00:22:23,740 has proved rather popular, if only because of its anonymization of posts 475 00:22:23,740 --> 00:22:27,940 and its 24 hour accessibility, is the so-called bulletin board 476 00:22:27,940 --> 00:22:28,960 on the course's website. 477 00:22:28,960 --> 00:22:30,880 You're presumably familiar with this concept. 478 00:22:30,880 --> 00:22:33,520 The bulletin board will be accessible in about a week's time. 479 00:22:33,520 --> 00:22:35,350 But we do urge you throughout the semester 480 00:22:35,350 --> 00:22:38,427 to post your questions anonymously to this bulletin board 481 00:22:38,427 --> 00:22:40,510 so that you certainly might benefit from an answer 482 00:22:40,510 --> 00:22:43,960 from fellow students or ourselves, or certainly, other students 483 00:22:43,960 --> 00:22:47,290 can benefit from the same. 484 00:22:47,290 --> 00:22:50,950 All right, books-- there are four at the Coop, all of them 485 00:22:50,950 --> 00:22:52,790 unreasonably expensive. 486 00:22:52,790 --> 00:22:54,800 Here's the deal with the books. 487 00:22:54,800 --> 00:22:57,110 So there are no required books for this course. 488 00:22:57,110 --> 00:23:00,190 These days, I'm not really a fan of coercing students to buy books, 489 00:23:00,190 --> 00:23:02,080 particularly because of their cost. 490 00:23:02,080 --> 00:23:05,980 The course is not designed around using a specific textbook. 491 00:23:05,980 --> 00:23:10,760 However, we did go ahead and recommend any of four books as follows. 492 00:23:10,760 --> 00:23:13,690 Essentially, with the trend that this course fights over years 493 00:23:13,690 --> 00:23:16,960 is to balance as effectively as possible those students coming 494 00:23:16,960 --> 00:23:19,480 into this course who are very comfortable with computers, 495 00:23:19,480 --> 00:23:21,880 maybe took AP Computer Science, and are here 496 00:23:21,880 --> 00:23:23,630 really to fill in holes in their knowledge 497 00:23:23,630 --> 00:23:25,210 so they can move to higher level courses. 498 00:23:25,210 --> 00:23:27,002 And then there's the other type of student, 499 00:23:27,002 --> 00:23:28,960 who is genuinely scared of their computer, 500 00:23:28,960 --> 00:23:32,590 or feels that they should know something about programming or computer science, 501 00:23:32,590 --> 00:23:36,520 but just generally feels that they are not quite at the same skill level 502 00:23:36,520 --> 00:23:38,810 as say, some of the students in their sections. 503 00:23:38,810 --> 00:23:42,340 So to accommodate these two different sort of unofficial tracks 504 00:23:42,340 --> 00:23:44,980 within the course, one approach that we've taken this year 505 00:23:44,980 --> 00:23:47,290 is to recommend either of two books. 506 00:23:47,290 --> 00:23:49,550 Essentially, the way we've spun these is as follows. 507 00:23:49,550 --> 00:23:51,490 This is a recommended book in the syllabus 508 00:23:51,490 --> 00:23:54,580 for quote unquote those less comfortable with either computer 509 00:23:54,580 --> 00:23:57,570 science, computers, with the idea of programming. 510 00:23:57,570 --> 00:24:01,400 By contrast, this book is what we recommend for those more comfortable, 511 00:24:01,400 --> 00:24:03,900 those of you who have maybe had some programming experience, 512 00:24:03,900 --> 00:24:07,200 or even if you haven't, just feel like you're going to be fine in this course. 513 00:24:07,200 --> 00:24:10,590 This is more at your level. 514 00:24:10,590 --> 00:24:12,930 Effectively, these two books in particular 515 00:24:12,930 --> 00:24:16,950 are designed to be at home supplements to lectures and sections. 516 00:24:16,950 --> 00:24:20,640 If you are simply the type of student who learns well from reading books, 517 00:24:20,640 --> 00:24:26,010 if you enjoy sort of the crutch that having a book by your side sort of 518 00:24:26,010 --> 00:24:28,950 brings after lectures or adjourn, then by all means, 519 00:24:28,950 --> 00:24:31,290 flip through either of these two texts. 520 00:24:31,290 --> 00:24:35,010 Bye one of them, or perhaps, just take a look at it in the library. 521 00:24:35,010 --> 00:24:36,770 Though I would urge any of you, if you go 522 00:24:36,770 --> 00:24:40,020 this route of buying any of the books, follow the link on the course's website 523 00:24:40,020 --> 00:24:43,560 to say, Amazon, and you can get these books significantly discounted. 524 00:24:43,560 --> 00:24:46,440 You will not need them for at least a week or two, 525 00:24:46,440 --> 00:24:49,860 so you certainly won't be at a disadvantage placing a super saver 526 00:24:49,860 --> 00:24:51,720 order sometime this week. 527 00:24:51,720 --> 00:24:56,280 This book here is bundled at a discount, quote unquote, at the Coop. 528 00:24:56,280 --> 00:24:57,587 [LAUGHTER] 529 00:24:57,587 --> 00:25:00,420 I probably shouldn't really say all these things on film these days, 530 00:25:00,420 --> 00:25:01,190 but so be it. 531 00:25:01,190 --> 00:25:03,150 [LAUGHTER] 532 00:25:03,150 --> 00:25:04,950 This is just a lot of fun, this book. 533 00:25:04,950 --> 00:25:08,820 This book is in the spirit of those, granted, cheesy videos that we showed 534 00:25:08,820 --> 00:25:11,010 just a bit ago in that it's essentially-- 535 00:25:11,010 --> 00:25:14,310 a picture book is the wrong word, because it's more technical than that-- 536 00:25:14,310 --> 00:25:17,160 but it's very easily digestible. 537 00:25:17,160 --> 00:25:18,960 And it addresses things like how does RAM 538 00:25:18,960 --> 00:25:21,870 work, how does a hard drive work, how does a joystick work, 539 00:25:21,870 --> 00:25:24,480 how does Mac OS boot up at startup. 540 00:25:24,480 --> 00:25:27,690 It's very bite-sized kinds of topics that, if you just 541 00:25:27,690 --> 00:25:30,877 like to sort of know a bit more about computer and the internet, 542 00:25:30,877 --> 00:25:32,460 it's an interesting book to reference. 543 00:25:32,460 --> 00:25:36,090 And laced throughout the problem sets this semester will be sort of one 544 00:25:36,090 --> 00:25:39,210 liner questions like, how does a hard drive work. 545 00:25:39,210 --> 00:25:41,460 And two, this book, you can turn-- will let 546 00:25:41,460 --> 00:25:43,680 you turn to like, Wikipedia and Google in general, 547 00:25:43,680 --> 00:25:44,970 for those kinds of questions. 548 00:25:44,970 --> 00:25:47,190 But really, the purpose of this book in the course 549 00:25:47,190 --> 00:25:51,690 is really just to encourage you to dabble in some useful knowledge, 550 00:25:51,690 --> 00:25:56,470 but that certainly isn't aligned with the academic spirit of the course. 551 00:25:56,470 --> 00:25:59,370 Finally, for those handful of you who might consider yourself 552 00:25:59,370 --> 00:26:02,070 to be, or want to be, hackers-- 553 00:26:02,070 --> 00:26:05,730 a wonderfully esoteric book is this Hacker's Delight. 554 00:26:05,730 --> 00:26:09,240 You find it perhaps advantageous for a couple of the courses problem 555 00:26:09,240 --> 00:26:10,110 sets this year. 556 00:26:10,110 --> 00:26:12,780 But really, this is a good reference book for those of you 557 00:26:12,780 --> 00:26:15,660 who know you're going to be computer scientists, or really 558 00:26:15,660 --> 00:26:17,070 intense programmers. 559 00:26:17,070 --> 00:26:20,160 It's a wonderful book as to how to optimize, that is, improve 560 00:26:20,160 --> 00:26:20,940 your own code. 561 00:26:20,940 --> 00:26:23,437 And I found this a wonderful reference in graduate school 562 00:26:23,437 --> 00:26:26,520 when a lot of the challenges at hand were not just getting things to work, 563 00:26:26,520 --> 00:26:29,770 but getting them to work better than existing solutions, 564 00:26:29,770 --> 00:26:31,570 getting them to work faster. 565 00:26:31,570 --> 00:26:35,040 So as with a lot of the courses here at Harvard, ours, too, 566 00:26:35,040 --> 00:26:36,250 comes with sections. 567 00:26:36,250 --> 00:26:37,590 And if I could draw attention to you guys, 568 00:26:37,590 --> 00:26:39,590 if you wouldn't mind standing for just a moment. 569 00:26:39,590 --> 00:26:41,760 Among our course's teaching fellows are those here 570 00:26:41,760 --> 00:26:44,430 in the stylish, blue t-shirts today. 571 00:26:44,430 --> 00:26:46,770 You will see these in the basement of the Science Center 572 00:26:46,770 --> 00:26:50,340 whenever one of these guys is on duty during office hours, 573 00:26:50,340 --> 00:26:52,350 though I suspect as semester progresses, they'd 574 00:26:52,350 --> 00:26:54,810 much rather you recognize their faces than these t-shirts. 575 00:26:54,810 --> 00:26:57,150 So look at them now. 576 00:26:57,150 --> 00:27:01,360 These folks will be holding sections, which are 60 to 90 minute sections once 577 00:27:01,360 --> 00:27:01,860 a week. 578 00:27:01,860 --> 00:27:03,600 They won't start until next week. 579 00:27:03,600 --> 00:27:06,400 We won't officially do sectioning until next week. 580 00:27:06,400 --> 00:27:10,560 So the first week of sections next week will just be "come as you are." 581 00:27:10,560 --> 00:27:13,650 Attend any of the available sections, so no rush on that. 582 00:27:13,650 --> 00:27:15,070 Thank you guys very much. 583 00:27:15,070 --> 00:27:19,050 Let me also draw your attention in back to Katie and Thomas, the course's head 584 00:27:19,050 --> 00:27:20,040 teaching fellows. 585 00:27:20,040 --> 00:27:24,960 These guys are together, as a pair, responsible for managing the course 586 00:27:24,960 --> 00:27:26,130 administratively. 587 00:27:26,130 --> 00:27:29,380 They are a wonderful liaison to the course, 588 00:27:29,380 --> 00:27:32,522 if you feel more comfortable speaking with either of them. 589 00:27:32,522 --> 00:27:34,980 If, perhaps, you'd like to discuss your own teaching fellow 590 00:27:34,980 --> 00:27:37,320 and how section's going with someone else or myself, 591 00:27:37,320 --> 00:27:40,710 just know that these two here are a wonderful resources, as well, 592 00:27:40,710 --> 00:27:44,820 and will be responsible for taking care of sectioning in a week's time. 593 00:27:44,820 --> 00:27:50,590 So this is, again, a course with a good amount of challenges with it. 594 00:27:50,590 --> 00:27:53,940 So what we will be offering in addition to these traditional sections 595 00:27:53,940 --> 00:27:57,000 is what we've dubbed "super sections," once per week. 596 00:27:57,000 --> 00:28:01,740 Essentially, these are sections that students from any individual section 597 00:28:01,740 --> 00:28:03,930 are welcome to attend optionally. 598 00:28:03,930 --> 00:28:06,000 They'll be led by one or more teaching fellows, 599 00:28:06,000 --> 00:28:09,870 and they'll cover the same material from the week from lectures and sections, 600 00:28:09,870 --> 00:28:13,900 but usually with different examples, from a different person's perspective. 601 00:28:13,900 --> 00:28:18,570 So these super sections, which will also be filmed and put online, 602 00:28:18,570 --> 00:28:21,390 are designed really, for those of you who are feeling uncomfortable 603 00:28:21,390 --> 00:28:23,220 in the course throughout the semester, who 604 00:28:23,220 --> 00:28:26,460 feel like you benefit from hearing things multiple times, 605 00:28:26,460 --> 00:28:29,160 and just generally want more of a support structure in place 606 00:28:29,160 --> 00:28:29,850 for yourselves. 607 00:28:29,850 --> 00:28:33,750 These are purely optional, but they do exist to facilitate your success, 608 00:28:33,750 --> 00:28:37,290 and really lowering your level of stress in a course like this. 609 00:28:37,290 --> 00:28:41,220 In addition, office hours are a traditionally very popular aspect 610 00:28:41,220 --> 00:28:42,190 of this course. 611 00:28:42,190 --> 00:28:45,150 Now, I know this photo makes you almost want to go to office hours 612 00:28:45,150 --> 00:28:48,930 in this very Utopian kind of place known as the Science Center. 613 00:28:48,930 --> 00:28:51,930 Once you get to the basement, it doesn't look so green and fun anymore. 614 00:28:51,930 --> 00:28:52,890 [LAUGHTER] 615 00:28:52,890 --> 00:28:57,340 But a very popular, and a very common memory of this course, 616 00:28:57,340 --> 00:29:00,640 is, in fact, the time students spend alongside the teaching 617 00:29:00,640 --> 00:29:04,353 fellows in the so-called terminal room, room B14 of the Science Center. 618 00:29:04,353 --> 00:29:05,770 It's down the stairs, take a left. 619 00:29:05,770 --> 00:29:09,760 It's got a bunch of Linux computers these days, Macintosh computers, PCs. 620 00:29:09,760 --> 00:29:12,910 And essentially, we hold weekly office hours for many hours a week 621 00:29:12,910 --> 00:29:16,060 down there, so that you can really have some one on one, 622 00:29:16,060 --> 00:29:21,040 hands on assistance with the current problem set, or most anything else. 623 00:29:21,040 --> 00:29:25,240 Also this year, what we will be offering on an experimental basis-- 624 00:29:25,240 --> 00:29:28,150 is what The Crimson apparently broke the story this morning 625 00:29:28,150 --> 00:29:30,520 before we even had a chance to announce it-- 626 00:29:30,520 --> 00:29:32,090 the virtual office hours. 627 00:29:32,090 --> 00:29:34,510 So thanks to technology, not only will we 628 00:29:34,510 --> 00:29:37,720 be able to help you in the basement of the Science Center one on one, 629 00:29:37,720 --> 00:29:41,920 we'll also be offering what we dubbed "virtual office hours" in the course's 630 00:29:41,920 --> 00:29:43,750 virtual terminal room this year. 631 00:29:43,750 --> 00:29:47,500 Essentially, what this will mean is that you from your laptop or desktop 632 00:29:47,500 --> 00:29:49,450 computer, whether you're in your dorm room, 633 00:29:49,450 --> 00:29:52,780 whether you're away on vacation perhaps, or whether you're at brain break 634 00:29:52,780 --> 00:29:57,250 in the dining hall, you can log in to what's effectively, a fancy chat room, 635 00:29:57,250 --> 00:30:00,730 that has not only the ability for teaching fellows, a.k.a. moderators, 636 00:30:00,730 --> 00:30:05,050 to chat with you, either via text based instant messaging interface, or even-- 637 00:30:05,050 --> 00:30:07,780 though I think this is of questionable efficacy-- 638 00:30:07,780 --> 00:30:10,360 VoIP, voice over IP, using microphones. 639 00:30:10,360 --> 00:30:13,870 You can communicate in two ways with your teaching fellow privately, 640 00:30:13,870 --> 00:30:17,770 but we can also share control of, and observe your own screen. 641 00:30:17,770 --> 00:30:22,020 So you can think of this sort of like CS50's tech support with problem sets. 642 00:30:22,020 --> 00:30:23,770 You'll be able to stay in your dorm rooms. 643 00:30:23,770 --> 00:30:25,930 We'll be able to stay in our dorm rooms or homes, 644 00:30:25,930 --> 00:30:30,220 and nonetheless, meet online to assist you with these problem sets. 645 00:30:30,220 --> 00:30:33,250 It will be up to you guys to really dictate 646 00:30:33,250 --> 00:30:36,580 where we allocate our resources-- more to the traditional Science Center 647 00:30:36,580 --> 00:30:39,290 office hours, or more to these virtual office hours. 648 00:30:39,290 --> 00:30:41,620 You are as much a part of this experiment 649 00:30:41,620 --> 00:30:44,030 as we are over the course of the semester. 650 00:30:44,030 --> 00:30:46,660 So we'll demonstrate that in a future lecture, 651 00:30:46,660 --> 00:30:51,820 and let you loose on it for the course's first problem set. 652 00:30:51,820 --> 00:30:54,760 So administratively, are there any questions 653 00:30:54,760 --> 00:30:58,210 before we survey the material and such that you'll 654 00:30:58,210 --> 00:31:01,620 be exposed to in this course? 655 00:31:01,620 --> 00:31:02,300 Anything at all? 656 00:31:02,300 --> 00:31:02,800 Yes? 657 00:31:02,800 --> 00:31:06,120 AUDIENCE: How long are these problem sets? 658 00:31:06,120 --> 00:31:07,870 DAVID MALAN: How long is each problem set? 659 00:31:07,870 --> 00:31:12,400 I would say a typical student spends about 10 hours, maybe 15 hours, maybe 660 00:31:12,400 --> 00:31:15,160 five hours, on a given problem set. 661 00:31:15,160 --> 00:31:19,850 And there are eight of them spread over roughly 13 or 14 weeks of the semester. 662 00:31:19,850 --> 00:31:21,920 Other questions? 663 00:31:21,920 --> 00:31:22,420 No? 664 00:31:22,420 --> 00:31:25,660 OK, as with several courses here these days, this course 665 00:31:25,660 --> 00:31:28,360 is and will be filmed throughout the semester. 666 00:31:28,360 --> 00:31:32,890 Usually within 72 or 96 hours, videos and quick time formats, 667 00:31:32,890 --> 00:31:37,240 flash formats, NP3 formats, will be posted online via the course's website 668 00:31:37,240 --> 00:31:40,850 in the form of a podcast, and also in the form of the web page itself. 669 00:31:40,850 --> 00:31:42,023 So you can tune in that way. 670 00:31:42,023 --> 00:31:45,190 Tonight's lecture, for instance, if you have to duck out early for shopping, 671 00:31:45,190 --> 00:31:47,770 periods should be online around midnight or so tonight, 672 00:31:47,770 --> 00:31:52,330 and the same will be true with a 96 hour window in future lectures. 673 00:31:52,330 --> 00:31:56,470 It's also my philosophy with lectures and such that it is more 674 00:31:56,470 --> 00:31:59,860 of a distraction than anything-- certainly, for students like myself-- 675 00:31:59,860 --> 00:32:04,082 to be constantly scribbling notes for a 60 minute or a 90 minute lecture. 676 00:32:04,082 --> 00:32:06,790 Really, to the detriment, I think, of the intellectual experience 677 00:32:06,790 --> 00:32:10,840 of sitting in on class, and engaging, dare say, with the person 678 00:32:10,840 --> 00:32:13,090 at the podium who's asking and answering questions. 679 00:32:13,090 --> 00:32:16,420 So toward that end, one of the additional pieces of support structure 680 00:32:16,420 --> 00:32:19,570 we'll provide you with this semester, thanks to the teaching fellows, 681 00:32:19,570 --> 00:32:22,090 will be a canonical set of scribe notes, so 682 00:32:22,090 --> 00:32:25,660 to speak, whereby one of the teaching fellows each lecture will 683 00:32:25,660 --> 00:32:28,180 be responsible for producing an official, if you will, 684 00:32:28,180 --> 00:32:31,693 set of lecture notes that are not meant to take the place of your own notes 685 00:32:31,693 --> 00:32:32,860 that you might want to take. 686 00:32:32,860 --> 00:32:37,060 But are meant to alleviate you of the mental obligation, or the inclination, 687 00:32:37,060 --> 00:32:40,870 or the stress, of trying to scribble down absolutely everything that 688 00:32:40,870 --> 00:32:43,330 may be said, particularly when I or when lectures 689 00:32:43,330 --> 00:32:45,250 themselves tend to go a bit quickly. 690 00:32:45,250 --> 00:32:49,970 So know that, in addition, that support structure will be in place for you. 691 00:32:49,970 --> 00:32:53,680 So with that said, any questions? 692 00:32:53,680 --> 00:32:57,140 So what's on the agenda for the next several weeks? 693 00:32:57,140 --> 00:33:02,260 Well, in the course's first week, namely this Wednesday and Friday, 694 00:33:02,260 --> 00:33:06,250 will we introduce you right away to this world of programming. 695 00:33:06,250 --> 00:33:10,120 Ultimately, the course focus is on a language called C. It's C, 696 00:33:10,120 --> 00:33:14,170 and then C++, and nowadays, C#, that a lot of the programs on your own 697 00:33:14,170 --> 00:33:17,200 computers, particularly Windows computers, are written. 698 00:33:17,200 --> 00:33:19,870 And it's in C that the course's focus ultimately is. 699 00:33:19,870 --> 00:33:22,120 In the beginning, though, we're going to introduce you 700 00:33:22,120 --> 00:33:23,500 to the idea of programming. 701 00:33:23,500 --> 00:33:27,130 And the concepts underlying programming, without the distraction of what you'll 702 00:33:27,130 --> 00:33:31,790 quickly come to appreciate or abhor, as parentheses and semicolon, 703 00:33:31,790 --> 00:33:34,750 and what on first glance, is otherwise fairly arcane syntax. 704 00:33:34,750 --> 00:33:38,200 And what we'll introduce instead, in just the first week of the course, 705 00:33:38,200 --> 00:33:41,680 is a programming environment, a graphical programming environment, 706 00:33:41,680 --> 00:33:42,820 known as Scratch. 707 00:33:42,820 --> 00:33:46,600 Scratch essentially will allow you to program, quote unquote, 708 00:33:46,600 --> 00:33:49,690 merely by dragging puzzle pieces of sorts, 709 00:33:49,690 --> 00:33:53,050 that are color coded and shaped according to the type of logic 710 00:33:53,050 --> 00:33:54,100 that they implement. 711 00:33:54,100 --> 00:33:56,560 This is perhaps best explained for today's purposes 712 00:33:56,560 --> 00:33:58,540 by way of a little demonstration. 713 00:33:58,540 --> 00:34:03,040 What I've brought along with us today is, for instance, one Scratch project 714 00:34:03,040 --> 00:34:04,900 that a former student of mine implemented. 715 00:34:04,900 --> 00:34:07,690 And this is your 5 second overview of what the interface looks 716 00:34:07,690 --> 00:34:10,719 like on Wednesday and Friday when we dive into programming 717 00:34:10,719 --> 00:34:12,250 in the context of this thing. 718 00:34:12,250 --> 00:34:14,860 But I'm going to go ahead and play what, for this student, 719 00:34:14,860 --> 00:34:18,610 was the outgrowth of just one week of class, the semester she 720 00:34:18,610 --> 00:34:21,610 took this class, a two day introduction to Scratch. 721 00:34:21,610 --> 00:34:23,800 And this is what she submitted for her homework. 722 00:34:23,800 --> 00:34:26,980 It's in the spirit of an animation, or a fairy tale. 723 00:34:26,980 --> 00:34:29,020 And that there is her first bug. 724 00:34:29,020 --> 00:34:30,502 [LAUGHTER] 725 00:34:30,502 --> 00:35:10,476 726 00:35:10,476 --> 00:35:10,976 [SCREAMS] 727 00:35:10,976 --> 00:35:13,466 [LAUGHTER] 728 00:35:13,466 --> 00:35:24,460 729 00:35:24,460 --> 00:35:27,190 All right, so what was most gratifying for us, 730 00:35:27,190 --> 00:35:29,290 the teachers, that semester was this student 731 00:35:29,290 --> 00:35:30,940 really had not programmed before. 732 00:35:30,940 --> 00:35:33,220 And again, after just a few hours of time 733 00:35:33,220 --> 00:35:36,760 with us introducing Scratch, and introducing some basic programming 734 00:35:36,760 --> 00:35:40,090 constructs like loops, and conditions, and statements, 735 00:35:40,090 --> 00:35:43,360 and Boolean expressions, was she able to come back just a few days later 736 00:35:43,360 --> 00:35:45,550 and present this to her class. 737 00:35:45,550 --> 00:35:47,800 The nice thing about Scratch then is that, certainly, 738 00:35:47,800 --> 00:35:50,020 for those among you who have never programmed before, 739 00:35:50,020 --> 00:35:52,853 and are just a little bit daunted by the idea of this course at all, 740 00:35:52,853 --> 00:35:55,570 is that in just a week's time, you, too, will be 741 00:35:55,570 --> 00:35:57,760 submitting something along these lines. 742 00:35:57,760 --> 00:36:01,600 Subject entirely to your own creativity, we make no requirements really 743 00:36:01,600 --> 00:36:04,392 as to what the thing must do, look like, or sound like. 744 00:36:04,392 --> 00:36:06,100 But you'll have this experience, we hope, 745 00:36:06,100 --> 00:36:09,610 very early on of actually producing an interactive, 746 00:36:09,610 --> 00:36:11,560 or a dynamic, computer program. 747 00:36:11,560 --> 00:36:15,250 And the fact of the matter is with more traditional languages like, Java, C, 748 00:36:15,250 --> 00:36:20,440 C++, you just can't get to GUEs, graphical user environments, 749 00:36:20,440 --> 00:36:25,480 or really sexy software, in just one semester because there's so many steps 750 00:36:25,480 --> 00:36:29,170 that you must take before getting to a point of sophistication where you can 751 00:36:29,170 --> 00:36:33,100 implement that stuff in these more traditional languages. 752 00:36:33,100 --> 00:36:35,530 For this next demonstration of Scratch, and this teaser 753 00:36:35,530 --> 00:36:40,240 of where we're going next week, I do need a volunteer from the crowd. 754 00:36:40,240 --> 00:36:43,042 The catch is-- it's a non-speaking role, so you don't 755 00:36:43,042 --> 00:36:44,500 need to feel that kind of pressure. 756 00:36:44,500 --> 00:36:46,520 The catch is you will appear here on film. 757 00:36:46,520 --> 00:36:50,087 And so to satisfy the lawyers and such, we need you to sign your name away, 758 00:36:50,087 --> 00:36:52,420 just saying that you realize that you were filmed today, 759 00:36:52,420 --> 00:36:53,920 and you're OK being on the internet. 760 00:36:53,920 --> 00:36:55,710 [LAUGHTER] 761 00:36:55,710 --> 00:36:57,460 I don't know-- Thomas is not volunteering. 762 00:36:57,460 --> 00:36:59,350 So we do need one volunteer. 763 00:36:59,350 --> 00:37:02,620 If ever there were way to prove to your parents that you go to class, 764 00:37:02,620 --> 00:37:03,250 come on down. 765 00:37:03,250 --> 00:37:04,300 [LAUGHTER] 766 00:37:04,300 --> 00:37:05,410 Come on. 767 00:37:05,410 --> 00:37:10,120 So this program here simply requires that-- this was a student-- 768 00:37:10,120 --> 00:37:12,520 Carlos was his name-- who implemented essentially 769 00:37:12,520 --> 00:37:15,490 a soccer program, whose functionality will largely speak for itself. 770 00:37:15,490 --> 00:37:19,120 The only instructions you need to know are that as soon as I click go, 771 00:37:19,120 --> 00:37:22,250 you're going to simply want to click with the mouse on the player himself. 772 00:37:22,250 --> 00:37:24,280 And he will run and kick the ball. 773 00:37:24,280 --> 00:37:24,950 So here we go. 774 00:37:24,950 --> 00:37:26,852 I'm starting the program. 775 00:37:26,852 --> 00:37:29,310 So go ahead and just click the player with the mouse button 776 00:37:29,310 --> 00:37:30,910 when you want him to kick the ball. 777 00:37:30,910 --> 00:37:32,495 And the goal is, of course, to hit the target. 778 00:37:32,495 --> 00:37:34,287 VOLUNTEER: Oh, so it's like a timing thing? 779 00:37:34,287 --> 00:37:35,170 DAVID MALAN: Exactly. 780 00:37:35,170 --> 00:37:36,122 [WHISTLE BLOWS] 781 00:37:36,122 --> 00:37:38,502 782 00:37:38,502 --> 00:37:40,257 [LAUGHTER] 783 00:37:40,257 --> 00:37:40,882 [WHISTLE BLOWS] 784 00:37:40,882 --> 00:37:41,465 VOLUNTEER: Oh! 785 00:37:41,465 --> 00:37:42,688 [LAUGHTER] 786 00:37:42,688 --> 00:37:50,000 787 00:37:50,000 --> 00:37:51,000 DAVID MALAN: Keep going. 788 00:37:51,000 --> 00:37:52,035 This is harder than it looks. 789 00:37:52,035 --> 00:37:52,776 [WHISTLE BLOWS] 790 00:37:52,776 --> 00:37:53,748 AUDIENCE: Oh! 791 00:37:53,748 --> 00:37:56,525 792 00:37:56,525 --> 00:37:57,150 [WHISTLE BLOWS] 793 00:37:57,150 --> 00:37:57,650 Oh! 794 00:37:57,650 --> 00:38:02,923 795 00:38:02,923 --> 00:38:04,090 DAVID MALAN: Yeah, one more. 796 00:38:04,090 --> 00:38:07,370 797 00:38:07,370 --> 00:38:10,670 [WHISTLE BLOWS] 798 00:38:10,670 --> 00:38:12,710 OK, a round of applause, if we could. 799 00:38:12,710 --> 00:38:16,063 [CLAPPING] 800 00:38:16,063 --> 00:38:18,435 801 00:38:18,435 --> 00:38:21,310 You know, I heard those comments, and yeah, it's a non-speaking role, 802 00:38:21,310 --> 00:38:24,280 but you try hitting a moving target with 200 people watching you. 803 00:38:24,280 --> 00:38:25,958 It's probably not the easiest thing. 804 00:38:25,958 --> 00:38:28,000 This last demonstration that I wanted to give you 805 00:38:28,000 --> 00:38:31,360 also is a teaser as to where we're going in just one week's time, 806 00:38:31,360 --> 00:38:32,830 starting this coming Wednesday. 807 00:38:32,830 --> 00:38:36,160 Was actually submitted by one of the teaching fellows. 808 00:38:36,160 --> 00:38:39,520 We sort of, as a "get to know each other" exercise this past week, 809 00:38:39,520 --> 00:38:42,400 all produced our own Scratch program, so that we, too, 810 00:38:42,400 --> 00:38:44,680 would experience the same experience that you're 811 00:38:44,680 --> 00:38:46,430 about to have over the coming week. 812 00:38:46,430 --> 00:38:51,970 This was a favorite of mine, but I love them all, of course. 813 00:38:51,970 --> 00:38:53,290 [LAUGHTER] 814 00:38:53,290 --> 00:38:55,660 And this one is not interactive, but also 815 00:38:55,660 --> 00:38:58,870 speaks to the dynamism and the capabilities 816 00:38:58,870 --> 00:39:01,330 of this particular environment that you, yourselves, will 817 00:39:01,330 --> 00:39:02,980 be unleashed on coming this Wednesday. 818 00:39:02,980 --> 00:39:06,310 [MUSIC PLAYING] 819 00:39:06,310 --> 00:39:44,947 820 00:39:44,947 --> 00:39:48,384 [MUSIC - THE WEATHER GIRLS, "IT'S RAINING MEN"] 821 00:39:48,384 --> 00:40:33,645 822 00:40:33,645 --> 00:40:36,900 DAVID MALAN: So we'll make that available for download on the website. 823 00:40:36,900 --> 00:40:38,210 [LAUGHTER] 824 00:40:38,210 --> 00:40:41,710 [CLAPPING] 825 00:40:41,710 --> 00:40:47,210 826 00:40:47,210 --> 00:40:49,610 All right, so that's just week 0. 827 00:40:49,610 --> 00:40:51,240 What are we doing the next week? 828 00:40:51,240 --> 00:40:54,860 So it's in week 1 of this course-- computer scientists, of course, 829 00:40:54,860 --> 00:40:57,650 count starting at zero-- is the good joke there-- 830 00:40:57,650 --> 00:41:00,410 we'll introduce C. So come next Monday, will you 831 00:41:00,410 --> 00:41:03,080 be introduced to this more traditional language of C, which 832 00:41:03,080 --> 00:41:06,643 certainly, on first glance, is, in fact, more arcane say, than the puzzle pieces 833 00:41:06,643 --> 00:41:08,060 you've just glimpsed a moment ago. 834 00:41:08,060 --> 00:41:10,685 But it's literally in the second week of this course that we'll 835 00:41:10,685 --> 00:41:14,030 dive in to programming in a more traditional sense, 836 00:41:14,030 --> 00:41:17,270 with a lot of those constructs, if you will, out of the way in a fun 837 00:41:17,270 --> 00:41:18,710 and engaging environment. 838 00:41:18,710 --> 00:41:21,830 In week 2 of the course, we'll continue our exploration of C, 839 00:41:21,830 --> 00:41:25,640 and the functionality thereof, how to program at a more sophisticated level. 840 00:41:25,640 --> 00:41:28,400 But we'll do this, as will be the case throughout the semester, 841 00:41:28,400 --> 00:41:29,810 in an interesting domain. 842 00:41:29,810 --> 00:41:33,140 We'll look at cryptography, the art of concealing data, 843 00:41:33,140 --> 00:41:35,780 among other topics in that same context. 844 00:41:35,780 --> 00:41:40,160 In week 3, we'll look at some of the more canonical program 845 00:41:40,160 --> 00:41:41,540 problems in computer science. 846 00:41:41,540 --> 00:41:45,800 Among them, searching, a la Google, and sorting with which you can actually 847 00:41:45,800 --> 00:41:50,450 expedite things like searches, figuring out-- not out of, say, 12 or 16 doors-- 848 00:41:50,450 --> 00:41:53,540 but out of a billion doors, behind which is a number 849 00:41:53,540 --> 00:41:55,550 that you actually want to find. 850 00:41:55,550 --> 00:41:58,910 In week 4, we'll talk about what it means to debug software, 851 00:41:58,910 --> 00:42:00,973 and what it means to design software well. 852 00:42:00,973 --> 00:42:03,140 We'll come back to that particular picture, but that 853 00:42:03,140 --> 00:42:05,720 is quite literally a picture of a bug-- 854 00:42:05,720 --> 00:42:07,190 dare say, the first bug. 855 00:42:07,190 --> 00:42:09,890 In week 5 of the course will look similarly 856 00:42:09,890 --> 00:42:13,250 in more technical detail at what it means to run a program. 857 00:42:13,250 --> 00:42:15,290 When you double click that icon on your desktop, 858 00:42:15,290 --> 00:42:18,110 what exactly is going on inside of the computer? 859 00:42:18,110 --> 00:42:21,470 What is going on with the so-called memory and RAM? 860 00:42:21,470 --> 00:42:26,780 We'll also look at a rather sexy context for this exploration 861 00:42:26,780 --> 00:42:31,910 of digital forensics, recovering data, undeleting files, and introducing you 862 00:42:31,910 --> 00:42:34,310 to those kinds of ideas, as well. 863 00:42:34,310 --> 00:42:36,680 In week 6 of the course will we begin to look at what 864 00:42:36,680 --> 00:42:38,850 are typically called data structures. 865 00:42:38,850 --> 00:42:41,510 There are entire courses on data structures at Harvard. 866 00:42:41,510 --> 00:42:46,190 What we'll do is scratch the surface at some of the most useful 867 00:42:46,190 --> 00:42:49,280 of them, with some of the most common of them, most canonical of them. 868 00:42:49,280 --> 00:42:51,920 Among them tries, and hash tables, and heaps, 869 00:42:51,920 --> 00:42:54,390 binary search trees, and linked list. 870 00:42:54,390 --> 00:42:56,490 It's OK if none of these topics make sense to you 871 00:42:56,490 --> 00:42:59,030 now, if you've never heard of them, that's precisely the point of being 872 00:42:59,030 --> 00:43:00,050 here in the first place. 873 00:43:00,050 --> 00:43:02,360 In week 7, we'll look at data compression. 874 00:43:02,360 --> 00:43:06,710 How do you take a very big file, a very big essay, for instance, 875 00:43:06,710 --> 00:43:09,350 and compress it down into something much smaller? 876 00:43:09,350 --> 00:43:11,360 We'll look, therefore, at Huffman coding. 877 00:43:11,360 --> 00:43:12,980 We'll back to this idea of bits. 878 00:43:12,980 --> 00:43:16,610 How can you actually start writing individual zeros and ones 879 00:43:16,610 --> 00:43:21,920 to files on disks in the interests of using as few bits as possible? 880 00:43:21,920 --> 00:43:24,090 In week 8, we'll take a look underneath the hood, 881 00:43:24,090 --> 00:43:27,290 so to speak, at what's going on when you actually run a program, 882 00:43:27,290 --> 00:43:30,470 not in terms of memory, but in terms of its CPU. 883 00:43:30,470 --> 00:43:33,680 We'll look at an assembly language that is 884 00:43:33,680 --> 00:43:38,000 known as Ants, which is about as low level as you can get to a computer's 885 00:43:38,000 --> 00:43:42,590 actual CPU before the language itself becomes just zeros and ones. 886 00:43:42,590 --> 00:43:45,350 In week 9, we'll look at a topic known as secure coding. 887 00:43:45,350 --> 00:43:47,300 Ask me in about 10 weeks time-- or better 888 00:43:47,300 --> 00:43:49,730 yet, tell me in 10 weeks time-- why there's 889 00:43:49,730 --> 00:43:52,620 a picture of a canary on this slide. 890 00:43:52,620 --> 00:43:56,570 And in week 10, what we introduce one of the topics that's new to the course 891 00:43:56,570 --> 00:44:00,440 this semester, which is an introduction to web based programming and PHP. 892 00:44:00,440 --> 00:44:03,290 So in addition to Scratch and Ants and C, 893 00:44:03,290 --> 00:44:07,430 we'll also introduce a popular language called PHP this semester. 894 00:44:07,430 --> 00:44:11,330 Those of you who have log into Facebook obsessively-- 895 00:44:11,330 --> 00:44:13,640 and perhaps are logged into Facebook right now-- 896 00:44:13,640 --> 00:44:14,525 might recognize-- 897 00:44:14,525 --> 00:44:16,190 [LAUGHTER] 898 00:44:16,190 --> 00:44:18,620 --might recognize that early on-- and I believe, 899 00:44:18,620 --> 00:44:22,070 to this day-- was the language in which Mark Zuckerberg wrote Facebook. 900 00:44:22,070 --> 00:44:24,350 SQL is the language in which the database 901 00:44:24,350 --> 00:44:27,110 queries of Facebook and innumerable other websites 902 00:44:27,110 --> 00:44:30,120 use to actually get at databases worth of information. 903 00:44:30,120 --> 00:44:33,410 So by week 10 in this course, will you know not just how to make a web page, 904 00:44:33,410 --> 00:44:37,160 since we'll spend perhaps 20 minutes on that particular process, but actually 905 00:44:37,160 --> 00:44:41,330 how to create dynamic, interactive database driven websites. 906 00:44:41,330 --> 00:44:43,647 In week 11 of the course, we will figure out 907 00:44:43,647 --> 00:44:45,980 what to do based on the kinds of questions and interests 908 00:44:45,980 --> 00:44:48,080 that arise over the course of this semester. 909 00:44:48,080 --> 00:44:52,700 And in week 12, we have a fun and exciting conclusion, if you will. 910 00:44:52,700 --> 00:44:54,830 But it's really in the course's problem sets 911 00:44:54,830 --> 00:44:57,590 that you'll get your hands the dirtiest with this material. 912 00:44:57,590 --> 00:45:01,250 And it's in the problem sets completion that you'll gain, I think, 913 00:45:01,250 --> 00:45:02,480 the most from this course. 914 00:45:02,480 --> 00:45:05,450 To give you a sense of what kinds of topics and domains 915 00:45:05,450 --> 00:45:08,360 will be looking at this semester-- the first one, 916 00:45:08,360 --> 00:45:13,638 problem set 0, will quite simply be, go make your own Scratch project. 917 00:45:13,638 --> 00:45:16,430 We'll lay out just a few basic requirements, but for the most part, 918 00:45:16,430 --> 00:45:19,670 you are free to design anything that comes to mind, 919 00:45:19,670 --> 00:45:23,180 and anything within the boundaries of your own imagination. 920 00:45:23,180 --> 00:45:25,580 In problems set 1, in a couple of weeks time, 921 00:45:25,580 --> 00:45:28,610 will we introduce C and a bit of Linux to you. 922 00:45:28,610 --> 00:45:31,130 In problem set 2, we'll look at cryptography. 923 00:45:31,130 --> 00:45:35,660 And you'll actually implement programs that both incipher and decipher data 924 00:45:35,660 --> 00:45:37,250 that you might want to keep secure. 925 00:45:37,250 --> 00:45:42,740 Problem set 3 will implement the game of 15, which is a name I didn't even 926 00:45:42,740 --> 00:45:44,360 know what it applied to. 927 00:45:44,360 --> 00:45:47,520 This is that silly, little plastic game with all the numbers, 928 00:45:47,520 --> 00:45:50,280 and you can move the numbers up and down and left and right. 929 00:45:50,280 --> 00:45:52,922 And there's 15 numbers, and one of the squares is empty. 930 00:45:52,922 --> 00:45:54,630 And you try to move those numbers around. 931 00:45:54,630 --> 00:45:56,280 Apparently, it's called the game of 15. 932 00:45:56,280 --> 00:45:58,470 And that's what we've been doing the course has 933 00:45:58,470 --> 00:45:59,887 been doing for the past few years. 934 00:45:59,887 --> 00:46:02,820 You, yourselves, will implement that in the language known as C. 935 00:46:02,820 --> 00:46:06,960 In problem set 4, we'll look at this sexy art of digital forensics. 936 00:46:06,960 --> 00:46:09,480 Odds are, we will hand to one of the teaching fellows 937 00:46:09,480 --> 00:46:13,485 a digital camera and a memory card, have them go take some photos around campus. 938 00:46:13,485 --> 00:46:15,360 They'll then turn the camera back over to me. 939 00:46:15,360 --> 00:46:19,530 I will accidentally erase the camera's memory card, turn it over to you 940 00:46:19,530 --> 00:46:21,870 all, and you're going to recover those photos for us. 941 00:46:21,870 --> 00:46:27,630 And you'll also search through some data sets for hidden information of sorts. 942 00:46:27,630 --> 00:46:32,370 Problem set 5, you will be challenged with implementing a faster spell 943 00:46:32,370 --> 00:46:34,120 checker than your classmates. 944 00:46:34,120 --> 00:46:37,470 And we'll turn this into a bit of a contest, whereby to test your code, 945 00:46:37,470 --> 00:46:41,040 we'll give you some software that essentially runs your spell 946 00:46:41,040 --> 00:46:44,490 checker against some fairly large predetermined inputs, 947 00:46:44,490 --> 00:46:48,210 and then will post to the course's website automatically, say, the top 10 948 00:46:48,210 --> 00:46:52,860 or top 20 students' results, so that we can see exactly who is outputting 949 00:46:52,860 --> 00:46:54,840 the most efficient code at that point. 950 00:46:54,840 --> 00:46:57,030 In problem set 6, we'll implement what's called 951 00:46:57,030 --> 00:47:00,360 "huff and puff," the Huffman coding algorithm, with which you, yourselves, 952 00:47:00,360 --> 00:47:03,810 will implement software with which to compress and decompress 953 00:47:03,810 --> 00:47:05,310 files on your own computers. 954 00:47:05,310 --> 00:47:08,640 And finally, in problem set 7 will you actually 955 00:47:08,640 --> 00:47:13,470 implement your own dynamic database driven website. 956 00:47:13,470 --> 00:47:16,050 It, though, is the final project that we dare 957 00:47:16,050 --> 00:47:19,180 say is ultimately the most gratifying aspect of this course. 958 00:47:19,180 --> 00:47:22,890 The problem sets come to a conclusion a week or so before winter break, 959 00:47:22,890 --> 00:47:26,280 and the final project is not due for a month or so thereafter. 960 00:47:26,280 --> 00:47:29,730 And it's out of the final project that some of the most amazing and most 961 00:47:29,730 --> 00:47:32,490 interesting projects come from this course, 962 00:47:32,490 --> 00:47:35,970 not only from students who came in with a background in AP Computer Science, 963 00:47:35,970 --> 00:47:39,330 but those who have quite literally never programmed before. 964 00:47:39,330 --> 00:47:43,440 Here, too, it will be completely up to you what kind of program-- 965 00:47:43,440 --> 00:47:47,340 software programs you produce as part of your final project. 966 00:47:47,340 --> 00:47:50,775 But the gauntlet we throw down before you today ultimately-- 967 00:47:50,775 --> 00:47:53,400 and we'll remind you of throughout the course of the semester-- 968 00:47:53,400 --> 00:47:57,660 is ideally, to solve an actual problem, to make something useful, 969 00:47:57,660 --> 00:48:00,480 or best yet, somehow impact campus. 970 00:48:00,480 --> 00:48:02,850 For the next four months, as you walk around campus, 971 00:48:02,850 --> 00:48:06,840 and have conversations with folks in your extracurricular activities, 972 00:48:06,840 --> 00:48:11,190 in your dorm rooms and such, identify problems that might exist on campus, 973 00:48:11,190 --> 00:48:14,220 or opportunities for software based solutions. 974 00:48:14,220 --> 00:48:17,550 Just a few years ago, there was not a very good Facebook 975 00:48:17,550 --> 00:48:18,990 on Harvard College's campus. 976 00:48:18,990 --> 00:48:21,060 And a student, who you've all heard of, went 977 00:48:21,060 --> 00:48:24,690 about solving that problem himself, having just had a background 978 00:48:24,690 --> 00:48:27,930 in just a few courses in programming. 979 00:48:27,930 --> 00:48:30,810 The Just a few years ago-- and I'm trying 980 00:48:30,810 --> 00:48:34,170 to spin this without it being attached to my name-- just a few years ago, 981 00:48:34,170 --> 00:48:37,620 there was no way for students to look up shuttle schedules dynamically 982 00:48:37,620 --> 00:48:41,700 on computers, or via text message, or via AOL Instant messaging. 983 00:48:41,700 --> 00:48:44,470 So some student who awhile back had taken CS50, 984 00:48:44,470 --> 00:48:47,830 went about implementing software that solved that particular problem. 985 00:48:47,830 --> 00:48:50,640 So the spin that we'd like to give to the final project this year-- 986 00:48:50,640 --> 00:48:53,850 and you have four months to figure out what problem you're going to solve, 987 00:48:53,850 --> 00:48:56,400 and what contribution you're going to make to this campus-- 988 00:48:56,400 --> 00:48:57,810 and not to set the bar too high. 989 00:48:57,810 --> 00:49:00,900 You can also just make a simple game or a program that's 990 00:49:00,900 --> 00:49:02,460 perhaps less ambitious than that. 991 00:49:02,460 --> 00:49:06,030 But we want to [INAUDIBLE] you early on in the semester is to keep an eye out 992 00:49:06,030 --> 00:49:09,352 for opportunities, processes that you can automate, 993 00:49:09,352 --> 00:49:11,310 programs you can write for your student groups, 994 00:49:11,310 --> 00:49:14,340 and ultimately, give a little something back based only 995 00:49:14,340 --> 00:49:16,470 on your own experience in this course. 996 00:49:16,470 --> 00:49:20,252 Ultimately, it would be a wonderful thing if your software-- not only say, 997 00:49:20,252 --> 00:49:21,960 garners the attention, I dare say, of say 998 00:49:21,960 --> 00:49:26,650 The Crimson, a few of you-- but to make something that outlives this course. 999 00:49:26,650 --> 00:49:28,363 So should you take computer science 50? 1000 00:49:28,363 --> 00:49:30,780 I will stick around, as will some of the teaching fellows, 1001 00:49:30,780 --> 00:49:32,100 for the next short while. 1002 00:49:32,100 --> 00:49:35,790 But today, tomorrow, and Thursday, in this same room from 4:00 to 5:00 1003 00:49:35,790 --> 00:49:38,610 PM, we'll be here to answer questions, address concerns. 1004 00:49:38,610 --> 00:49:41,870 Otherwise, I will see you on Wednesday. 1005 00:49:41,870 --> 00:49:51,040