CSCI 121 : Scientific Computing

General Information

Professor: Simon D. Levy
Lecture: M/W/F 11:15 - 12:10 Parmly 307
Lab: Tues 2:30 - 5:35 Parmly 405
Office: Parmly 407B
Office Phone: 458-8419
Office Hours: MWF 2:30-4:30 and by appointment

Textbook: D. Kaplan, S.D. Levy, and K. Lambert, Introduction to Scientific Computation and Programming in Python. This textbook is available directly from the publisher, with a discounted rate for W&L students.


The goal of this course is to give you the skills and understanding to write simple, powerful programs for use in your scientific research. We use the SciPy tools of the Python programming language/environment, which is probably now the most popular (and certainly the fastest-growing) platform for this kind of work in the natural sciences (biology, psychology, neuroscience, geology). Ability to program in a language like Python is a skill that will put you in demand in both industry and graduate school in these fields.

Attendance and Preparation

I look at this course as preparation for professional work in a research or industry setting, and I expect you to act professionally: show up for every class and lab, and submit your work on time without excuses. Consistent with our university's mission statement, I expect everyone to conduct themselves with honor, integrity, and civility: if you are talking, texting, or otherwise causing a distraction in class, I will ask you to leave.


All work should be submitted through Sakai as PDF files (writeups) and Python .py files (program code). You will get no credit for Microsoft Word files, or for PDF files that do not have information in them identifying you as the author. The fast pace of the course means that no late work can be accepted.The only three exceptions to this rule are: As a way of helping with unanticipated emergencies and bad days, I will drop your lowest lab or assignment grade.Given the size of the class and the amount of work involved, there will be no opportunity for extra credit if you are not happy with your grade as the end of the course approaches. Serious problems (health / family / personal emergencies) should be handled through the Office of the Dean.

The grading scale will be 93-100 A; 90-92 A-; 87-89 B+; 83-86 B; 80-82 B-; 77-79 C+; 73-76 C; 70-72 C-; 67-69 D+; 63-66 D; 60-62 D-; below 60 F.


The most important aspect of the course is the labs, which is where you learn to program. Unlike lab writeups in your other science courses, your submissions in this course will be programs, and the criterion for success is simple and unforgiving: does your program work or not?

Style and documentation (which we will discuss) are important. Like careful grammar and correct spelling they reflect and encourage good design and clear thinking. Ultimately, however, what matters in the real world is not how clever your solution is or how many comments it contains. What matters is getting the job done, without errors. You will get little or no credit for effort: your programs have to work!

Unless stated otherwise, all lab work will be done without assistance from other students. Many labs can be completed within the three-hour lab session, but if you need time to work outside class, that is fine. For each lab, there will be an absolute deadline of 11:59 PM Friday. Although scientific research is mostly collaborative, working with a lab partner in an introductory course like this makes it difficult to assess how well you are understanding the material.

Lab grading will be based on how many exercises you turn in relative to other students.I have found that this allows nearly everyone to get a decent grade on the labs, while also rewarding those who accomplish more. For the first couple of labs, which involve a few simple exercises, everyone will simply get a yes/no credit for turning in the lab.

Final Exam

The final exam for this course will be given during the final exam week. You can take this exam during any of the regularly scheduled exam periods that week. You must supply an exam envelope to the instructor or the department administrative assistant no later than noon on the last day of class. You must specify a provisional day and time on the envelope, which you are free to change on the clipboard provided outside the door of Parmly 407 any time that week. Email or phone requests to reschedule will not be accepted.

The exam will be given in Parmly 405, and you should arrive promptly before the appointed time. If you are more than 15 minutes late, you will have to reschedule your exam. If you are more than 15 minutes late to the last exam period on Friday afternoon, you will receive a grade of 0 on your exam.

Students who have approved academic accommodations must make arrangements to use those accommodations directly with the instructor no later than the last day of class. Students approved for extra time will receive that time at the tail end of the morning exam period or before the beginning of the afternoon exam period (for example, ending at 1:30 PM for a morning exam or beginning at 12:30 PM for an afternoon exam). Students approved for a low-distraction testing location should reserve that space during the last week of classes, following instructions distributed by Dean Price (sophomores, juniors or seniors) or Director of Disability Resources Lauren Kozak (first-years).


Washington and Lee University makes reasonable academic accommodations for qualified students with disabilities. All undergraduate accommodations must be approved through the Office of the Dean of the College. Students requesting accommodations for this course should present an official accommodation letter within the first two weeks of the (fall or winter) term and schedule a meeting outside of class time to discuss accommodations. It is the student's responsibility to present this paperwork in a timely fashion and to follow up about accommodation arrangements. Accommodations for test-taking should be arranged with the professor at least a week before the date of the test or exam.

Optional Final Project

If you are doing research with a mentor and you have a project in mind, you can use the last two lab periods of the course for that. The goal is to write one or more programs to solve an interesting problem in your field of study. Proposals for these projects will be due the previous week, but I encourage you to start thinking early on about a project that interests you. Most students usually elect not to do such a project, in which case there will be two ordinary labs to do instead.

Schedule, Including Due Dates and On-line Class Notes


Tuesday Lab



09 Jan
Week 1

Course Outline

Chapter 1: What is Computation?
Linux & SciPy Intro Chapter 1: What is Computation? Chapter 2: Invoking a Computation

16 Jan
Week 2

Martin Luther King Day: No Class

Discussion 3.7
Exercises 3.1-3.6, 3.8, 3.9, 3.10

Chapter 3: Simple Types
Chapter 3: Simple Types

23 Jan
Week 3

Chapter 4: Collections and Indexing

Exercises 4.1 through 4.8

Chapter 5: Files and Scripts

Chapter 5: Files and Scripts

30 Jan
Week 4

Review Ch. 1-4
Ex. 5.2; 5.3; 5.6 Project (“Time for a Cup of Coffee”)

No PDF this time: upload your three Python scripts to Sakai.


Exam Ch. 1-4

Exam follow-up

Guest lecture byDr. Jen Golbeck

06 Feb
Week 5

Chapter 6: Functions E 6.1, 6.3 - 6.12 (skip E6.2)

General Instructions

Continue Chapter 7 Conclude Chapter 7

13 Feb
Week 6

Chapter 8: Loops E7.1 - 7.11. Hint on 7.7

Put all your functions in a script I will test your script using this script. You only need submit the final revision of each function.

Chapter 8: Loops Continue Chapter 8

27 Feb
Week 7

Conclude Chapter 8 E8.1, 3, 4, 5, 7, 13, 17

No lookin' online for algorithms, please! Put all your functions in a script I will test your script using this script.

Chapter 11: Sounds & Signals Review Chapters 5-8

06 Mar
Week 8

Exam Ch. 5-8

Due: Final Project Proposals (Optional)

Instructions Chapter 11: Sounds & Signals

Continue Chapter 11

13 Mar
Week 9

Finish Chapter 11

E11.1, E11.2, E11.3, E11.4, and this

Put your code in a script with the usual comments (your name, etc.) I will use this script to test your script.

whistle.wav     fh.wav     g_fugue_mono.wav     stairway.wav  

Chapter 12: Images SSA Conference;
no class

20 Mar
Week 10

Chapter 13: Sensors and Data Acquisition E12.1, E12.2, E12.3, E12.4




Chapter 13: Sensors and Data Acquisition Chapter 13

27 Mar
Week 11

Chapter 13 Sensor Lab Special Guest Lecture: Micro-scale sensing devices Prof. Moataz Khalifa

Optional article

03 Apr
Week 12

Finish Chapter 13 Special topic lab: Makerspace@W&L Chapter 10: Graphical User Interfaces (Guest lecture by Prof. Ken Lambert) Review for Final