22C:16 Computer Science I: Fundamentals
9:3010:20 MWF, Room W151 PBB
Instructor:
Sriram V. Pemmaraju
101G MLH, srirampemmaraju@uiowa.edu, 3193532956
Office Hours: 10:3011:30 M, 2:303:30 W, 2:303:30 F
Computer Science I: Fundamentals is an introductory course on
computer programming with emphasis on problem solving techniques.
The course is a basis for computer science major and minor curricula,
and also useful to other majors as an initial exposure to programming.
Lectures are three times per week, with an additional discussion section
once per week. Concepts are presented in the context of working examples
and exercises. The key programming topics include data types, functions,
objects and classes. The first twelve weeks of the course will
exclusively use Python (programming language). Python can be used
interactively and can be accessed on Linux/Unix, Mac, and Windows platforms.
Syllabus document,
Information about TAs,
Announcements,
Quizzes, Projects, and Exams,
Weekly Topics,
Online Resources
(From xkcd)
Valerie Galluzzi Office hours: 3:305:00 W, 2:304:00 Th Office: 318 MLH Email: valeriegalluzzi@uiowa.edu
Thomas Hornbeck Office hours: 1:302:30 M, 11:3012:30 T, 1:302:30 W Office: 318 MLH Email: tomhornbeck@uiowa.edu
Viet Thuc Ha Office hours: 10:3012:00 W, 1112:30 F Office: 101N MLH Email: hathucviet@uiowa.edu
 5/8 Quiz 13 with Solutions.
 5/8 Quiz 11 with Solutions.
 5/8 Quiz 10 with Solutions.
 5/3 Homework 11. Due on Monday, May 9th, 4:59 pm.
 4/25 Homework 10. Due on Monday, May 2nd, 4:59 pm.
Homework 10 Solutions.
 4/13 Homework 9. Due on Wednesday, April 20th, 4:59 pm.
Here is a link that will take you to words.dat, an input file you'll need for this homework.
Homework 9 Solutions.
 4/11 Exam 2 and Exam 2 Solution.
 3/10 Homework 8. Due on Wednesday, March 30th, 4:59 pm.
Input files for Problem 1:
alice.txt,
carol.txt,
hyde.txt,
war.txt,
gulliver.txt,
treasure.txt.
Homework 8 Solutions.
 3/12 Programming Project 1. Due on Friday, April 8th, 4:59 pm. Here are 5 encrypted files to try your programs on; each of these was encrypted using a different substitution cipher.
 3/10 Homework 7. Due on Wednesday, March 23rd, 4:59 pm.
Homework 7 Solutions.
 3/3 Homework 6. Due on
Wednesday, March 9th Friday, March 11th, 4:59 pm.
Homework 6 Solutions.
 2/25 Exam 1 with solutions.
 2/24 Homework 5. Due on Wednesday, March 2nd, 4:59 pm.
Homework 5 Solutions.
 2/17 Homework 4. Due on Wednesday, Feb 23rd, 4:59 pm.
 2/3 Homework 3. Due on Wednesday, Feb 16th, 4:59 pm.
Homework 3 Solutions.
 2/3 Homework 2. Due on Wednesday, Feb 9th, 4:59 pm.
Homework 2 Solutions.
 1/20 Homework 1. Due on Wednesday, Feb 2nd, 4:59 pm.
Homework 1 Solutions.
 5/6 Here is some information
on the final exam.
 4/29 makeNeighbors.py. This is the solution to Extra Credit for HW9 and you should feel free to use it (at your own risk) for HW10.
 4/20 Scores and tentative letter grades.
 3/27 Practice for Quiz 9. Quiz 9 will take
place on Tuesday, March 29th.
 3/27 Here is some information
on Exam 2.
 3/21 The second exam will be on Friday, April 1st, 9:3010:20 am. Stay tuned for more details.
 3/18 Practice for Quiz 8. Quiz 8,
which will take place on Tuesday, March 22nd will be on string operations and simple file I/O.
 3/10 I will hold office hours tomorrow (Friday, 3/11) from 10:3011:30.
 3/4 Practice for Quiz 7. Quiz 7,
which will take place on Tuesday, March 8th will be on the
map and filter functions, accessing lists and strings
using indices and slices, and few other list and string operations.
 3/3 Homework 6. Due on
Wednesday, March 9th Friday, March 11th, 4:59 pm.
 2/28 Scores and tentative letter grades..
 2/25 Exam 1 with solutions.
 2/24 The 2011 University of Iowa Computing Conference starts at 6 pm on Friday (Feb 25th).
Homework 5 contains a 10 point extra credit problem that requires you to go to
the keynote speaker Ron Vetter's talk at 6 pm, Friday (Feb 25th) in 1505 SC.
 2/24 Homework 5. Due on Wednesday, March 2nd, 4:59 pm.
 2/12 Here is some information
on Exam 1.
 2/10 The first exam will be held on Friday, Feb 18th, 9:3010:20 am. Stay tuned for more details.
 2/10 Homework 3 is due on Wednesday, Feb 16th by 4:59 pm.
 2/3 Homework 2 is due on Wednesday, Feb 9th by 4:59 pm.
 1/28 Instructions on submitting homeworks.
 1/24 A tutorial on how to use Python on Windows machines in the computer labs.
 1/20 Office hours for the professor and the 3 TAs have been finalized. Here is the
office hour calendar.
 1/18 Homework 1 is due on Wednesday, Feb 2nd by 4:59 pm.
Week 14: 4/254/29
Objectoriented programming in Python. On classes, objects, attributes, etc.
Examples of the point class, the twoDice class, etc.
Class inheritence, subclasses, etc.
Reading: Chapter 23 on objectoriented programming from Prof. Ted Herman's
notes from Fall 2010 22C:16.

Week 13: 4/184/22
Binary Search, why it is so efficient. Merge Sort, why it is so much faster
than selection sort.

Week 12: 4/114/15
More discussion of dictionaries.
Introduction to recursion. The fibonacci function, recursion call trees,
why the fibonacci function is so inefficient. The power function, why the
power function is so efficient. Introduction to divideandconquer and binary
search.

Week 11: 4/44/8
Project 1 discussion, Advanced data structures in Python: tuples, dictinaries,
and sets.

Week 10: 3/283/25
Efficiency of list operations, Project 1 discussion, Exam 2.

Week 9: 3/213/25
Operations that modify lists in place (list mutation), efficiency of list operations.
Reading: Chapter 15 on mutation from Prof. Ted Herman's
notes from Fall 2010 22C:16.

Week 8: 3/73/11
Operations that are common to strings and lists, operations on strings,
operations on lists.
Reading: Chapter 21 on file I/O from Prof. Ted Herman's
notes from Fall 2010 22C:16.

Week 7: 2/283/4
Scope of variables, local vs global variables, implicit vs explicit global
variables, Sequence types: lists and strings, the in operation,
the len function, the map and filter functions.
Reading: Chapter 12 on lists from Prof. Ted Herman's notes
from Fall 2010 22C:16..

Week 6: 2/212/25
Userdefined functions, parameters versus arguments, positional style argument passing, keyword arguments, keyword parameters,
the None object, order in which functions should be defined,
variable scope.
Reading: Chapter 8 on functions from Prof. Ted Herman's notes
from Fall 2010 22C:16..
Chapter 14 on the scope of variables from Prof. Ted Herman's notes from Fall 2010 22C:16.

Week 5: 2/142/18
A more indepth discussion of functions and modules in Python.
The random module. Example of simulating a 1dimensional random walk.
User defined functions. Exam 1 is on Friday, 2/18.

Week 4: 2/72/11
A more indepth discussion of data types, variables, operators and expressions.

Week 3: 1/312/4
Our second python program: primality testing; boolean variables and boolean
expressions; efficiency of programs; timing programs.
Reading: Chapter titled "Boolean Expressions" from this
NonProgrammer's Tutorial for Python 2.6.
Also, read Chapter 4 from Prof. Ted Herman's notes from Fall 2010 22C:16.

Week 2: 1/241/28
Our first python program: turning decimal integers into their binary
equivalent; a whirlwind introduction to constants, variables,
data types, type conversion, simple expressions, flow control via the
whilestatement and ifstatement, types of errors, and python
comments.
Reading: Chapters titled "Hello, World," "Who Goes There?,"
"Count to 10," "Decisions," and "Debugging" from this
NonProgrammer's Tutorial for Python 2.6.
Practice Problems: These correspond roughly to the material covered by the end of Week 2. Use these to evaluate your understanding of the material and prepare for upcoming quizzes and homeworks.

Week 1: 1/171/21

Lecture on 1/19 The excitement of Computer Science; a few administrative issues;
our first programming problem: converting positive integers into equivalent binary representation; designing an algorithm to solve this problem.
 Python.org is the authoritative source
on all Python matters. You will find links to downloads and tutorials here.
 Python for beginners. You'll find links to many tutorials here.
 Python resources from University of Maryland at Baltimore County.

A tutorial on how to use Python on Windows machines in the computer labs.