ECS20.A — Discrete Math for Computer Science
Syllabus — Phillip Rogaway — Winter 2022


There are two sections of ECS20 this term; this is the webpage for Section A, taught by Phillip Rogaway.

Unless otherwise modified by COVID-mitigation policies, our lectures will meet

while discussion sections, usually led by teaching assistant Zane Rubaii, will meet on Mondays:

Discussion sections begin the first day of instruction: Monday, January 3. You should go.

At least most weeks, you may go to any discussion section you like; it needn’t coincide with the section you registered for.

The current assumption is that the first week is online and that the remainder of the term is in-person. This could change at any time, You can get to the needed Zoom URL from Canvas or from the course homepage.

I expect students to show up to class, and to come ready to learn and think. My past experience suggests that students do poorly if they routinely miss class, thinking they’ll get it from watching a video later on. They don’t.

For any online classes, whether lecture or discussion sections, I ask you to be present, to pay attention, and to leave your camera on. Also remember to turn your microphone off (unless you are asking or answering a question). For this class you need to have a (working, forward-facing) camera on your computer, or else get a separate webcam.


My advice if you are on the waiting list is to attend all classes and do all work, and there is a good chance you will get in. At the time of this writing there are a total of 18 people on the waiting list. I will do what I can to increase the enrollment cap. I routinely see high attrition as well.


My name is Phillip Rogaway. My office is in 3009 Kemper. But I rarely go there these days, when Kemper has become another sad, virtually abandoned building.

For routine ECS20 questions, please use Piazza, not email. If you have something to discuss that doesn’t concern others, you can email me via Canvas or send an email to with ECS20 (spelled solid) in your subject heading.

Teaching Assistants and Graders

We have two excellent TAs for the term, both highly experienced graduate students: We are also fortunate to have two superb undergraduate graders:

Office Hours

The time and location for everyone’s office hours will be maintained in a google doc linked to from the course homepage. Office hours might change from week to week; always check for last minute changes. We will offer a mix of in-person and online office hours. In-person hours may be outdoors.

A requirement for attending online office hours is to turn on your camera and leave it on.

Course Webpage

The course webpage is where you’ll find assignments, the lecture list, and so on. It is a click away from my personal homepage. The course webpage is not on Canvas.

Lecture Capture

Lectures will be recorded. For in-person lectures the recordings run from three minutes before to two minutes after the scheduled lecture time (that is, 4:37p-6:02p). Be aware that you might be captured on camera (audio or video) throughout this entire time.


My objectives for this class are for you to:


Unlike previous years, this term I am anticipating that most students will buy and use a book. It’s an interactive zyBook: The zyBook is an experiment. What was appealing about it was that the explanatory text is relatively terse. And I like that it records how much students do on the site, which gives me a way to credit students who are putting in effort, even if that effort isn’t so obvious from their scores. What I do not like is the idea that students would spend hours sitting in front of a screen. If you do not want to use an interactive book (either because you prefer a conventional book, or because you do not need any book), that is fine.

Other Possible Texts

If you prefer a conventional book, I am fond of: Other books I like, but books that are not like textbooks, include:

The most “standard” book for a course like ours is Kenneth Rosen’s Discrete Mathematics and Its Applications. But the book is too long (over 1000 pages), and I think it’s boring in a way that the books I am recommending above are not. Still, there should be some reason that the book is so popular. Old editions (I intentionally pointed to an edition that isn’t the latest) should be just as good as the latest edition, and are cheaper.


Your total for this term will be the maximum of your score according to two different methods—one method intended for those who diligently use the zyBook one method intended for those who do not.

Method-0 (not using the zyBook):

  1. Homework: 30% (about eight problem sets)
  2. Quizzes: 20% (about four quizzes)
  3. Midterm: 20%
  4. Final: 30% (in-person final)

Method-1 (using the zyBook):

  1. Homework: 25% (about eight problem sets)
  2. Quizzes: 15% (about four quizzes)
  3. Midterm: 15%
  4. Final: 30% (in-person final)
  5. zyBook: 15% (for spending time and doing the assigned participation activities)

I expect that the majority of students will use the zyBook and that the maximum will then come out with their Method-1 score being the higher.

Canvas isn’t clever enough to compute grades according to the method above, so please take what it does report with a grain of salt. I will have to download grades from Canvas and compute them with a spreadsheet.

For all zyBook assignments I filled in a nominal due date of the end of the term. You should consider the “real” date by which you should complete any reading the weekend after we’ve talked about the material. That said, zyBooks claims to have research that shows that students do best if they do the reading in advance of when it is covered in a class, not in arrears. I believe this is valid; do your best to read ahead of where I am at. My lectures will be more sophisticated than the zyBook material and reading ahead may help you follow the lectures. In addition, the material of Chapters 1–4 is all tightly connected, so you would be especially well served by blasting through those four chapter just as fast as you can.

With either grading method you can get up to 5% extra credit. I will give extra credit for particularly high or useful engagement on Piazza, or for reading a significant piece of one of the books I mentioned above (other than the zyBook) and writing a brief report on it.

In our class, no late homeworks are accepted. Please don’t ask. On the other hand, I will drop your lowest homework score, which minimizes the impact of a short-term illness or network catastrophe. If most or all of the quizzes end up being done in class, then I will do the same for them.

Departures from the published criteria will be made if I see a good reason. In general, I am not an automaton, and look at your record before I assign a grade.

To get a passing grade in the class, you must take and pass the final exam. I determine what passing is. But it’s pretty low. A lot of students struggle, but the ones that have been working diligently usually get a C- or better.

For your final and midterm I will permit a single page of notes, typed or handwritten on one side.

On homeworks, explain your answers well. The quality of the writeup counts and will be an integral part of the score. I expect that only a proper subset of homework questions will be graded.

If you believe that a homework or exam problem was misgraded you may resubmit it for regarding. Homework resubmissions are done through Gradescope. Make sure you understand the written solutions first. Ask for a regrade only if there is an actual error with the grading; don’t just be fishing for additional points. Regrade requests must be submitted by 5:00 pm on the Friday after homeworks are returned.

If you miss the midterm for an excused medical or personal reason, I will either give you an oral exam to replace it or I will move those points to the final exam. If you miss the final exam for an excused medical or personal reason, and you were doing passing work before, then I will give you an incomplete and you will have have to take a final exam early in Spring quarter.


I strongly encourage you to typeset your problem-set solutions using LaTeX. For me, good writing includes everything from the high-level organization of our ideas to the visual appearance of each printed symbol and word. In fact, I have a hard time separating these things.

Overleaf is an easy-to-use tool that makes LaTeX more of a WYSIWYG experience. You can use it and avoid having to install LaTeX locally. Not that that is hard. Overleaf is also effective in supporting collaborative work on a LaTeX-typeset document.

All of the above said, this term I will not require the use of LaTeX. One reason is that I admired a couple of student's beautiful handwritten cheat sheets at the final exam. They were works of art. This made me remember my algebra teacher’s handwritten book, which was stunning. Most of all, though, I changed my mind because Section-B is only going to encourage the use of LaTeX, and Prof. D'Souza communicated some good reasons for this choice. I didn’t think it necessary for our classes to differ in this particular dimension.

If you’re not going to use LaTeX, typeset solutions are still encouraged. Decent results can be had by inserting LaTeX fragments into a Word or Google Docs document (you may need to use an equation editor or an add-on to do this).

If you are going to handwrite solutions, they must be neat. Follow the same convention as with LaTeX, putting only one solution per page. Scan in your solution with a scanner rather than taking a photograph with a phone. Turning in a cellphone-photograph of a messy homework is the equivalent of turning in dirty pages torn out of a spiral notebook, and it will suffer a major point deduction, if it is graded at all. Graders will be instructed to give only 1 point (to mark the work as submitted) for anything that is hard to read.

Low Numerical Scores

Recently I have been seeing some students freak out because their raw scores are lower than they’re used to. Concretely, in Winter 2022, the median grade on the homeworks, midterm, final, and overall were: 79%, 72%, 44%, and 62%, respectively. The final exam saw students with less than 5% and students with more than 95%. In classes like ours there is a huge range in students.

While I prefer to see median final exams above 50%, I didn’t find any of the above numbers alarming. So why are students freaking out when they get what seems to me to be a respectable score on something? I believe what has happened is that, of late, many students have come to assume that grading will follow some sort of “standard scale” along the lines of 90%–100% for A grades, 80%–90% for B grades, 70%–80% for C grades, 60%–70% for D grades, and 0%–60% for F grades. I have never followed such a grading scale, nor is it the norm for any challenging math, CS, or physics class at any good university. In fact, at a school like UCD, the only way to follow such a grading scale and get a conventional distribution on grades would be to make classes extremely easy or to grade work that is mostly wrong as though it were mostly right. I won’t do either thing.

For our class there is no fixed grading scale. In the end, I study the scores, draw lines that make sense, and assign a distribution on grades in line with what other CS faculty are doing—despite a belief that what other faculty are doing is to assign highly inflated grades.

I do expect to see higher raw scores this term than last, by way of crediting zyBook participation, including some easier homework and exam questions, going a bit slower, and having more long-form answers on exams. These changes are in response to student evaluations from last term, plus discussions with colleagues.

One reason that raw scores tend to be low in my classes is that I am not a fan of generous partial credit. In CS and math, another word for almost right is wrong. While that might be a bit of an over-simplification, the basic sentiment is valid. We are in a domain where things are or are not correct. I prefer you to get half the questions fully correct than to get all the questions “half correct”—whatever the quoted phrase could possibly mean. I hope that our grading will reflect that sentiment.

A Hard Class

Many students report that their prior math classes didn’t adequately prepare them for ECS20. The problem, I fear, is that primary and secondary math education has become ever more procedural and intent on propelling kids towards calculus. ECS20 is more like what one sees in AMC 8/10/12 competitions than what you see in typical middle school or high school math class—or, for that matter, in a college calculus class.

If you’re feeling ill-prepared, don’t fret. Spend time with the zyBook, which you should not find very hard. Spend time at office hours. Find a good study partner. Try the tutoring available through the CS Club. Spend time thinking under a tree (or, given the weather, at a nice coffee shop). Know too that I teach a more challenging class than my peers. It has always been important to me never to bore or talk down to students, even the top ones. I make sure to teach classes that I myself would have liked to take. To me, a difficult, well-organized class is part of what it means to treat a student with respect.

If you think you need an easier ECS20 class then I suggest you wait and take the class with another instructor. Also, if you failed my class and are retaking it with me, I strongly advise you to wait, if necessary, and take it with somebody else.

There’s also a new class that you might be able to take instead of ECS20: ECS17. It’s being taught for the first time this term. ECS17 is intended to provide a gentler introduction to discrete math for non-CS/CSE majors. If you’re not planning to be a math, CS, or CSE major, but ECS20 is a requirement for you, you might be able to petition your department to let you take ECS17 instead. Other departments haven’t had time yet to recognize ECS17 as an alternative to ECS20 in their requirements, but we are hoping they will.

Prohibition on Use of Phones and Laptops

Your phone needs to be off and in your bag before entering the classroom, whether for lecture or discussion. This requirement applies starting ten minutes before lecture or discussion begins, and continues until you walk out the door. Within class, phones may not be consulted to check the time, email, or anything else.

While this requirement may sound draconian to some, it is supported by a body of research that demonstrates how extreme is the distraction from that stupid phone of yours, even when it is on your person and not in use. It is also supported by anecdotal experience, which suggests that classes evolve a different and better dynamic when the classroom is made a phone-free space.

Laptops are similarly disallowed in lecture or discussion. You may take notes on a tablet or flat-folded laptop as long as it is used for no other purpose.

Violating these rules will result in a misconduct report to OSSJA, which, in turn, will likely result in your failing the class. Breaking classroom rules is treated like other forms of academic misconduct.

Masks Required — N95 Masks Preferred — Importance of Fit

When we meet in person, I want you not only wearing a mask, but wearing a good one that properly fits you. No bandannas, buffs, etc.. A mask worn below your nose is the same as not wearing a mask (although it does broadcast that extra bit of contempt for those around you). A mask at the tip of your nose, or with a visible gap on each side of your nose, is nearly non-functional. A mask that you are repeatedly adjusting needs to be promptly replaced by one that fits.

Seriously, this is not that hard. Millions of health care professionals do this everyday, and with less than an hour of training. I do understand that most of you have not received even that. How outrageous is it that, nearly two years into this pandemic, masks were never distributed to the population, nor has there ever been an education campaign about how to wear one?

If someone around you is not wearing a decent, properly fitted mask, please ask them to fix the problem. I will bring extra masks to class. Failing to properly wear an appropriate mask is considered a form of academic misconduct and may result in a referral to OSSJA.

Given what we now know about COVID-19 transmission—that it is primarily spread through aerosols—people should wear better masks than most do. A single layer or two-layer cloth mask is primarily decorative. At the very least, you should wear a medical-grade paper mask: the box should say ASTM-1, ASTM-2, or ASTM-3. While such a mask, properly worn, will reduce aerosol transmission, it won’t do so nearly as well as a properly fit N95 mask. These are no longer in short supply, and I suggest that everyone find and learn to wear an unvalved N95 mask. Watch some video(s) about how to put one on, take it off, and check the fit.

After trying lots of N95 masks, my personal favorites are the 3M Aura models. They are available from from Amazon, from The Home Depot, and from other online merchants. The were previously available from the campus bookstore; I hope they are coming back. Instructions for how to put these on can be found here or here.

A good alternative to N95 masks is a KF94 mask, the Korean standard. They provide an alternative option for fit.

Room ventilation is also key for minimizing the spread of infectious respiratory diseases. According to the campus, all of the rooms used for ECS20 are ventilated with 100% outside air (whence the MERV rating is irrelevant for disease transmission). Yet publicly available data does not include the rate at which air exchanges occur, so it may not be possible to assess how well ventilated the classrooms really are. Beyond vaccinations, the key thing that you have much control over is the mask you select and how you wear it.

If you haven’t watched the science develop in this area, I might point you to: Airborne transmission of respiratory viruses (27-Aug-2021); A paradigm shift to combat indoor respiratory infection (14-May-2021); How did we get here: what are droplets and aerosols and how far do the go? A historical perspective on the transmission of respiratory infectious disease (15-Apr-2021); and COVID tranmission and risk reduction (24-Aug-2021) (from Prof. Chris Cappa, a local expert on this topic).


We will use Piazza for announcements and questions. Your email should already have been added to Piazza.

Problem Sets, Gradescope

The problem sets are to a large extent intended to help develop creative problem-solving skills. I intend for you to find many of the problems challenging. Don’t let that frustrate you. I can’t solve most of my problems, either.

If you can’t solve a problem, please indicate what you’ve tried and where the difficulty lies: know what you know and be clear about it. Never try to bullshit an answer you can’t figure out. Explain yourself clearly. An unjustified answer is not an answer.

Your writeups should be clear, terse, and neat. Aim for elegance. Never turn in a first-draft; that works no better in math or computer science than it does in English. Don’t be surprised to lose points if you provide a “correct” solution with a poor writeup.

I encourage that homeworks be typeset with LaTeX. Observe basic mathematical conventions that too many student seem blind to, like going into math mode for mathematics ($n$ instead of n), $\lg n$ and not $lg n$, and so on. Pen-and-ink illustrations you wish to include may be drawn neatly by hand and then integrated into the pdf. Microsoft Word generates ugly results and is not used by academic computer scientists, mathematicians, chemists, physicists, ….

Writeup your solutions with one solution per page (the LaTeX command \newpage will skip to the next page). I do not expect any problems to take more than a page, so normally problem i should appear on page i. Regardless, when you upload your problem set to Gradescope you must tell it the pages on which each problem appears. If you fail to do this then Gradescope will not display your solution when we are grading the problem, and the problem will not get graded.

Unless indicated otherwise, homeworks are due at 5:00 pm every Wednesday. The first problem set will be due Jan 12, and they will keep on coming. No late homeworks will be accepted. Turn in homeworks online, using Gradescope. To avoid disappointment in the face of networking issues, never wait until the last minute to upload your work. Instead, you can repeatedly overwrite your uploaded solution as it matures.

If you get ideas for a homework problem from someone other than your named partner (see below), a TA, or the professor, you need to acknowledge them in your writeup.


You may work closely with a single other student on a homework and turn in a joint writeup. Either you or your partner turns in the assignment—not both. At submission time you must identify both authors to Gradescope; do not forget to do this. Just writing the names as text within the uploaded pdf won’t do it.

If you do work with a partner on a problem set, the manner in which you do so may have a profound impact on how much you get out of the homeworks, and out of class. Here’s what I suggest. First, work on each problem on your own. Only after should you discuss it with your partner. Then write up a truly joint solution. Both people should work on refining the writing. Note that writing up joint work with a partner might take longer than doing it on your own, but it could result in better quality.

Overleaf is not only an online LaTeX editor but also a collaboration tool. Google Docs also supports effective collaboration.

Academic Misconduct

On homeworks you may not consult any problem set solution, at any institution, for any similar problem. You should not seek out problems like ones I ask you on the web. If you accidentally encountered such materials, just acknowledge it in your writeup and that’ll be fine. If you interacted with anyone other than a named partner on a homework problem, identify them on your solution. If you collaborate with someone extensively on a homework then they are your partner, you should turn in a single writeup for the two of you. Acknowledge any book (other than the zyBook) or webpage that proved directly useful.

The final will be closed book/devices/neighbors. Bring a picture ID. Any device that can be powered off must be powered off for the duration of the exam. You may not sit next to someone you know. In that sentence, “next to” means to your left, right, directly behind, or diagonally behind; and “someone you know” means that they’re a friend or someone you’ve worked with (in this class or some other), or someone you have some arrangement with concerning cheating. If you see anything inappropriate during an exam, please report it immediately to me or a TA.

Uploading course materials for further redistribution to sites like Chegg or Course Hero is an egregious instance of academic misconduct. Similarly, you may not download any class-related material from Chegg, Course Hero, or the like. Actually, to keep things simple, let me simply assert that any use of Chegg or CourseHero in connection with our class is defined as academic misconduct.

As explained earlier, any use of a phone in our class is also defined as academic misconduct.

UCD’s Code of Academic Conduct describes expectations common to all courses. I report all instances of suspected academic misconduct to OSSJA. If you are guilty of academic misconduct, either by your own admission or by a finding from OSSJA, I will assign you an F grade in the course. This is in addition to whatever OSSJA does. I call this the misconduct-implies-F policy. I myself started this policy, which has become the default policy across the CS Department.

Who am I?

I was trained in theoretical computer science at UCB and then MIT. While I never much liked computers, I loved science, puzzles, and writing. I have worked since the late 1980s in cryptography—the mathematical study of secure communication. I am known for a style of cryptography characterized by definitions and proofs, but for problems that spring directly from cryptographic practice. I try to address these problems in ways that directly inform cryptographic practice. It’s a branch of cryptography that I co-invented with my colleague Mihir Bellare (UCSD).

I care about more than my research. Beginning in 2004 I redesigned and started teaching ECS188, our ethics-and-technology class. Since that time, about half my teaching has been technical, the other half, ECS188. While I was never exactly sanguine about what all my colleagues and I were doing, in recent years I have become highly skeptical about the value and prospects for CS. We have turned our machines into powerful instruments for surveilling people and reshaping their behavior to serve a few people’s ends. We have vastly oversold the upside of CS, and have egregiously downplayed the costs. For those of you who want to save the world with machine learning (ML), crypto-magic, or whatever other hyped techno-wonder you’ve been studying, try hard to disentangle the dream—and your self interest—from the reality.

A strange fact about me is that I am profoundly face blind. Never changing your hair, clothes, or seat might help me to figure out who you are. Introducing yourself to me repeatedly is a kindness. I would also request that you not wear scented products near me. I find the smells overwhelming and asthma-inducing. For the same reason, I will also have a problem being near you if you’re a smoker. But hopefully none of you would engage in anything so vile.

Closing remark

This class may provide you your first glimpse of theoretical computer science. It might even provide you your first experience having to think like a mathematician. I hope you like what you see. But with your enthusiasm in check. Learning to think logically and “outside the box” is something good. Adding to the ranks of amoral computer scientists is not.


Rogaway’s homepage