1 00:00:00,000 --> 00:00:00,097 2 00:00:00,097 --> 00:00:02,430 DAVID MALAN: --idea of abstraction, but we started here. 3 00:00:02,430 --> 00:00:04,200 Here now we might represent in a computer 4 00:00:04,200 --> 00:00:05,533 our inputs with zeros and ones-- 5 00:00:05,533 --> 00:00:07,697 DOUG LLOYD: So at this point we've discussed inputs 6 00:00:07,697 --> 00:00:09,780 and we've discussed outputs, but we haven't really 7 00:00:09,780 --> 00:00:13,230 looked at what that black boxes is of algorithms. 8 00:00:13,230 --> 00:00:17,790 And we're about to take several hundred Harvard students 9 00:00:17,790 --> 00:00:22,124 and run them through an algorithm to see how they perform. 10 00:00:22,124 --> 00:00:25,290 DAVID MALAN: Yeah, this was, I think, inspired by a former professor of mine 11 00:00:25,290 --> 00:00:30,300 in an algorithms class, I think years ago, where you have everybody stand up 12 00:00:30,300 --> 00:00:33,126 and you then have everyone take on the number one 13 00:00:33,126 --> 00:00:35,250 so that everyone is effectively counting themselves 14 00:00:35,250 --> 00:00:37,260 at that moment in time in unary notation, 15 00:00:37,260 --> 00:00:40,140 and then you have half of the audience sit down 16 00:00:40,140 --> 00:00:43,590 after pairing off briefly with one other member of the audience 17 00:00:43,590 --> 00:00:47,827 so that all of the ones combine to twos, but then half of them sit down. 18 00:00:47,827 --> 00:00:48,660 And then you repeat. 19 00:00:48,660 --> 00:00:51,119 So then you go to four, and then eight, and then 16. 20 00:00:51,119 --> 00:00:52,410 DOUG LLOYD: At least in theory. 21 00:00:52,410 --> 00:00:53,601 DAVID MALAN: Yeah. 22 00:00:53,601 --> 00:00:56,100 I think in 10 years of teaching CS50 I'm not sure we've ever 23 00:00:56,100 --> 00:00:57,969 taken an accurate attendance11 24 00:00:57,969 --> 00:00:59,010 DOUG LLOYD: Well, great-- 25 00:00:59,010 --> 00:01:00,210 DAVID MALAN: --because every year then you can say, 26 00:01:00,210 --> 00:01:02,615 the bug, well, I guess that's our first bug. 27 00:01:02,615 --> 00:01:05,489 DOUG LLOYD: Exactly, now they have a lesson about bugs. 28 00:01:05,489 --> 00:01:07,560 Behind the scenes what's actually happening here, 29 00:01:07,560 --> 00:01:09,809 I think it was actually me this year, we were actually 30 00:01:09,809 --> 00:01:14,240 counting everybody, literally like, 1, 2, 3, 4, like pointing, 31 00:01:14,240 --> 00:01:16,860 and I think maybe there were a couple of us actually 32 00:01:16,860 --> 00:01:21,681 counting different areas of the room to see just how good the class compared 33 00:01:21,681 --> 00:01:22,180 here. 34 00:01:22,180 --> 00:01:25,140 DAVID MALAN: And that's actually a key detail that is very easy to forget, 35 00:01:25,140 --> 00:01:28,110 since there have been years where I forget to ask a member of the staff 36 00:01:28,110 --> 00:01:31,380 to also count because I'm a little too distracted or fazed to do it 37 00:01:31,380 --> 00:01:33,427 in real-time as well accurately. 38 00:01:33,427 --> 00:01:35,760 So I'm producer we've taken a tally from the whole room, 39 00:01:35,760 --> 00:01:38,780 after all of this effort, someone calls out something 40 00:01:38,780 --> 00:01:42,660 and I have nothing to compare it to, so preparation is the key to success 41 00:01:42,660 --> 00:01:43,750 with this demonstration. 42 00:01:43,750 --> 00:01:45,750 DOUG LLOYD: And the other key preparation detail 43 00:01:45,750 --> 00:01:49,525 is that you have a certain program open on your computer to handle-- 44 00:01:49,525 --> 00:01:50,233 DAVID MALAN: Yes. 45 00:01:50,233 --> 00:01:51,820 Now you're airing our dirty little secrets. 46 00:01:51,820 --> 00:01:52,940 DOUG LLOYD: --the final tally. 47 00:01:52,940 --> 00:01:55,023 DAVID MALAN: Yeah, no, I am not good at arithmetic 48 00:01:55,023 --> 00:01:57,940 in front of hundreds of people, are even tens of people. 49 00:01:57,940 --> 00:02:00,446 And so I've multiple times like just use my phone 50 00:02:00,446 --> 00:02:02,820 or used an old school calculator and typed in the number, 51 00:02:02,820 --> 00:02:05,670 but invariably I'll forget, did I just type a number and then plus 52 00:02:05,670 --> 00:02:07,920 or did I only type the number now I have to type plus, 53 00:02:07,920 --> 00:02:09,169 and if you hit plus twice it just messes-- 54 00:02:09,169 --> 00:02:10,289 DOUG LLOYD: Yeah, you mess up the whole thing. 55 00:02:10,289 --> 00:02:12,367 DAVID MALAN: So I use an old Linux terminal 56 00:02:12,367 --> 00:02:15,450 so I can actually see everything I've typed before actually hitting Enter, 57 00:02:15,450 --> 00:02:16,408 and that seems to help. 58 00:02:16,408 --> 00:02:18,540 DOUG LLOYD: And to me it's a useful tip, it kind of 59 00:02:18,540 --> 00:02:20,539 takes the air out of the demo at the last second 60 00:02:20,539 --> 00:02:23,661 if you can't show them just how buggy the implementation was. 61 00:02:23,661 --> 00:02:25,410 DAVID MALAN: But you have to remember too, 62 00:02:25,410 --> 00:02:29,370 that it's actually helpful to finish the algorithm with students, 63 00:02:29,370 --> 00:02:32,250 so invariably a number of students will be standing up 64 00:02:32,250 --> 00:02:34,650 because they're either too far, or too confused, or too-- 65 00:02:34,650 --> 00:02:34,890 DOUG LLOYD: Or too shy. 66 00:02:34,890 --> 00:02:37,410 DAVID MALAN: --socially uncomfortable to like actually pair off, 67 00:02:37,410 --> 00:02:39,390 so I just start calling out at the end to speed things up. 68 00:02:39,390 --> 00:02:40,110 All right, what's your number? 69 00:02:40,110 --> 00:02:40,650 What's your number? 70 00:02:40,650 --> 00:02:41,441 What's your number? 71 00:02:41,441 --> 00:02:43,770 And sort of manually combine people, and so that's 72 00:02:43,770 --> 00:02:45,700 why we end up fixing things at the end there. 73 00:02:45,700 --> 00:02:48,210 And there's [? Myles, ?] one of our own future teaching Fellows 74 00:02:48,210 --> 00:02:49,395 here pictured as a student. 75 00:02:49,395 --> 00:02:50,900 DOUG LLOYD: Indeed. 76 00:02:50,900 --> 00:02:51,454