Announcements

  • Class and Labs start Wednesday 21 January

Course Info

Instructor: Prof. Andrew Danner

Class: MW 9:00am-10:15am Science Center 204

Lab A: W 1:05-2:35pm Martin 227

Office hours: M 10:30am-12:00pm, R 1:30-2:40pm Martin 306

Textbook: Introduction to the Theory of Computation 3e by Michael Sipser (any edition is ok) Errata.

Clickers: You will need an iClicker (physical device, not the app) for this class. Register your iClicker here.

Edstem: CS46 Q&A forum

Course Description

Welcome to CS46: Theory of Computation! This course is an introduction to the formal systems that are commonly used as abstract models for computational processes. We will study a variety of computational models, and classify and solve problems in each of them. While computers are now ubiquitous and the idea of an algorithm seems natural, where did these ideas originate? Why, for instance, do we have memory on our machines --- is it necessary for computation, or simply a convenience? Do other methods of computation even exist? Could we solve more interesting problems with another model?

Along the way, this course will develop mathematical concepts which are fundamentally important for computer science: decidability, undecidability, and computational complexity. We will go beyond simply saying "this problem seems hard" and show that some computational problems are inherently harder than others, or simply unsolvable by computers. We will examine the limits of computers and computation, and consider the consequences of these limits. By approaching these topics from a formal standpoint, this course aims to teach students how to describe and to reason precisely about computational objects.

Course Goals

By the end of this course, you will have developed the following knowledge and skills:

  • You will know how to analyze the powers and limits of various models of computation.

  • You will learn and understand several standard proof techniques, including induction, contradiction, and diagonalization.

  • You will be able to identify problems that are computationally intractable and argue why these problems might be hard to solve efficiently.

Above all, the goal of this course is to instill a deep understanding of the limits of computation, and how to think about these in a thorough and systemic way.

Student Responsibilities

CS46 is different from most other computer science courses, in that the course focuses on abstract thinking about problems. It does not ask you (often) to implement every solution in code. This course is much more about reasoning about which problems are solvable by computers, and less about actually solving every problem with a coded project. To succeed in this course, you should consistently do the following:

  • Attend class and lab sessions:

    The primary introduction to course material is through class instruction. Attending class is essential for understanding the subject. Lab sessions provide additional time to work on solutions. Lab attendance is mandatory.

  • Participate actively in the learning process:

    The best way to learn this material is through constant effort. This means trying to work out proofs yourself rather than simply reading through solutions. During class we will often derive solutions collaboratively. Labs provide additional time to experiment with solutions. There is a very strong correlation between students who ask questions (in class/lab/office hours/EdStem) and students who do well in this class.

  • Start the homework assignments early:

    CS46 is not a coding-heavy course; it is a course with an emphasis on rigorous thought and explanation. It is extremely difficult to bang out proofs and solutions at the last minute. I understand that it is not always possible to put serious time into an assignment early. However, even 30-60 minutes will be helpful, to ensure that you understand what the problems ask of you and you start thinking about how to solve them early.

  • Seek help early:

    It is essential in this class that you not fall behind. If you find yourself falling behind, or if you’re having trouble grasping a concept, come to office hours. Ask (and answer!) questions on the course discussion forum. Set up an appointment to talk with me. Or just stop by my office when my door is open.

Schedule

WEEK DAY ANNOUNCEMENTS TOPIC & READING LABS
1

Jan 21

 

Course Introduction

Lab 1: Latex Practice

2

Jan 26

 

Proof methods, DFAs, regular languages

  • Read: 0.3-0.4
  • Read: 1.1
  • Practice problems
  • Lab 2

Jan 28

 
3

Feb 02

Drop/Add Ends

NFAs and Regular Expressions

  • Practice problems
  • Lab 3

Feb 04

 
4

Feb 09

 

Non-regular languages, CFGs

  • Practice problems
  • Lab 4

Feb 11

 
5

Feb 16

 

Pushdown automata

  • Practice problems
  • Lab 5

Feb 18

 
6

Feb 23

 

Non-context-free languages, TM Intro

  • Practice problems
  • Lab 6

Feb 25

Exam 1

7

Mar 02

 

Turing Machine Variants

  • Practice problems
  • Lab 7

Mar 04

 
 

Mar 09

Spring Break

Mar 11

8

Mar 16

 

Decidability and Undecidability

  • Practice problems
  • Lab 8

Mar 18

 
9

Mar 23

 

Reductions

  • Practice problems
  • Lab 9

Mar 25

Exam 2

Last Day to Declare CR/NC (Mar 27)

10

Mar 30

 

Rice's Theorem

  • Practice problems
  • Lab 10

Apr 01

 
11

Apr 06

 

Time Complexity

  • Practice problems
  • Lab 11

Apr 08

 
12

Apr 13

 

NP and NP-completeness

  • Practice problems
  • Lab 12

Apr 15

Exam 3

13

Apr 20

 

The Recursion Theorem

  • Practice problems
  • Lab 13

Apr 22

 
14

Apr 27

 

Wrapup and Review

  • Practice problems
  • Lab 14

Apr 29

 
 

May 07

Final Exams Start

May 14

Final Exams End

Grading Policies

Grades will be weighted as follows:

Table 1. Grading

25%

Lab assignments

5%

Participation and Clicker quizzes, concept quizzes

15%

Exam 1

15%

Exam 2

15%

Exam 3

25%

Final Exam

Some work during lab sessions will consist of in-lab practice exercises for group discussion and will not be graded. Written weekly lab assignments are separate from these practice exercises, submitted electronically via git, and graded for correctness and completeness.

Quizzes

We will have quizzes for each lecture of the class. Some will be in-person quizzes in lecture using clickers; others will be short in-lab written quizzes. Quizzes are low-stakes --- they are meant to start a conversation, check in to make sure you got the big ideas from the readings, and bring up topics for you to ask follow-up questions about.

Lab Policy

Lab assignments are submitted electronically using git, and are typically due by 11:59pm on Tuesdays. You may submit your assignment multiple times, but only the final submission will be graded. You’ll be able to work with a partner on several but not all homework assignments; each homework assignment will specify if working with a partner is allowed. Lab assignments will be a mix of written problems (in LaTeX) and coding problems.

Late Policy

To help with cases of minor illness, or other short-term time limitations, each student may use up to two late days per lab assignment, up to a total sum of three late days for the semester, no questions asked. To use your extra time, you must email me after you have completed the lab and pushed to your repository. You do not need to inform me ahead of time. When you use late days, you should still expect to work on the newly-released lab during the following lab section meeting. Lab time will not be used to answer questions about the previous lab.

For partnered assignments, both students need to have late days to use them. If only one partner has late days remaining, you cannot use late days for a partnered assignment. Once you use up your late days, further late assignments will not be accepted except in very unusual extreme circumstances. Even if you do not fully complete an assignment, you should submit what you have to receive partial credit. You do not need to notify my ahead of time to use late day(s). Instead, push your completed submission to github, and then email me to inform me of the late submission.

Absences and Extensions

Absences and extensions. If you feel that you need an extension on an assignment or that you are unable to attend class for two or more meetings due to a medical condition (e.g., extended illness, concussion, hospitalization) or family emergency, you must provide your instructors with official documentation from the dean’s office or student health center. Their documentation will help us to provide the appropriate accommodations. Please reach out to me if you are in extenuating circumstances! My goal is for you to learn the material.

Academic Integrity

Limited collaboration in planning and thinking through solutions to problems is allowed and encouraged, but no collaboration is allowed in writing up solutions. Your submitted write-up is your own. Please list your discussion partners and the extent of your discussions in your post-lab survey. If you used any resources beyond the textbook and professor, you MUST cite them in your survey.

Note: in the following paragraphs, "code" refers to all solutions, including written programs but also proofs, analysis, written reports, etc.

Academic honesty is required in all your work. Under no circumstances may you hand in work done with (or by) someone else under your own name. Your code should never be shared with anyone; you may not examine or use code belonging to someone else, nor may you let anyone else look at or make a copy of your code. This includes, but is not limited to, obtaining solutions from students who previously took the course or code that can be found online. You may not share solutions after the due date of the assignment.

Discussing ideas and approaches to problems with others on a general level is fine (in fact, we encourage you to discuss general strategies with each other), but you should never read anyone else’s code or let anyone else read your code. All code you submit must be your own with the following permissible exceptions: code distributed in class, and code found in the course text book. In these cases, you should always include detailed comments that indicates on which parts of the assignment you received help, and what your sources were.

Failure to abide by these rules constitutes academic dishonesty and will lead to a hearing of the College Judiciary Committee. According to the Faculty Handbook: "Because plagiarism is considered to be so serious a transgression, it is the opinion of the faculty that for the first offense, failure in the course and, as appropriate, suspension for a semester or deprivation of the degree in that year is suitable; for a second offense, the penalty should normally be expulsion."

The spirit of this policy applies to all course work, including code, homework solutions (e.g., proofs, analysis, written reports), quizzes, and exams. Please contact me if you have any questions about what is permissible in this course.

Exam Policy

Students must strictly adhere to the following policy, which applies to all exams taken in a Computer Science course at Swarthmore:

Exam takers must place all non-essential items at the front of the room (or other designated area). Unless otherwise permitted, students may not have any electronic devices or course materials in their possession during the entirety of the exam. This includes cell phones, tablets, laptops, smart watches, course notes, articles and books, among others. These items should be placed at the front of the room near the proctor. If you need to leave the room during the exam, you must obtain permission from an instructor first. Any non-permitted discussion or aide in regards to exam material will result in immediate forfeiture of the exam and a report to the College Judiciary Committee. Please discuss any concerns or accommodations with your instructor prior to starting the exam.

Unusual Exam Policies

Exams are an opportunity for you to demonstrate your awesome mastery of the course material. For any timed evaluation (quizzes, midterms, exams) in this class the following policy is in effect:

You will earn 25% for any question you leave blank, or cross out all work and write “I cannot answer this question.”

This policy is designed to relieve some test-taking pressure, reward you for knowing the limits of your own abilities, and discourage you from writing a word salad on the exam (e.g., "here’s every keyword I know!"). This policy is not in effect on homework and lab assignments, where my expectation is that you will spend the time necessary to learn and master the material.

Academic Accommodations

If you believe you need accommodations for a disability or a chronic medical condition, please contact Student Disability Services via e-mail at studentdisabilityservices at swarthmore.edu to arrange an appointment to discuss your needs. As appropriate, the office will issue students with documented disabilities or medical conditions a formal Accommodations Letter. Since accommodations require early planning and are not retroactive, please contact Student Disability Services as soon as possible. For details about the accommodations process, visit the Student Disability Services website.

To receive an accommodation for a course activity, you must have an Accommodation Letter from the Office of Student Disability Services and you need to meet with us to work out the details of your accommodation at least two weeks prior to the activity.

You are also welcome to contact us privately to discuss your academic needs. However, all disability-related accommodations must be arranged, in advance, through Student Disability Services.

Edstem Guidelines

We’ll be using Edstem, an online Q&A forum for class discussion, help with labs, clarifications, and announcements that pertain to all sections of CS46. You should be automatically enrolled in CS46 on Edstem. If you don’t have access, please let me know.

Edstem is meant for questions outside of regular meeting times such as office hours, class, and lab. Please do not hesitate to ask and answer questions on Edstem, but keep in mind the following guidelines:

  1. Edstem should be used for longer form questions outside of class, lab, office hours. Please do not use email to exchange with code or ask detailed questions about the assignments.

  2. If there is a personal issue that relates only to you and not the course content, email is acceptable.

  3. We encourage non-anonymous posts, but you may post anonymously.

  4. Do NOT post long blocks of code on Edstem - if you can distill the problem to 1-2 lines of code and an error message, that’s fine, but try to avoid giving out key components of your work.

  5. When answering a question, try to give some guiding help but do not post code fixes or explicit solutions to the problem.

  6. Posting on Edstem counts toward your participation grade, both asking and answering!

LaTeX Resources

Writing lab solutions is required for this course. It is also a good skill to learn. If you plan on going to graduate school and/or publishing papers in the future, you will end up writing in $\LaTeX$. This page gives some resources and links to good latex tutorials.

For most latex files, you should be able to compile a latex file using e.g. 'pdflatex foo.tex'. As with other compilable programs like C++, you might get some compilation errors.

LaTeX Tutorials

Below are some good latex tutorials. If you just need to know a simple command or two, googling "latex" often gets you just what you need.

Looking for a symbol?

The extremely useful tool detexify lets you draw a symbol, and finds the corresponding LaTeX command.

Links that are related to the course may be posted here. If you have suggestions for links, let me know.