Computer Science 109:
Computers in Our World

Fall 2024

Princeton University

Brian Kernighan

Computer Science Dept.
Sat Dec 14 06:30:04 EST 2024
I have mailed the exam to everyone. Let me know if it didn't arrive safely. Due back by 5pm on Thursday.

Summary of what we covered

Final exam cover page with instructions

23 final exam       23 answers             22 final exam       22 answers      

Problem sets, labs and announcements will be posted on this web page only.
You are responsible for monitoring this page.

Lecture notes:    9/4     9/9     9/11     9/16     9/18     9/23     9/25     9/30     10/2     10/7     10/9     10/21     10/23     10/28     10/30 11/4     11/6     11/11     11/13     11/18     11/20     12/2     12/4    

Problem sets:    1        2        3        4        5        6        7        8       

Labs:        1         2         3         4         5         6         7         8        

Office hours:    BWK: Mon and Wed after class; other in-person or Zoom times can be easily arranged.
                Siyeon Lee (sl4731) 4:00-6:00PM at the Firestone Library Collaboration Area (Zoom 96356142727)
                Tolulope Oshinowo (to6377): Tue 1-3 Friend 010, Thu 2-3 Zoom my/toluoshinowo
                Anna Konvicka (ak6206): Mon 3-5 after class; Friday morning Zoom (tentative)

Old stuff:    playlist     Google antitrust decision     Nvidia antitrust     survey     Gradescope     Lab 1 pages     Colormap     RGB names     Instagram and children     FTC on commercial surveillance     Lab 2 pages     Toy simulator     Lego Turing machine     Lab 3 pages     22 midterm       22 midterm answers       23 midterm       23 midterm answers       24 midterm answers       New Mersenne prime       Lab 6 books       Cryptogram       AES animation       ATM/ISBN calculator      

Quick links:    Course summary, schedule and syllabus       Textbook       Problem sets       Labs       Lateness policy       Collaboration policy       ChatGPT policy       Exams and grades

Course Summary

Computers, computing, and the many things enabled by them are all around us. Some of this is highly visible, like laptops, phones 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 reveal 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 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; programming and programming languages; the Internet and the Web; artificial intelligence and machine learning; cryptography; and how all of these affect privacy, security, property and other important 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 QCR requirement.

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

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 social networks, businesses and governments, mostly without our knowledge, let alone consent. Companies like Amazon, Apple, Facebook, Google and Microsoft are duking it out with each other on technical and legal fronts, and with governments everywhere. Shadowy groups and acronymic agencies routinely attack us and each other; their potential effect on things like elections and critical infrastructure is way beyond worrisome. The Internet of Things promises greater convenience at the price of much greater cyber perils. Large Language Models like ChatGPT have completely changed the way we think about artificial intelligence. The careless, the clueless, the courts, the congress, the crazies, and the criminal (not disjoint groups, in case you hadn't noticed) continue to do bad things with technology. What could possibly go wrong? Come and find out.

Schedule

	Su Mo Tu We Th Fr Sa
Sep	 1  2  3  4  5  6  7	first class
	 8  9 10 11 12 13 14	pset 1 due midnight Wed 11, lab 1 due midnight Sun 15
	15 16 17 18 19 20 21	pset 2, lab 2 due Wed 18, Sun 22
	22 23 24 25 26 27 28	pset 3, lab 3 (and so on)
	29 30
Oct	       1  2  3  4  5	pset 4, lab 4
	 6  7  8  9 10 11 12	open-book take-home midterm exam (no pset, no lab this week)
	13 14 15 16 17 18 19    fall break
	20 21 22 23 24 25 26	pset 5, lab 5
	27 28 29 30 31
Nov	                1  2	pset 6, lab 6
	 3  4  5  6  7  8  9	pset 7, lab 7
	10 11 12 13 14 15 16	pset 8, lab 8 (no more psets or labs after this)
	17 18 19 20 21 22 23    Thanksgiving
	24 25 26 27 28 29 30
Dec	 1  2  3  4  5  6  7	last class
	 8  9 10 11 12 13 14	Dean's date; open-book take-home final exam Dec 14-19
	15 16 17 18 19 20 21
	22 23 24 25 26 27 28
	29 30 31

Syllabus (contents and dates may be adjusted)

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

Sep 4:    Overview and introduction
Readings: (1) Introduction and Chapter 1 of Understanding the Digital World: What is a computer? (2) A famous 1945 Atlantic Monthly article by Vannevar Bush,
As we may think, is often cited as predicting the Internet and the web. How does Bush's "Memex" relate to Google and your computer? What did Bush get right 80 years ago, and what did he totally miss?

Sep 9, 11:    What's in a computer?
Readings: (1) Preliminary discussion of the logical design of an electronic computing instrument. Original article by Burks, Goldstine and von Neumann. (This is the second edition, in original formatting). The first page is a clear description of how computers are organized, though in archaic terminology. There's no need to read beyond that, though section 3 is also quite germane. (2) Sections 4 and 5 of Alan Turing's famous essay on whether machines can think, Computing machinery and intelligence, provide an alternative description of how machines operate, not nearly so detailed as von Neumann's. You might also see how well ChatGPT and friends do on his original Turing test.
Problem set 1, due Sep 11
Lab 1: HTML and web page design, due Sep 15

Sep 16, 18:    Representation of information
Readings: (1) Chapter 2 of Understanding the Digital World: Bits, bytes, representation of information.
Problem set 2, due Sep 18
Lab 2: Generative AI, due Sep 22

Sep 23, 25:    Inside the processor
Readings: (1) Chapter 3 of Understanding the Digital World: Inside the processor. (2) The original article on Moore's Law.
Problem set 3, due Sep 25
Lab 3: Graphics, due Sep 29

Seo 30, Oct 2: Software and algorithms   
Readings: Chapter 4 of Understanding the Digital World: Algorithms
Problem set 4, due Oct 2
Lab 4: Spreadsheets, due Oct 6

Oct 7, 9: Programming and programming languages   
Readings: (1) Chapter 5 of Understanding the Digital World: Programs and programming languages.
(2) There are endless Python tutorials. Do a bit of searching and exploration.
No lab or problem set this week.
Take-home midterm exam this week. Q/A session (probably) on Oct 6 (probably) at 4pm (probably).   

[Oct 14-20: fall break]

Oct 21, 23: Software systems   
Readings: Chapter 6 of Understanding the Digital World: Software systems.
Problem set 5, due Oct 23
Lab 5: Python, due Oct 27

Oct 30, Nov 1:    Intellectual property
Readings: (1) Sections 5.4 through 5.6 of Understanding the Digital World. (2) The first dozen or so pages of Google v. Oracle, the final [we hope] resolution of a decade-long case about software copyrights. (3) Chapter 7 of Understanding the Digital World; focus on the Python sections.
Problem set 6, due Oct 30
Lab 6: Python and NLP, due Nov 3

Nov 4, 6:    Communications: networks and the Internet
Readings: (1) Chapters 8 and 9 of Understanding the Digital World: Networking; The Internet. (2) Skim some of the Internet history papers. (3) Ed Felten's explanation of net neutrality.
Problem set 7, due Nov 6
Lab 7: AI and ML, due Nov 10

Nov 11, 13:    World Wide Web
Readings: (1) Chapter 10 of Understanding the Digital World: The world wide web. (2) The original technical paper describing Google. Skip the hard bits, but get the insights. Note the comments about advertising in Appendix A.
Problem set 8, due Nov 13
Lab 8: Privacy, due Nov 17

Nov 18:    Artificial intelligence and machine learning
Readings in UDW: (1) Chapter 11, Data and Information; (2) Chapter 12, Artificial Intelligence and Machine Learning.

Nov 25, 27:    Cryptography; compression and error detection
Readings: (1) Chapter 13 of Understanding the Digital World, Privacy and security. (2) New York Times Privacy Project

Dec 2, 4:    Blockchains and cryptocurrency. Wireless

[Reading period: Dec 7-14]

Q/A session some enchanted evening (somewhere)

Dec 14-19:    Take-home final exam during Dec 14-19

Administrative Information

Professor: Brian Kernighan, 311 CS Building, bwk@cs.princeton.edu.

Office hours: after class, or by appointment; just send mail

Lectures: Monday and Wednesday, 1:30-2:50, Friend 008

Regular class attendance is expected and class participation helps. Frequent absences are grounds for a failing grade regardless of other performance.

No laptops, phones or tablets are permitted in lectures except for taking notes and other class purposes. Regrettably, computers and phones appear to be primarily used for mail, chat, YouTube, Twitter, Google, solitaire, poker, eBay, Facebook, Instagram, WhatsApp, TikTok, Snapchat, and similarly compelling diversions, all of which distract you, your neighbors, and me. (Additions to this list are welcome; I can't keep up.)

Textbook and Readings:

The primary text for the course is Understanding the Digital World, second edition ("UDW"). Used copies are fine.

Notes and readings will be posted online. The weekly readings beyond the text are for background, context, general education, and/or entertainment; you are not expected to know the detailed content, but you should understand the basic ideas. Anything in UDW is fair game, however.

Problem sets:

Eight problem sets, together worth about 20 percent of the course grade, will be assigned. Problems are intended to be straightforward, reinforcing material covered in class and providing practice in quantitative reasoning, and should take 1-2 hours to complete.

Problem sets are due by midnight Wednesday, one week after they are assigned.

Labs:

Eight labs, together worth about 20 percent of the course grade, will 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, but if you need assistance, there are undergrad lab TAs who also support COS 126, 217 and 226. Further information about the lab TAs and clusters will be posted.

Labs are due by midnight Sunday of the week they are assigned.

Gradescope:

This semester, we will be using Gradescope to handle all pset and lab submissions. If you need to sign up for a Gradescope account, please use your @princeton.edu email address. If you are enrolled in this course, you should see COS 109 under "Your Courses" when you log into Gradescope using an account associated with your Princeton email.

You can also log in through Gradescope using your netid. Navigate to Gradescope.com, go to "Log in," and log in with school credentials (Princeton University NetID). This part is not as obvious as it could be.

Lateness policy:

In fairness to everyone, only reduced 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. For both labs and problem sets, heavy workloads in other classes don't count as "extraordinary," no matter how unexpected or important or time-consuming. I am also unsympathetic to the appeal that "this is my fifth class," since the same could be said of any one of your other classes.

If you do submit your work late, we will give you credit for it on this scale:

Regardless, you must turn in all problem sets and labs to pass the course.

If you find yourself in a tough situation, please let me know; help of various kinds is always available.

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.

ChatGPT and Generative AI policy:

Do not use ChapGPT and the like for problem sets unless they are an explicit part of the assignment. Otherwise, you may use ChatGPT et al to explain, summarize, illustrate, and similar ways that will help you learn the material better. But use them at your own risk. In my experience, these programs can be helpful in explaining concepts, they can often produce good "how-to" information, and they can generate code that is often correct. But they are sometimes bad at arithmetic, and they may produce confident but total nonsense. Your mileage may vary, of course, and the field is moving exceptionally fast. When in doubt, ask, and we'll talk about it. I do not want to preclude any mechanism that will help you to learn better.

Exams and grades:

An open-book take-home midterm examination will be given during the week before fall break. It will cover material presented and discussed in class and any relevant reading through the end of the fifth week of classes. It will be worth 20 percent of the course grade.

An open-book take-home final examination will be given during the final exam period. It will cover all material presented and discussed in class throughout the semester and any relevant reading. It will be worth about 35 percent of the course grade.

Sorry: no collaboration on exams.

There will be a question and answer session before each exam. Q/A sessions 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.

If 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; students who cannot answer even half the questions should not be surprised to get a D, and an F is not impossible, especially if other work is also inadequate.

Don't forget that P/D/F has three possible outcomes, only one of which is good. Attending lectures, paying attention, participating actively, turning work in on time, coming to office hours, studying for exams, and attending Q/A sessions will all help to avoid unpleasant results.