CS271: Discrete Methods in Computer Science (Spring 2013)
Most recent message posted:
- Class meets Tuesdays and Thurssdays from 2:00pm-3:20pm, in room
- There are two review sessions: Mondays and Fridays from
11:00am-11:50am, in rooms VKC 156 and GFS 116, respectively.
(Students may attend either (or even both) of the review sessions, but
if there are not enough seats, then precedence is given to students
enrolled in the particular section.)
- There are 6 sherpa sessions for small groups of students,
Monday 5:00-6:00, Monday 6:30-7:30, Tuesday 5:00-6:00, Wednesday
5:00-6:00, Wednesday 6:30-7:30, Thursday 5:00-6:00.
All are held in GFS 113. The
assignments of students to groups are
There will be one midterm, on Tuesday, March 12, during class time.
The midterm will be in MHP 101, which is different from our usual
The midterm will be open book, open notes. Make sure to bring a
The final exam will be on Thursday, May 9, from 2:00pm-4:00pm. The
location is our classroom, WPH B27.
The final exam will be cumulative, i.e., cover the material of
the entire semester. The final will be open book, open
notes. There will be no make up date for the final.
There will be several quizzes in class, which will be announced beforehand.
Homework will be assigned and graded.
The final grade will be calculated as 15% homeworks, 15% quizzes, 40% final exam,
30% midterm. Class participation, while strongly encouraged,
does not affect grades. (Neither does attendance, though
experience tells that attendance and participation correlate
highly with success in classes.) The grading will not be done to a
curve: the grading scale is given below.
Open laptops are strongly frowned upon in class.
The grading scale is given here. These are not curves or class
percentages, but your percentages. For instance, if the weighted
average percentage of your grades is 55%, then you get at least
a B. As indicated by the scale, the assignments, exams, and
grading will be fairly demanding; the scale reflects this.
Homework will be assigned roughly once per week, and graded.
Of all assignments, the worst one will be dropped in
calculating your grades. Homeworks are due in class on the date specified.
Each student can submit up to 3 homeworks up to one day late. Late
submissions should be made to a TA or instructor in office hours, no
later than office hours on the day after the due date. Submissions
more than one day late will not be accepted. Once 3 homeworks have been submitted
late, subsequent late submissions will not be accepted.
Three of the early homeworks will assign you in random groups of
three. For those homeworks, all members of the group will obtain the
same grade. Subsequent homeworks will be asking you to solve problems
individually. Read the policy below about what is and is not
appropriate collaboration behavior on homeworks.
Homeworks will from time to time contain "chocolate problems".
Chocolate problems do not affect your grade in the course.
They are intended to be significantly more challenging, for
students looking for a challenge. Chocolate problems will be marked
with a number of chocolate bars. Solutions that are (mostly)
correct will lead to the solvers getting that number of
Chocolate problems can be solved in groups of up to 3 students (who
will then share the chocolate). Chocolate problem submissions should be on
separate sheets of paper, as they will be graded by the instructor,
not the TAs/grader. Feel free to mark your preferred type of chocolate
with your submission, though we won't promise that we will meet all
Course Overview, Syllabus, Textbook, Prerequisites
The course covers the fundmantals of discrete mathematics as they
relate to computer science. Many of the problems computer scientists
are most frequently called upon to solve involve discrete structures
such as trees, graphs, and - even more fundamentally - natural numbers.
Furthermore, since execution of programs necessarily proceeds in
discrete time steps, to truly understand what it means for a computer
program to solve a problem correctly and efficiently, it is necessary
to have a solid understanding of the tools used in program analysis.
The topics that will be covered in depth in this class are:
- A brief review of basic objects: sets, sequences, sums, products, functions.
- Mathematical proofs. How to formally prove statements. Specific
focus will be given to the important techniques of induction and the
Pigeon Hole Principle.
- Mathematical logic: propositional and first-order. Their uses, and
formalization of proof rules.
- Big-O notation and algorithms analysis: correctness and runtime.
- Counting and Discrete Probability: Basic definitions, rules,
techniques, and applications.
- Graphs and (their special cases) Trees. Their uses and algorithms.
- Basic number theory. Applications (including cryptography) and Algorithms.
While each of these topics is important in its own right, the main
goal of the class is to familiarize students with a mathematical
mindset in thinking about problems, and the precision and
clarity of thinking promoted by proving mathematical statements.
The textbook is
The textbook is required. Many homework problems will be assigned from
the textbook. While the class will not always follow the order or
presentation style of the textbook, the textbook is very encyclopedic
and will be an excellent source of additional information.
Students can use older versions of the textbook if they so desire. The
material covered is essentially the same; however, the numbering
of chapters and exercises is different. It is the students'
responsibility to ensure that they solve the correct exercises.
- Kenneth Rosen: Discrete Mathematics and Its Applications (7th
edition). McGraw Hill
The (rough) syllabus for the course is as follows. Topics may be added
or removed depending on available time:
- What happens when you type a query into Google: How the topics of
this course relate to core CS.
- A review of the basics: sets, sequences, functions, sums,
products, and algorithms (Chapters 2 and 3.1).
- Propositional Logic, First-Order Logic and Basic Proof Techniques
(Chapter 1). [4 lectures]
- Proofs by Induction and Program Correctness (Chapter 5). [4 lectures]
- Pigeon Hole Principle (Chapter 6.2) [2 lectures]
- Big-O Notation and Runtime Analysis (Chapter 3) [2 lectures]
- Counting and Basic Discrete Probability (Chapters 6 and 7).
- Graphs and Trees (Chapters 10 and 11).
- Number Theory and applications (Chapter 4). [2 lectures]
Academic Integrity, Collaboration
All students are expected to maintain the utmost level of academic
integrity. Any attempts to cheat will lead to appropriate sanctions.
Please consult the
USC Student Conduct Code
for details on what is and is not appropriate, and for the possible consequences of
work from misuse by others as well as to avoid using another’s work as one’s own.
The class will have two types of homeworks.
Some of the early homeworks are explicitly group homeworks: for those, you
will be assigned random classmates to work with, and you can only submit
one solution for your entire group; all three will receive the same grade.
For other homeworks, you should follow the "Gilligan's
Island" rule. You are allowed to collaborate with your classmates as
a group of up to three students. However, you should not take any mementos
away from your collaboration meeting. (No paper notes, no typed-up notes
on your laptop, no photographs, etc.)
Your writeup will have to be entirely your own; you should not look at the
writeups of your classmates, either in your group or others.
You should also mark clearly the names of the classmates you collaborated
Between your group meeting and beginning your writeup, you should
let at least one hour elapse during which you pursue an activity entirely
unrelated to the class (such as watching "Gilligan's
Island"; hence the name).
If you need hints for problems, your instructor, TAs and sherpas will
be there to help you. It is never appropriate to search online (or in
books, etc.) for solutions to homework questions and try to pass them off
as your own work. That constitutes plagiarism.
- 5/13/2013: The course grades have been submitted, and are also shown
in Blackboard. The overall grade distribution was:
6 A+, 4 A, 8 A-, 15 B+, 14 B, 13 B-, 13 C+, 4 C, 7 C-, 6 D, 5F.
- 5/08/2013: The final exam will be in our classroom, WPH B27.
- 5/06/2013: After the final exam, David's office will be available for
exam viewing on 05/10 from 9:30-12:00 and 2:00-5:00.
You may also be able to view your exam on Monday, 05/13 from 1:30-4:00.
However, the latter may have to be canceled on short notice depending on
whether David's jury duty materializes. In that case, you wouldn't get to
view your exam. So to be safe, show up Friday.
For either day, you can designate a friend to view the exam on your
behalf, but you must send an e-mail to David ahead of time with the
- 5/02/2013: In preparation for the final exam, we will hold the
following extra office hours.
All of the TA office hours will be in SAL 219. David's office hours
will be in SAl 232. All sherpa office hours will be in RTH
- Monday, 1:00-2:00: Jay
- Monday, 2:00-3:00: Review session in ZHS 159
- Monday, 4:00-5:30: David
- Monday, 6:00-7:00: Brooke
- Tuesday, 10:00-11:00: Gene
- Tuesday, 12:00-1:00: Gene
- Tuesday, 2:00-3:30: Review Session in ZHS 159
- Tuesday, 4:00-5:00: Rhys
- Tuesday, 6:00-7:00: Brooke
- Wednesday, 10:00-12:00: Lian
- Wednesday, 1:00-4:00: David
- Wednesday, 5:00-7:00: Sina
- 5/01/2013: The Friday review session will be at the usual place. The
Monday review session will be held from 2:00-3:20pm in ZHS 159, instead
of the usual time.
On Tuesday, 05/07, we will have an additional review session from
2:00-3:20, also in ZHS 159.
- 4/30/2013: To make up for the missed office hours today, Gene will
hold additional office hours on Thursday (05/02) from 10:00-11:00.
- 4/29/2013: For a nice illustration of some graph-theoretic concepts,
check out this cartoon.
Also, this cartoon captures
quite aptly how to approach math.
- 4/29/2013: Homework 11 has been posted. It is
completely optional, and will not impact your grade.
If you submit it to David by 3:00pm on Friday (May 3), we will make every
effort to get you hopefully useful feedback by Tuesday, May 6.
- 4/22/2013: The fifth and final quiz will be held in class on
Thursday, 05/02, from 2:20-2:50. It will cover probability,
i.e., homeworks 9 and 10. Same policies as for past quizzes.
- 4/22/2013: Homework 10 has been posted. It is due
in class on Tuesday, 04/30/2013. It cannot be submitted late, as we
will be handing out sample solutions in preparation for the
- 4/18/2013: David will hold extra office hours Friday, 04/19, from
- 4/15/2013: Homework 9 has been posted. It is due
in class on Tuesday, 04/23/2013.
- 4/15/2013: The fourth quiz will be held in class on Tuesday, 04/23,
from 2:00-2:30. It will cover counting, i.e., homeworks 7 and 8. Same
policies as for past quizzes.
- 4/10/2013: As announced in class, you might enjoy participating in
the USC Programming Contest.
As a little extra encouragement for finding out that you do, everyone
who actually participates (i.e., shows up and stays) gets 30
extra-credit points that can be distributed over HWs per your preferences.
- 4/09/2013: Homework 8 has been posted. It is due
in class on Tuesday, 04/16/2013.
- 4/04/2013: The results of Quiz 3 have been posted on
Blackboard. The maximum score (out of 22) was 21, the
minimum was 0, and the average was around 8. All regrade
requests should go directly to David.
- 4/04/2013: The results of Homework 4 have been posted on
Blackboard. The maximum score (out of 165) was 136, the
minimum was 51, and the average was around 105. All regrade
requests should go to Lian.
- 4/01/2013: Homework 7 has been posted. It is due
in class on Tuesday, 04/09/2013.
- 3/25/2013: The third quiz will be held at the beginning of class
on Thursday, 3/28. It will cover Homeworks 5 and 6. Same rules
as for previous quizzes.
- 3/13/2013: Since we have been talking a bit about sorting
algorithms, you may get a kick out of this
xkcd cartoon of sorting algortihms.
In particular, the description of Quicksort may look familiar ...
- 3/13/2013: The grades for the midterm have been posted on Blackboard.
The maximum score (out of 37) was 36.5, the minimum was 0,
and the average and median around 19.
The midterm will be returned in class on Thursday, 03/14.
Any regrade requests should go straight to David.
If your score was below 14, you should arrange to see David in office
hours or at some other time.
- 3/05/2013: The results of Homework 3 have been posted on
Blackboard. The maximum score (out of 141) was 133, the
minimum was 74.5, and the average was around 106. All regrade
requests should go to Gene.
- 3/03/2013: Homework 6 has been posted. It is due
in class on Thursday, 03/14/2013.
- 2/26/2013: Homework 5 has been posted. It is due
in class on Tuesday, 03/05/2013. This homework is individual (though you
are allowed to collaborate so long as you follow the Gilligan's Island
- 2/14/2013: Due to Presidents' Day on Monday (02/18), we'll have
the following schedule changes:
- All Monday Sherpa sessions are canceled. In order to earn the
Sherpa Session credit for HW4, if you are in Monday sherpa
sessions, please attend on Monday, 02/25. Alternatively, you
can attend any other sherpa session in the week of
- The Monday Review session is canceled. Instead, we will have a
review session on Tuesday, 02/19, at 5:00pm in room
SLH200. Alternatively, you are welcome to attend the
review session this Friday (2/15).
- 2/13/2013: The second quiz will be held at the beginning of class on
Thursday, 2/28/2013. Same rules as for Quiz 1.
- 2/13/2013: Homework 4 has been posted. It is due
in class on Thursday, 02/21/2013. It must be solved in assigned groups;
look up the team assignments.
(This will be the last homework with assigned groups.)
- 2/13/2013: I have posted the Dilbert
Cartoon I mentioned in class.
- 1/31/2013: The grades for Homework 2 have been posted on the
The minimum score (out of 115 possible) was 47, the maximum was 96,
and the mean and median were around 80.
- 2/11/2013: We have a location for our midterm (on 3/12). It will be
held in MHP 101.
- 2/08/2013: The Spiked Math comic has another
of if-then misunderstandings in real language.
- 2/06/2013: Homework 3 has been posted. It is due
in class on Thursday, 02/14/2013. It must be solved in assigned groups;
look up the team assignments.
- 1/31/2013: The grades for Homework 1 have been posted on the
The minimum score (out of 132 possible) was 53, the maximum was 127,
and the mean and median were around 116.
- 1/30/2013: You may enjoy this
Spiked Math Comic which puts
function and set notation to good use. (Also hover your mouse over the Psi
at the bottom.)
- 1/27/2013: The midterm has been scheduled. It will be on Tuesday,
3/12/2013, during class time. The location may be different from
the lecture; if so, it will be announced in class and on the web
1/27/2013: The first quiz will be held at the beginning of class on
Tuesday, 02/05/2013. It will last approximately half an hour.
It is closed book, and will cover the material of homeworks 1 and 2.
- 1/25/2013: This article on the
stable marriage problem may interest some of you.
See also the Supplementary Exercises 31-36 at the end of Chapter 3.
And some of you may see this in CS303.
But mostly, it's just a fun algorithmic problem with actual practical
application (it's used for matching med school graduates to residencies in
- 1/23/2013: Homework 2 has been posted. It is due
in class on Thursday, 01/31/2013. It must be solved in assigned groups;
look up the team assignments.
If you're curious about how the teams were generated, you can look at the
For the next two homeworks, I'll use seeds 3 and 4 with the same program.
- 1/17/2013: We just learned that all Sherpa meetings will be in GFS 113.
Check the group assignments to find
your meeting time. Sherpa sessions will start on 1/22/2013.
- 1/16/2013: Homework 1 has been posted. It is due
in class on Thursday, 01/24/2013. It should be solved individually (modulo
the class rules for individual homework.
- 1/16/2013: Due to MLK day, there are no classes, review
sessions, sherpa sessions or anything else on Monday, 1/21.
Instead, the first review session next week will be held on
Tuesday, 1/22, from 7:00-7:50 in SSL 150.
The review session on Friday, 1/18, will happen as scheduled.
- 1/15/2013: The group assignments for
sherpa sessions has been determined. Locations TBD. A few students
still need to be assigned - please e-mail me your availability.
- 1/13/2013: I would like to meet each student for a few minutes to
start the semester, so that I get to know how you all are.
I set up a preliminary meeting schedule.
I am sure there will be quite a few conflicts; please contact me if you
cannot make your assigned time, and we'll reschedule. Otherwise, please
try to come to my office (SAL 232) a few minutes before the assigned
- 1/13/2013: There will not be a discussion section on Monday,
1/13/2013. Discussion sections will begin on Friday, 1/17.
- 11/27/2012: This is your main source of information about CSCI 271.
Check back here often for course-related announcements.