Introduction to Computer Science and Programming

An understanding of the role computation can play in solving problems.

This subject is aimed at students with little or no programming experience. It aims to provide students with an understanding of the role computation can play in solving problems. It also aims to help students, regardless of their major, to feel justifiably confident of their ability to write small programs that allow them to accomplish useful goals. The class will use the Python programming language.

About This Course

Let's start with the strategic goals of this course:

  • Help students (who may or may not intend to major in computer science) to feel justifiably confident of their ability to write small programs.
  • Map scientific problems into computational frameworks.
  • Position students so that they can compete for jobs by providing competence and confidence in computational problem solving.
  • Prepare college freshmen and sophomores who have no prior programming experience or knowledge of computer science for an easier entry into computer science or electrical engineering majors.
  • Prepare students from other majors to make profitable use of computational methods in their chosen field.

6.00SC can be summarized with these six major topics or objectives:

  • Learning a language for expressing computations—Python
  • Learning about the process of writing and debugging a program
  • Learning about the process of moving from a problem statement to a computational formulation of a method for solving the problem
  • Learning a basic set of "recipes"—algorithms
  • Learning how to use simulations to shed light on problems that don't easily succumb to closed form solutions
  • Learning about how to use computational tools to help model and understand data

6.00 is designed to help you become skillful at making the computer do what you want it to do. Once you acquire this skill, your first instinct when confronted with many tasks will be to write a program to do the task for you. Said another way, we want to help you learn to apply computational modes of thought to frame problems, and to guide the process of deducing information in a computational manner.

This means that the primary knowledge you will take away from this course is the art of computational problem solving. Unlike many introductory level courses, having an ability to memorize facts will be of little help in 6.00. This course is about learning to solve problems, not learning facts. (This, by the way, is exactly why all exams are open book.)

Prerequisites and Preparation

This course is aimed at students with little or no prior programming experience but a desire to understand computational approaches to problem solving. Now, by definition, none of you are under-qualified for this course. In terms of being over-qualified — if you have a lot of prior programming experience, we really don't want you wasting your time, and in this case we would suggest that you talk to me about how well this class suits your needs, and to discuss other options. In addition, we want to maintain a productive educational environment, and thus we don't want over-qualified students making other students feel inadequate, when in fact they are only inexperienced.

Since computer programming involves computational modes of thinking, it will help to have some mathematical and logical aptitude. You should be confident with your math skills up to pre-calculus.

Textbook

The original textbook for 6.00 and the course lectures parallel each other, though there is more detail in the book about some topics. The book is NOT required. We will not be referring to it in assignments or depending upon it to cover holes in the lectures.

Guttag, John. Introduction to Computation and Programming Using Python. Spring 2013 edition. MIT Press, 2013. ISBN: 9780262519632.

A new edition of the textbook is now available. However, there may be some discrepancies between the original course lectures included on this course site and the sections in this revised and expanded edition of the textbook.

mp_logo.gif Buy at Amazon Guttag, John. Introduction to Computation and Programming Using Python. Revised and expanded edition. MIT Press, 2013. ISBN: 9780262525008.

If you choose not to purchase the textbook, you will probably find it useful to buy or borrow another book that covers Python. You might check your local public library's resources, or search online for a free Python text, such as How to Think Like a Computer Scientist or An Introduction to Python.

Online readings will be posted on the appropriate session pages. A more complete list of readings and references (not all of which are specifically assigned during lectures) can be found in the References section.

Technical Requirements

Since one of the goals of this course is to become familiar with programming, you will need to install and use the Python programming language and the interpreter IDLE. Please see the Software section for information and instructions on downloading the required software.

Most lectures involve programming demonstrations, and the code involved will generally be posted twice: once as a handout in PDF format, and again as a code file in .PY (Python) format. Additionally, many problem sets have accompanying code required for completing the assignment, and these are posted as .PY (Python) files. If you do not have the software installed, you will not be able to properly open and use these files.

Acknowledgments

We would like to thank course TAs Mitchell Peabody, Gartheeban Ganeshapillai, and Sarina Canelake for their participation in filming 6.00 recitations for OCW Scholar, and Niki Castle and Elaina Cherry for their work and dedication adapting the 6.00 materials for Scholar students. We would also like to thank Eric Grimson for his role in the development of 6.00 teaching material over the years, and for allowing us to record a guest lecture.

UNIT 1

We will start the semester by discussing the difference between imperative knowledge and definitional knowledge, between fixed program and stored program computers, and finally the definitions of syntax, static semantics, and semantics. We cover straight line, branching, and looping programs. Other topics include binary representation of numbers, orders of growth, and debugging programs.

Python concepts covered in this unit include values, types, int, float, boolean, strings (str), tuples, dictionaries (dict), and lists. We will also learn about expressions and statements, especially how to effectively use print statements in your programs. Other topics include assignment, conditionals, loops, assert, functions, scope, object models, mutation, and mutability.

By the end of Unit 1 you should be familiar with the following algorithmic techniques: guess and check, linear search, bisection search, successive approximation, and Newton-Raphson (Newton's method). You will also learn recursive definitions, problem solving techniques, and how to structure programs using decomposition and abstraction, including specifications and parameters.

Unit 1 ends with a quiz covering all material (lectures, recitations, and problem sets) through Efficiency and Order of Growth.

UNIT 2

Unit 2 begins with hash functions, which are useful for mapping large data sets. We will continue with a broad introduction to object-oriented programming languages (Python is an example), covering objects, classes, subclasses, abstract data types, exceptions, and inheritance. Other algorithmic concepts covered are "Big O notation," divide and conquer, merge sort, orders of growth, and amortized analysis.

The next several lectures introduce effective problem-solving methods which rely on probability, statistical thinking, and simulations to solve both random and non-random problems. A background in probability is not assumed, and we will briefly cover basic concepts such as probability distributions, standard deviation, coefficient of variation, confidence intervals, linear regression, standard error, and plotting techniques. This will include an introduction to curve fitting, and we introduce the Python libraries numpy and pylab to add tools to create simulations, graphs, and predictive models.

We will spend some time on random walks and Monte Carlo simulations, a very powerful class of algorithms which invoke random sampling to model and compute mathematical or physical systems. The Monty Hall problem is used as an example of how to use simulations, and the knapsack problem introduces our discussion of optimization. Finally, we will begin looking at supervised and unsupervised machine learning, and then turn to data clustering.

At the end of Unit 2 there will be an exam covering all material (lectures, recitations, and problem sets) from the beginning of the course through More Optimization and Clustering.

UNIT 3

We start Unit 3 by continuing our discussion of data clustering from Unit 2. We introduce graphs as a set of nodes and edges, and learn how these can help solve degrees-of-separation problems and find a shortest path. We will practice using pseudocode as preparation for writing code, and learn about dynamic programming as we attempt to write optimally efficient programs.

In order to become better statistical thinkers, we will learn to spot and avoid several common logical and statistical fallacies, such as bias, data enhancement, causal fallacies, and the Texas sharpshooter fallacy. We introduce queuing network simulations, and compare the most common queue disciplines. The last session presents different possible careers in computer science, and its application across diverse fields and industries.

Unit 3 concludes with a Final Exam covering all material (lectures, recitations, and problem sets) from the beginning of the course through Queuing Network Models.


Your Instructor(s)


MIT
MIT

The mission of MIT is to advance knowledge and educate students in science, technology, and other areas of scholarship that will best serve the nation and the world in the 21st century.

The Institute is committed to generating, disseminating, and preserving knowledge, and to working with others to bring this knowledge to bear on the world's great challenges. MIT is dedicated to providing its students with an education that combines rigorous academic study and the excitement of discovery with the support and intellectual stimulation of a diverse campus community. We seek to develop in each member of the MIT community the ability and passion to work wisely, creatively, and effectively for the betterment of humankind.


Frequently Asked Questions


When does the course start and finish?
The course starts now and never ends! It is a completely self-paced online course - you decide when you start and when you finish.
How long do I have access to the course?
How does lifetime access sound? After enrolling, you have unlimited access to this course for as long as you like - across any and all devices you own.
What if I am unhappy with the course?
We would never want you to be unhappy! If you are unsatisfied with your purchase, contact us in the first 30 days and we will give you a full refund.

Start Learning Today!