Computer Science 109:
Computers in Our World

Fall 2017

Princeton University

David Dobkin

Computer Science Dept.

Welcome to COS 109; be sure to check this page during the semester for announcements

Problem sets and their solutions, labs and announcements will be posted on the web page.

Last year's midterm exam is here and solutions are are here

The solutions for this year's midterm are given here .

The solutions for this year's midterm are given here .

Last year's final exam is here and solutions are here , .

Office hours will be held on Thursday January 11 and Thursday January 18 from 1:30-3 in my office, room 419 of the computer science building.

There will be a review session on Thursday January 18 from 7:30-9, in room 007 of the Friend Center.

The final exam will be given at 9AM on Saturday January 20 in room 104 of the computer science building.

Lecture notes:    9/14    9/19    9/26    9/28    10/3    10/5    10/10    10/12 Notes    10/12 Slides    10/17    10/19    10/24    11/7    11/9    11/14    11/16    11/21    11/28    11/30    12/5    12/7    12/12    12/14   

Problem sets:    1         2         3         4         5         6         7         8        

Solutions:    1         2         3         4         5         6         7         8        

Labs:        1         2         3         4         5         6         7         8        

Course summary, schedule and syllabus   Office hours   Textbook   Problem Sets   Labs   Lateness Policy   Collaboration Policy   Exams and Grading

Course Summary

Computers, computing, and many things enabled by them are all around us. Some of this is highly visible, like laptops, phones, tablets and the Internet; much is invisible, like the computers in gadgets and appliances and cars, or the programs that fly our planes and keep our telephones and power systems and medical equipment working, or the myriad systems that quietly collect, share and sometimes leak vast amounts of personal data about us.

Even though most people will not be directly involved with creating such systems, everyone is strongly affected by them. COS 109 is intended to provide a broad high level understanding of how computer hardware, software, networks, and systems operate. Topics will be motivated by current events and concerns, and will include discussion of how computers are built and operate; what programming is and why it is hard; how the Internet and the Web operate; and how all of these affect security, privacy, property and other issues. We will also touch on fundamental ideas from computer science, and some of the inherent limitations of computers.

This course is meant for humanities and social sciences students who want to understand how computers and communications systems work and how they affect the world we live in. No prior experience with computers is assumed, and there are no prerequisites. COS 109 satisfies the QR requirement.

The labs are complementary to the lectures, though intended to reinforce the basic ideas. They will cover a spectrum of practical applications; two of the labs are a gentle introduction to programming in Javascript.

The course will have fundamentally the same structure as in previous years, but lectures, case studies and examples change every year according to what's happening. Stunning amounts of our private lives are observed and recorded by business and governments, mostly without our knowledge, let alone consent. Major companies like Apple, Amazon, Facebook, Google, and Microsoft are duking it out with each other on technical and legal fronts, and with a variety of governments. Skirmishes in the forever war between students and the entertainment industry affect Princeton students all the time. The careless, the clueless, the courts, the congress, and the criminal continue to do bad things with technology. What could possibly go wrong? Come and find out.


        Su Mo Tu We Th Fr Sa
Sep                     1  2  
         3  4  5  6  7  8  9
        10 11 12 13 14 15 16    first class
        17 18 19 20 21 22 23
        24 25 26 27 28 29 30    problem set 1 due 9/26;  lab 1 due 9/29

Oct      1  2  3  4  5  6  7    problem set 2 due 10/3;  lab 2 due 10/6
         8  9 10 11 12 13 14    problem set 3 due 10/10  lab 3 due 10/13
        15 16 17 18 19 20 21    problem set 4 due 10/17; lab 4 due 10/20
        22 23 24 25 26 27 28    in class midterm 
        29 30 31 

Nov               1  2  3  4    fall break 
         5  6  7  8  9 10 11    
        12 13 14 15 16 17 18    problem set 5 due 11/14;  lab 5 due 11/17
        19 20 21 22 23 24 25    
        26 27 28 29 30

Dec                     1  2    problem set 6 due 11/28; lab 6 due 12/1 
         3  4  5  6  7  8  9    problem set 7 due 12/5;  lab 7 due 12/8
        10 11 12 13 14 15 16    problem set 8 due 12/12; lab 8 due 12/15 ; last class
        17 18 19 20 21 22 23
        24 25 26 27 28 29 30

Weekly Flow

Tuesday: Class 1:30-2:50; Dobkin office hours 3:00-4:00; Problem Sets due 5:00
Wednesday: Sharma office hours 11:00-12:00 and 5:30-6:30
Thursday: Class 1:30-2:50; Dobkin office hours 3:00-4:00;
Friday: Labs due 11:59PM


This will evolve over the semester, so check it out from time to time.

Week 1: Sep 14:    Introduction to the course

Week 2a: Sep 19:    How does it work? What's inside the computer


Week 2b: Sep 21:    Guest lecture by Professor Ed Felten

Ed served as Deputy U.S. Chief Technology Officer in the Obama White House serving from June, 2015 to January, 2017. He will talk about that experience expanding upon what is covered in this interview .

Week 3: Sep 26, 28:    The shift from analog to digital; representing information in a computer

Problem set 1, due Sep 26
Lab 1: Operating systems, local and network file systems, a first web page, due Sep 29


Week 4: Oct 3, 5:    How does it work: What's in a computer

Problem set 2, due Oct3
Lab 2: HTML and web page design due Oct 5


Week 5: Oct 10, 12:    What the components are and how they are made; models of computation

Problem set 3, due Oct 10
Lab 3: Advanced HTML due Oct 13

Week 6: Oct 17, 19:    Algorithms and programming languages

Problem set 4, due Oct 17
Lab 4: Graphics due Oct 20

Week 7a: Oct 24 :    programming; Javascript


Week 7b: Oct 26:    midterm exam
A review session will be scheduled prior to the exam.

[fall break]

Week 8 and 9a : Nov 7, 9, 14:    Software systems: Operating systems, file systems, the cloud.

Problem set 5, due Nov 14


Weeks 9b and 10a: Nov 16, 21 :    Networks & communications, Internet

Lab 5: Introduction to Javascript / Programming fundamentals due Nov 17


Week 11: Nov 28, 30:    World Wide Web

Problem set 6, due Nov 28
Lab 6: More Javascript / user interfaces due Dec 1

Readings: Chapter 10 of Understanding the Digital World: The world wide web

Week 12a: Dec 5:    Encryption

Problem set 7, due Dec 5

Chapter 12 of Understanding the Digital World: Privacy and Security

Week 12b: Dec 7:    Privacy, Security and Big Data
Lab 7: Spreadsheets due Dec 8

Week 13: Dec 12, 14    Artificial Intelligence and Machine Learning

Problem set 8, due Dec 12
Lab 8: Privacy due Dec 15

[winter break]

Q/A session TBA

Date TBA:    Final exam
Note that the final exam date is set by the registrar and I am not allowed to make any individual arrangements. Take this into account when making travel plans. (The final exam dates are usually posted around midterm week.)
Registrar's Official Exam Schedule page.

Administrative Information

Professor: David Dobkin, 419 CS Building, 609-258-9907, Office hours are Tuesday and Thursday 3:00-4:00, or by appointment, or stay after class and we can chat.

Teaching Assistant: Gautam Sharma, gsharma@Princeton.EDU, Office hours are Wednesday 11-12 and Thursday 12:30-1:30 in room 010 Friend Center

We both respond quickly to email, so feel free to email questions outside of offic ehours.


Tuesday and Thursday, 1:30-2:50, Green Hall 0-S-6

Regular class attendance is required and class participation helps. Come to class having read the materials and be prepared to engage in class discussion.

Please, no laptops, phones or tablets except for taking notes and other class purposes. Before using a laptop in class, please consider these articles

and please do not use laptops or phones to answer email, text, visit facebook, etc. in class.

Textbook and Readings:

The text for the course is Understanding the Digital World, by Brian Kernighan, 2017.

Notes and readings will be posted online. The weekly readings beyond the text are for background, context, general education, and to spur class discussion. In general, you are not expected to know the detailed content of more technical material in these readings. You are expected to know everything we've covered in the text (essentially the whole book).

Problem sets:

Eight weekly problem sets, will be assigned. Problems are intended to be straightforward, reinforcing material covered in class and providing practice in quantitative reasoning, and should take 2-3 hours to complete.

Problem sets will be due by 5:00 PM Tuesday, typically one week after they are assigned. Turn in solutions in the box outside room 419 on the fourth floor of the CS building, or at class. Help on problem sets will be available during office hours or via email.


There will be eight labs to give hands-on practice in important aspects of computing. The labs are designed to be easily completed within 2-3 hours, if you have read through the instructions beforehand, which should take at most an hour. You can do the labs wherever you want -- in your dorm room, in campus clusters, ... -- but if you need assitance, there will be undergrad lab TAs available in the clusters in rooms 121 and 122 Lewis. These lab TAs will be there Monday through Friday from 7--11PM, Saturday from 3--7PM and Sunday from 5--11PM. Further information about the lab TAs is available here . If you will be using a campus cluster, check out this site for information. You will also want to ask a lab TA to help you get things set up initially.

To receive credit, students must complete labs by 1159PM Friday the week after they are assigned.

The timing of problem sets and labs is given in the syllabus and calendar above.

Lateness Policy:

In fairness to everyone, only minimal credit can be given for late submissions unless there are extraordinary circumstances, and in no case after solutions have been posted or discussed in class.

Nevertheless, everyone gets truly behind from time to time. In recognition of this, you are allowed one late submission for a lab and one late submission for a problem set (no more than 3 days late in each case). You must let us know ahead of time that you will be submitting late so we can keep track.

Collaboration Policy:

You are encouraged to collaborate on problem sets, but you must turn in separate solutions; the names of all collaborators must appear on each submission.

(This elaboration of the policy on collaboration is paraphrased from COS 126:) You must reach your own understanding of the problem and discover a path to its solution. During this time, discussions with friends are encouraged. However, when the time comes to write down the solution to the problem, such discussions are no longer appropriate -- the solution must be your own work, so you must work on the written assignment on your own. If you have a question, you can certainly ask friends or teaching assistants, but do not, under any circumstances, copy another person's work or present it as your own. This is a violation of academic regulations, for which the penalties are draconian.

Another way to look at this: If I ask you to explain how you got your answer, you will have no trouble doing so, because you understand the material completely.

As it is for problem sets, so it is for labs: collaboration to understand the material is encouraged, but the work you turn in has to be your own.


An open-book midterm examination will be given during midterm week. It will cover material presented and discussed in class and any relevant reading through the end of the fifth week of classes.

An open-book final examination will be given during the January exam period. It will cover all material presented and discussed in class throughout the semester and any relevant reading.

There will be a question and answer session before each exam. These are not meant to be an orderly review and are not a substitute for missed lectures, but they are a chance for you to ask questions about course material.

Sorry: no collaboration on the midterm or final.

Comments on Grades:

The problem sets, labs and midterm will be weighted equally in determining a final grade. Attendance and class participation will have a similar weight and the final exam will be weighted more heavily. Within this rubric, there will be some flexibility so that if e.g. you do poorly on the midterm but much better on the final exam, I will weight the final more heavily than usual, so a poor midterm grade is not fatal at all. But you must do acceptably well on the final.