The Matrix in Computer Science
The Matrix in Computer Science
Introduction
Course Description: The aim of this course is to provide students interested in computer science an intro-
duction to vectors and matrices and their use in modeling and data analysis. The course will be driven by
applications from areas chosen from among: combinatorial optimization, computer vision, cryptography, game
theory, graphics, information retrieval and web search, machine learning, and scientific visualization. For ex-
ample, students will learn Google’s PageRank method for ranking web pages. This course satisfies the linear
algebra requirement for the Computer Science Sc.B and the Applied-Math/Computer Science Sc.B., and fulfills
an “intermediate math-oriented” requirement for the Computer Science A.B.
Prerequisites: No formal prerequisites but students are expected to be comfortable with programming and
with mathematics (writing a proof).
• Programming background: You should be fine if you have the equivalent of an AP in Computer Science or
if you have taken one of CS 40, CS 150, CS 170, CS 190. The course is taught using Python but prior
experience with Python is not necessary; the first two labs are intended to provide instruction and practice
in the features of Python most relevant to the course.
• Mathematics background: You should be familiar with the ideas of sets and functions. We will review these
ideas. and with some basic proof techniques. It is helpful if you have basic knowledge of proof techniques.
CS 220 definitely suffices, but you can also get by with a strong high-school math background and a little
extra work. For example, though we don’t use calculus in this class, if you succeeded in AP Calculus,
that’s a good indication you will be ready for this class.
Goals: The learning goals are: (1) develop a facility with the methods and concepts of basic linear algebra,
especially those relevant to applications in computer science, (2) understand the rudiments of basic computations
in linear algebra, and be able to use these in applications, and (3) be able to prove elementary results in linear
algebra.
Meeting Time and Place Lecture Monday, Wednesday, Friday 3:00-4:20, CIT 368. The “lecture” will also
include quizzes and some problem-solving sessions. In addition, based on your preferences and availability, you
will be assigned to one two-hour lab session. You must attend this lab session weekly.
Mandatory office hours You are expected to visit the professor’s office at least once during the
semester. Office hours are arranged by email or in class. Group office hours will be scheduled in class.
Time requirements In addition to the lectures and labs, you are expected to spend roughly five hours a week
doing homeworks, reviewing the material, and studying for quizzes.
2
Grad students The graduate school requires graduate students taking an undergraduate course to do exta
work to get credit for the course. Approximately once a week, we will assign extra homework problems intended
for graduate students. In order to register, grad students need to get permission from the professor, and then
request an override from the Registrar’s Office.
Staff
The course has a professor, two head TAs (HTAs), and two undergraduate TAs (UTAs). If you have course
questions during the semester, you should email
[email protected]
which goes to the whole staff, including the professor. One of us will get back to you. Don’t expect us to be on
top of email during all hours, however!
The professor is Philip Klein ([email protected]). Professor Klein’s office is CIT 111111111. Professor Klein’s
office hours are by appointment—just email him or talk to him after lecture to set up a time. In fact, students
in this class will be required to visit the professor at some point in the semester.
The other staff are:
Textbook
The textbook for this course is Coding the Matrix: Linear Algebra through Computer Science Applications,
Edition One. A limited number of copies are available at the Brown University Bookstore for $30. Amazon has
it for slightly more.
Grades are determined by overall performance according to these measures. You are not competing with
your classmates.
Labs are all worth the same amount. Quizzes and problem sets might differ in their value; some quizzes will
be worth more than others, and the same goes for problem sets.
Auto-grading
We have a system for auto-grading many of the homework problems and lab tasks. This gives you immediate
feedback, and sends us your work.
To support auto-grading, you need to add to your matrix directory a text file called profile.txt. It should
have two lines. The first line should consist of the keyword USERNAME followed by your Banner ID. The
second line should consist of the keyword PASSWORD followed by a password that is to be used only for this
class. Don’t use a password that you have used for any other purpose. You will communicate your Banner ID
and password to us using a Google Docs form.
Corresponding to each chapter of the textbook and to each lab is a template file, which you will download from
http://grading.codingthematrix.com into your matrix directory. There are also template files for specific
problems, such as your vector implementation and your matrix implemention. Also, for some assignments we
will provide template files. Your solutions will go in the template file. You will use a script, cs053 submit, to
submit your solutions to the grading server. The argument to the script is the name of the template file, e.g.
~/course/matrix $ cs053_submit python_lab.py
The script will allow you to submit the answers to whichever problems you specify. Your performance on these
problems will be recorded and you will be told which problems you got right.
However, you must not use the grading server as a substitute for testing your code. For many problems, we
provide test examples for you to use in testing and debugging. However, you will not be able to rely wholly on
our test examples; you will also need to come up with your own.
Though you must provide your solutions via a file, you are strongly encouraged to use Python interactively
to test and debug your solutions. You will be taught how to import definitions from your file into a Python
workspace.
Labs
The labs are a central part of the course. Almost every week, you will attend a two-hour lab, in which you will
carry out a computation, usually requiring you to write some code and sometimes do some problem-solving on
paper. The lab assignments can be found in the course textbook. The labs are intended to give you a chance to
demonstrate your understanding of the course material and your ability to apply it. You are expected to show
up for lab
1. with a good understanding of the lecture material,
Homework
The purpose of homework assignments is to reinforce the material, sometimes teach you more material, and test
your understanding of the material. The problems may include computations, proofs, and programming prob-
lems. Some collaboration is allowed on these assignments, but see the collaboration policy for more information
on this.
Homework will be assigned for each lecture and due immediately before the start of the following lecture.
Homework will consist of two kinds of problems, auto-graded and human-graded. The auto-graded problems are
to be submitted via the computer, and the human-graded problems are to be submitted on paper and dropped
in the CS053 hand-in bin, located on the second floor of the CIT. For proofs and other problems involving
mathematical notation, please either write clearly by hand or use a math typesetting tool such as LATEX. If your
solution consists of several sheets of paper, you must staple your pages together. Put your Banner ID (not your
name) at the top of the first page.
All homework due on a day must be turned in by 2:59 pm on that day.
For auto-graded problems, you will of course get immediate feedback. For human-graded problems, we will
return your graded homework by the time of the next lecture. You are responsible for picking up your graded
homework from the hand-back cabinet on the second floor of the CIT.
After that lecture, you can submit solutions to additional problems to get partial credit for late work.
Additional points earned for late work are discounted by a factor of .75 in determining your grade. In order
to earn credit for late human-graded problems, you must include your originally submitted graded homework if
any. Please write RESUBMIT at the top of your new solution sheets, and staple them to the originally graded
homework, .
Each assignment may also be resubmitted by the beginning of the two lectures later for partial credit. (On
each problem you turn in late, your score on that problem is multiplied by .75 in determining your grade.)
Doing homework on material very soon after the material is presented in lecture is a way of reinforcing
your understanding of the material, exposing any gaps or misconceptions you might have, and making sure that
5
everybody is up-to-date. This course moves quite quickly and the material is cumulative, so getting behind can
be disastrous.
We will assign problems via email and via the course web site. To receive email, you must be registered for
the class or at least have the class in your shopping cart.
Final Exam
The final exam is scheduled for December 16, 9:00-12:00.
Collaboration Policy
The CS department has rules about collaboration, and there are also some that are specific to this course. These
policies are designed to make sure that every student is graded individually and fairly; according to the amount
that s/he has learned. Please be aware that it is not hard for us to tell if you break any of these rules! If you
have any questions about the following policies, make sure you ask us so that you do not inadvertently break
any rules.
Labs
Collaboration is encouraged in labs—both with your fellow students and with the lab TAs.
Homework
You are allowed to talk as much as you want with any course TA and with the professor about any homework
assignment. A TA is not responsible, however, for writing your code for you or giving you a solution. You are also
allowed to talk to other students about the problems and come up with solutions together. However, we want
to make sure that you actually understand these solutions. Therefore, any written record from a collaborative
session must be discarded at the end, and you are required to write up your solutions on your own, without any
notes and without any coaching. In other words, you need to be able to reconstruct on your own any work that
you do with a classmate.
You are allowed to use online resources or alternative textbooks, but if you happen to find solutions or partial
solutions to the specific problems we have assigned, you must not use information from those solutions; if you
do find such solutions, please report it to the staff.
Other matters
Schedule
The schedule of topics will be available on the course calendar, visible on the course web page. However, be
aware that the schedule of topics is subject to change (and is likely to change). Note also that lectures, labs, and
problem sets will continue during Reading Period.
Inclusion
Our intent is that this course provide a welcoming environment for all students. All members of the CS com-
munity, including students, faculty and staff, are expected to treat one another with kindness and respect. If
we in the course staff slip up in this regard, feel free to contact Philip Klein (professor) or, if that does not feel
comfortable, Ugur Cetintemel (Department Chair), Tom Doeppner (Vice Chair) or Laura Dobler (diversity and
6
inclusion staff member). You can also speak confidentially to student advocates for diversity and inclusion, who
hold regular office hours.
To access student support services and resources, and to learn more about diversity and inclusion in CS, in-
cluding information about office hours for student advocates, please visit http://cs.brown.edu/about/diversity/resource
Keeping up
This class moves quickly and relentlessly. The workload is not large, but it is consistent. You need to commit to
spending an hour or two after each lecture to do the homework, review the material, and prepare for the next
lecture’s quiz. If you cannot make that commitment, this might not be the class for you.
The course material is cumulative, by which we mean that you need to understand earlier material in order to
understand later material. If you find yourself getting behind in terms of your understanding and you are willing
to do the work to catch up, you are encouraged to contact course staff right away. We want you to succeed in
this course. Catching problems early can help.