Skip to content Skip to navigation

Engineering & Computer Science

Topic Image: 
Engineering and Computer Science

Cryptography I

Monday, January 5, 2015 to Monday, March 9, 2015

About the Course

Cryptography is an indispensable tool for protecting information in computer systems. This course explains the inner workings of cryptographic primitives and how to correctly use them. Students will learn how to reason about the security of cryptographic constructions and how to apply this knowledge to real-world applications. The course begins with a detailed discussion of how two parties who have a shared secret key can communicate securely when a powerful adversary eavesdrops and tampers with traffic. We will examine many deployed protocols and analyze mistakes in existing systems. The second half of the course discusses public-key techniques that let two or more parties generate a shared secret key. We will cover the relevant number theory and discuss public-key encryption and basic key-exchange. Throughout the course students will be exposed to many exciting open problems in the field.

The course will include written homeworks and programming labs. The course is self-contained, however it will be helpful to have a basic understanding of discrete probability theory.

  • Will I get a statement of accomplishment after completing this class?

    Yes. Students who successfully complete the class will receive a statement of accomplishment signed by the instructor.

  • What is the format of the class?

    The class will consist of lecture videos, which are broken into small chunks, usually between eight and twelve minutes each. Some of these may contain integrated quiz questions. There will also be standalone quizzes that are not part of video lectures, and programming assignments. There will be approximately two hours worth of video content per week.

  • How much programming background is needed for the course?

    The course includes programming assignments and some programming background will be helpful. However, we will hand out lots of starter code that will help students complete the assignments. We will also point to online resources that can help students find the necessary background.

  • What math background is needed for the course?

    The course is mostly self contained, however some knowledge of discrete probability will be helpful. The wikibooks article on discrete probability should give sufficient background.

  • Can I see a preview of the lectures and homework?

    Yes, check out this preview site.

Dan Boneh


Monday, November 3, 2014

About This Course

This self-paced course will discuss the major ideas used today in the implementation of programming language compilers, including lexical analysis, parsing, syntax-directed translation, abstract syntax trees, types and type checking, intermediate languages, dataflow analysis, program optimization, code generation, and runtime systems. As a result, you will learn how a program written in a high-level language designed for humans is systematically translated into a program written in low-level assembly more suited to machines. Along the way we will also touch on how programming languages are designed, programming language semantics, and why there are so many different kinds of programming languages.

The course lectures will be presented in short videos. To help you master the material, there will be in-lecture questions to answer, quizzes, and two exams: a midterm and a final. There will also be homework in the form of exercises that ask you to show a sequence of logical steps needed to derive a specific result, such as the sequence of steps a type checker would perform to type check a piece of code, or the sequence of steps a parser would perform to parse an input string. This checking technology is the result of ongoing research at Stanford into developing innovative tools for education, and we're excited to be the first course ever to make it available to students.

An optional course project is to write a complete compiler for COOL, the Classroom Object Oriented Language. COOL has the essential features of a realistic programming language, but is small and simple enough that it can be implemented in a few thousand lines of code. Students who choose to do the project can implement it in either C++ or Java.

Why Study Compilers?

Everything that computers do is the result of some program, and all of the millions of programs in the world are written in one of the many thousands of programming languages that have been developed over the last 60 years. Designing and implementing a programming language turns out to be difficult; some of the best minds in computer science have thought about the problems involved and contributed beautiful and deep results. Learning something about compilers will show you the interplay of theory and practice in computer science, especially how powerful general ideas combined with engineering insight can lead to practical solutions to very hard problems. Knowing how a compiler works will also make you a better programmer and increase your ability to learn new programming languages quickly.


No prerequisites are needed for this course.

Frequently Asked Questions

Do I need to buy a textbook?

No, no textbook is required for the class. However, you may find a textbook useful as a reference or to learn more details of some of the ideas discussed in the course. There are a number of good textbooks on compilers; here are three in particular:

  1. Compilers: Principles, Techniques, and Tools (Second Edition)
    Alfred Aho, Monica Lam, Ravi Sethi, and Jeffrey Ullman.

  2. Modern Compiler Implementation in Java (Second Edition)
    Andrew Appel and Jens Palsberg.
    Cambridge University Press
  3. Engineering a Compiler
    Keith Cooper and Linda Torczon.
    Morgan Kaufman

Will I get a Statement of Accomplishment after completing this class?

Yes. Students who successfully complete the class will receive a statement of accomplishment signed by the instructor.

How is the class structured?

Each week there will be a number of videos to watch, most of which will include an in-video quiz question to answer. Most weeks there will also be homeworks (done on-line) and a quiz. There will be also be a midterm and a final exam.

How do I ask questions?

There will be an online discussion forum in which students can ask questions and receive answers. As this course is self-paced, the forum will be largely unmoderated. Answers will come from fellow participants, as a result.

How much does the course cost?

The course is free and there is no charge for registering on the site.

How much time will I need to apply to this course each week?

The estimated effort per week will vary per student, but basically, you should expect to spend:

  • * 3 hours per week in this course if you are not planning to do the programming assignments.
  • * 6-10 hours per week for experienced programmers.

Your mileage will vary, depending on how well you already know the programming language, how long it takes to learn to use the tools and libraries, and how experienced you are at debugging.       

Alex Aiken

Quantum Mechanics for Scientists and Engineers

Tuesday, September 30, 2014

[[{"fid":"7056","view_mode":"default","fields":{"format":"default"},"type":"media","attributes":{"height":"390","width":"640","alt":"Quantum Mechanics - David A.B. Miller","class":"panopoly-image-video media-element file-default"}}]]

About This Course

This course aims to teach quantum mechanics to anyone with a reasonable college-level understanding of physical science or engineering. Quantum mechanics was once mostly of interest to physicists, chemists and other basic scientists. Now the concepts and techniques of quantum mechanics are essential in many areas of engineering and science such as materials science, nanotechnology, electronic devices, and photonics. This course is a substantial introduction to quantum mechanics and how to use it. It is specifically designed to be accessible not only to physicists but also to students and technical professionals over a wide range of science and engineering backgrounds.

Course Topics

Introduction to quantum mechanics

How quantum mechanics is important in the everyday world, the bizarre aspects and continuing evolution of quantum mechanics, and how we need it for engineering much of modern technology.

Schroedinger’s wave equation

Getting to Schroedinger’s wave equation. Key ideas in using quantum mechanical waves — probability densities, linearity. The "two slit" experiment and its paradoxes.

Getting "quantum" behavior

The "particle in a box", eigenvalues and eigenfunctions. Mathematics of quantum mechanical waves.

Quantum mechanics of systems that change in time

Time variation by superposition of wave functions. The harmonic oscillator. Movement in quantum mechanics — wave packets, group velocity and particle current.

Measurement in quantum mechanics

Operators in quantum mechanics — the quantum-mechanical Hamiltonian. Measurement and its paradoxes — the Stern-Gerlach experiment.

Writing down quantum mechanics simply

A simple general way of looking at the mathematics of quantum mechanics — functions, operators, matrices and Dirac notation. Operators and measurable quantities. The uncertainty principle.

The hydrogen atom

Angular momentum in quantum mechanics — atomic orbitals. Quantum mechanics with more than one particle. Solving for the the hydrogen atom. Nature of the states of atoms.

How to solve real problems

Approximation methods in quantum mechanics.


The course is approximately at the level of a first quantum mechanics class in physics at a third-year college level or above, but it is specifically designed to be suitable and useful also for those from other science and engineering disciplines.

The course emphasizes conceptual understanding rather than a heavily mathematical approach, but some amount of mathematics is essential for understanding and using quantum mechanics. The course presumes a mathematics background that includes basic algebra and trigonometry, functions, vectors, matrices, complex numbers, ordinary differential and integral calculus, and ordinary and partial differential equations.

In physics, students should understand elementary classical mechanics (Newton’s Laws) and basic ideas in electricity and magnetism at a level typical of first-year college physics. (The course explicitly does not require knowledge of more advanced concepts in classical mechanics, such as Hamiltonian or Lagrangian approaches, or in electromagnetism, such as Maxwell’s equations.) Some introductory exposure to modern physics, such as the ideas of electrons, photons, and atoms, is helpful but not required.

The course will include “refresher” resources for the required mathematics and physics background.

Course Staff

David Miller

David Miller is the W. M. Keck Foundation Professor of Electrical Engineering and, by Courtesy, Professor of Applied Physics, both at Stanford University. He received his B. Sc. and Ph. D. degrees in Physics in Scotland, UK from St. Andrews University and Heriot-Watt University, respectively. Before moving to Stanford in 1996, he worked at AT&T Bell Laboratores for 15 years. His research interests have included physics and applications of quantum nanostructures, including invention of optical modulator devices now widely used in optical fiber communications, and fundamentals and applications of optics and nanophotonics. He has received several awards and honorary degrees for his work, is a Fellow of many major professional societies in science and engineering, including the Royal Society of London, and is a member of both the National Academy of Sciences and the National Academy of Engineering in the US. He has taught quantum mechanics at Stanford for more than 10 years to a broad range of students ranging from physics and engineering undergraduates to graduate engineers and scientists in many disciplines.

Frequently Asked Questions

Do I need to buy a textbook?

You do not need to buy a textbook; the course is self-contained. My book “Quantum Mechanics for Scientists and Engineers” (Cambridge, 2008) is an optional additional resource for the course. It follows essentially the same syllabus, has additional problems and exercises, allows you to go into greater depth on some ideas, and also contains many additional topics for further study.

How much of a time commitment will this course be?

You should expect this course to require 7 – 10 hours of work per week.

Does this course carry any kind of Stanford University credit?


Will I get a Statement of Accomplishment?

Yes, students who score at least 70% will pass the course and receive a Statement of Accomplishment. Students who score at least 90% will receive a Statement of Accomplishment with distinction.

We recommend taking this course on a standard computer using Google Chrome as your internet browser. We are not yet optimized for mobile devices.

Quantum Mechanics for Scientists and Engineers 2  Course Image

Introduction to Haptics (Self-Paced)

Wednesday, October 1, 2014


[[{"fid":"8636","view_mode":"default","fields":{"format":"default"},"type":"media","attributes":{"height":"390","width":"640","alt":"Haptics Course Introduction","class":"panopoly-image-video media-element file-default"}}]]

Participants in this class will learn how to build, program, and control haptic devices, which are mechatronic devices that allow users to feel virtual or remote environments. In the process, users will gain an appreciation for the capabilities and limitations of human touch, develop an intuitive connection between equations that describe physical interactions and how they feel, and gain practical interdisciplinary engineering skills related to robotics, mechanical engineering, electrical engineering, bioengineering, and computer science. To participate fully, users will need to acquire/build the components of a Hapkit, and assemble and program the device. Laboratory assignments using Hapkit will give users hands-on experience in assembling mechanical systems, making circuits, programming Arduino-based micro-controllers, and testing their haptic creations. (You can still take the online course without the Hapkit, but you will not be able to do most of the laboratories.) After the class, we hope that you will continue to use and modify your Hapkit, and let us know about your haptic creations.


This is a self-paced course, so you can complete the videos, quizzes, and lab assignments on your own schedule. Grading is automated. However, we suggest spending about one week on each of the 5 modules in the course, with each module taking about 10 hours of your time (depending on your background/experience).


The required background for this course is high-school physics (non-calculus is fine) and pre-calculus. Beginning programming is experience is helpful. Haptic device design, robotics, and mechatronics experience are not required -- this is designed as a gateway course for these topics.


Allison Okamura (Instructor)

Allison is an associate professor in the Stanford University mechanical engineering department and (by courtesy) computer science department. She is the director of theCollaborative Haptics and Robotics in Medicine (CHARM) Laboratory. Allison creates robots and human-computer interfaces that use haptics (the sense of touch) in order to improve human health, safety, and quality of life. She and her students study applications of haptic technology in robot-assisted surgery, prosthetics, rehabilitation, simulation and training, space teleoperation, and education. Allison is committed to sharing her passion for research and discovery, using robotics and haptics in outreach programs to groups underrepresented in engineering. Outside academia, she enjoys spending time with her husband and two children, running, and playing ice hockey.

Melisa Orta (Teaching Assistant)

Melisa is a Ph.D. student in the mechanical engineering department at Stanford University. She received her bachelor’s degree from Monterrey Institute of Technology, her Master's degree at Stanford University, and worked for several years at Apple.

Computer Science 101 (Self-Paced)

CS101 now self paced!

The active course run for CS101 has ended, but the course is now available in a self paced mode. You are welcome to join the course and work through the material and exercises at your own pace. When you have completed the exercises with a score of 80% or higher, you can generate your Statement of Accomplishment from within the course.

The course will remain available for an extended period of time. We anticipate the content will be available until at least Sept 1, 2015. You will be notified by email of any changes to content availability beforehand.   

About CS101

CS101 teaches the essential ideas of Computer Science for a zero-prior-experience audience. Computers can appear very complicated, but in reality, computers work within just a few, simple patterns. CS101 demystifies and brings those patterns to life, which is useful for anyone using computers today.

In CS101, participants play and experiment with short bits of "computer code" to bring to life to the power and limitations of computers. Everything works within the browser, so there is no extra software to download or install. CS101 also provides a general background on computers today: what is a computer, what is hardware, what is software, what is the internet. No previous experience is required other than the ability to use a web browser.


  • The nature of computers and code, what they can and cannot do
  • How computer hardware works: chips, cpu, memory, disk
  • Necessary jargon: bits, bytes, megabytes, gigabytes
  • How software works: what is a program, what is "running"
  • How digital images work
  • Computer code: loops and logic
  • Big ideas: abstraction, logic, bugs
  • How structured data works
  • How the internet works: ip address, routing, ethernet, wi-fi
  • Computer security: viruses, trojans, and passwords, oh my!
  • Analog vs. digital
  • Digital media, images, sounds, video, compression

This July-2014 version is the newest edition of CS101, and it's now running on Stanford's own Stanford Online site. There was an older version we ran on Coursera, so you may see links pointing to the old version scattered around the internet.


Zero computer experience is assumed beyond a basic ability to use a web browser.

Nick Parlante
Computer Science 101 Self Paced  Course Image

Introduction to Chemical Engineering (Self-Study Resource)


Overview of chemical engineering through discussion and engineering analysis of physical and chemical processes. Topics: overall staged separations, material and energy balances, concepts of rate processes, energy and mass transport, and kinetics of chemical reactions. Applications of these concepts to areas of current technological importance: biotechnology, energy, production of chemicals, materials processing, and purification.


Chaitan Khosla

Chaitan Khosla is a Professor in the Departments of Chemical Engineering and Chemistry at Stanford University, and Director of the Stanford Institute for Chemical Biology. He received his PhD in chemical engineering in 1990 at Caltech. After completing postdoctoral studies in genetics at the John Innes Centre in the UK, he joined Stanford University in 1992. His research on polyketide synthases has opened the door to fundamentally new approaches for engineering of antibiotics. More recently, he has also investigated celiac sprue pathogenesis with the goal of developing therapies for this widespread but overlooked disease. He has co-authored over 300 peer-reviewed publications and 75 issued U.S. patents, and is the recipient of several awards and honors including the Eli Lilly Award in Biological Chemistry and the Pure Chemistry Award from the American Chemical Society; the Allan P. Colburn Award and the Professional Progress Award from the American Institute of Chemical Engineers; and the Alan T. Waterman Award from the National Science Foundation. He is an elected member of the American Academy for Arts and Science and the National Academy of Engineering. Over the past two decades, he has co-founded four biotechnology companies (Kosan Biosciences (KOSN), Alvine Pharmaceuticals, Flamentera AG, Sitari Pharmaceuticals), and was the founding President of the non-profit Celiac Sprue Research Foundation.

Lisa Hwang

Lisa Hwang has been a lecturer in the Department of Chemical Engineering since 2006. She has taught a variety of undergraduate and graduate level courses as well as worked on several projects related to curriculum development and other programmatic needs within the department such as training for teaching assistants. She also spends a portion of her time as a Center for Teaching and Learning Consultant focused on supporting faculty and lecturers. She received her PhD in Chemical Engineering in 2006 from Stanford University.


Do I need to buy a textbook?

No, the course materials necessary will be available online.

Introduction to Chemical Engineering (Self-Study Resource)

Audio Signal Processing for Music Applications

Wednesday, October 1, 2014 to Friday, December 19, 2014

About the Course

Audio signal processing is an engineering field that focuses on the computational methods for intentionally altering sounds, methods that are used in many musical applications.

We have tried to put together a course that can be of interest and accessible to people coming from diverse backgrounds while going deep into several signal processing topics. We focus on the spectral processing techniques of relevance for the description and transformation of sounds, developing the basic theoretical and practical knowledge with which to analyze, synthesize, transform and describe audio signals in the context of music applications.

The course is based on open software and content. The demonstrations and programming exercises are done using Python under Ubuntu, and the references and materials for the course come from open online repositories. We are also distributing with open licenses the software and materials developed for the course.

Recommended Background

The course assumes some basic background in mathematics and signal processing. Also, since the assignments are done with the programming language Python, some software programming background in any language is most helpful. 

Suggested Readings

The main software tools used are in and the sounds to be studied come from Most of the external references come from Julius O Smith website,, or from

Course Format

Each week is structured around 6 types of activities:

  • Theory: video lectures covering the core signal processing concepts.   
  • Demos: video lectures presenting tools and examples that complement the theory.
  • Programming: video lectures introducing the needed programming skills (using Python) to implement the techniques described in the theory. 
  • Quiz: questionnaire to review the concepts covered. 
  • Assignment: programming exercises to implement and use the methodologies presented. 
  • Advanced topics: videos and written documents that extend the topics covered.
  • How much programming background is needed for the course?
    All the assignments start from some existing Python code that the student will have to understand and modify. Some programming experience is necessary.

  • Do I need to buy a textbook for the course?
    No, it is self-contained.
  • What resources will I need for this class?
    All the materials and tools for the class are available online under open licences.

  • What is the coolest thing I'll learn if I take this class?
    You will play around with sounds a lot, analysing them, transforming them, and making interesting new sounds.

  • Will I earn a Statement of Accomplishment for completing this course?
    Yes, you will receive a Statement of Accomplishment if you successfully complete the course.


Xavier Serra; Universitat Pompeu, Fabra of Barcelona

Julius O Smith; Stanford University

Surveillance Law

Tuesday, October 14, 2014 to Tuesday, December 9, 2014

About the Course

It’s easy to be cynical about government surveillance. In recent years, a parade of Orwellian disclosures have been making headlines. The FBI, for example, is hacking into computers that run anonymizing software. The NSA is vacuuming up domestic phone records. Even local police departments are getting in on the act, tracking cellphone location history and intercepting signals in realtime.

Perhaps 2014 is not quite 1984, though. This course explores how American law facilitates electronic surveillance—but also substantially constrains it. You will learn the legal procedures that police and intelligence agencies have at their disposal, as well as the security and privacy safeguards built into those procedures. The material also provides brief, not-too-geeky technical explanations of some common surveillance methods.

Suggested Readings

There is no required textbook for the course. All readings will be provided online.

Several tomes discuss electronic surveillance in detail. For further reading, you might consider Dragnet Nation and No Place to Hide. If you'd like a more lawyerly take, we highly recommend the (free and public) Department of Justice manual on electronic evidence. A number of casebooks also touch on government surveillance, including Criminal Procedure: Investigation, Information Privacy Law, and Internet Law. 

Much of the best legal writing on electronic surveillance is posted to blogs. You might also take a look at The Volokh Conspiracy, Lawfare, and Just Security. 

Keep in mind that this area of law is evolving rapidly. If you encounter an explanation that seems outdated, it probably is. When this material was last offered at Stanford, for example, the law changed multiple times during the course.

Course Format

The class will consist primarily of lectures, each about 5-10 minutes long. There will be occasional assigned quizzes; they are intended to make sure you understand the material and should not be too tricky. You will also be expected to participate in forum discussions.

Algorithms: Design and Analysis, Part 1

Monday, October 13, 2014 to Monday, November 24, 2014

About the Course

In this course you will learn several fundamental principles of algorithm design. You'll learn the divide-and-conquer design paradigm, with applications to fast sorting, searching, and multiplication. You'll learn several blazingly fast primitives for computing on graphs, such as how to compute connectivity information and shortest paths. Finally, we'll study how allowing the computer to "flip coins" can lead to elegant and practical algorithms and data structures. Learn the answers to questions such as: How do data structures like heaps, hash tables, bloom filters, and balanced search trees actually work, anyway? How come QuickSort runs so fast? What can graph algorithms tell us about the structure of the Web and social networks? Did my 3rd-grade teacher explain only a suboptimal algorithm for multiplying two numbers?

Recommended Background

How to program in at least one programming language (like C, Java, or Python); and familiarity with proofs, including proofs by induction and by contradiction.  At Stanford, a version of this course is taken by sophomore, junior, and senior-level computer science majors. 

Suggested Readings

No specific textbook is required for the course.  Much of the course material is covered by the well-known textbooks on algorithms, and the student is encouraged to consult their favorite for additional information.

Course Format

The class will consist of lecture videos, generally between 10 and 15 minutes in length. These usually integrated quiz questions. There will also be standalone homeworks and programming assignments that are not part of video lectures, and a final exam.
  • Will I get a statement of accomplishment after completing this class?

    Yes. Students who successfully complete the class will receive a statement of accomplishment signed by the instructor.

  • What is the format of the class?

    The class consists of lecture videos, which are broken into small chunks, usually between eight and twelve minutes each. Some of these may contain integrated quiz questions. There will also be standalone quizzes that are not part of video lectures. There will be approximately two hours worth of video content per week.

  • What should I know to take this class?

    How to program in at least one programming language (like C, Java, or Python); familiarity with proofs, including proofs by induction and by contradiction; and some discrete probability, like how to compute the probability that a poker hand is a full house. At Stanford, a version of this course is taken by sophomore, junior, and senior-level computer science majors.

  • How does Algorithms: Design and Analysis differ from the Princeton University algorithms course?

    The two courses are complementary. That one emphasizes implementation and testing; this one focuses on algorithm design paradigms and relevant mathematical models for analysis. In a typical computer science curriculum, a course like this one is taken by juniors and seniors, and a course like that one is taken by first- and second-year students.

Tim Roughgarden
Algorithms: Design and Analysis, Part I  Course Image

Mining Massive Datasets

Monday, September 29, 2014 to Monday, December 1, 2014

About the Course

This class teaches algorithms for extracting models and other information from very large amounts of data. The emphasis is on techniques that are efficient and that scale well.

We introduce the student to modern distributed file systems and MapReduce, including what distinguishes good MapReduce algorithms from good algorithms in general.  The rest of the course is devoted to algorithms for extracting models and information from large datasets.  Students will learn how Google's PageRank algorithm models importance of Web pages and some of the many extensions that have been used for a variety of purposes.  We'll cover locality-sensitive hashing, a bit of magic that allows you to find similar items in a set of items so large you cannot possibly compare each pair.  When data is stored as a very large, sparse matrix, dimensionality reduction is often a good way to model the data, but standard approaches do not scale well; we'll talk about efficient approaches.  Many other large-scale algorithms are covered as well, as outlined in the course syllabus.

Recommended Background

A course in database systems programming (e.g., SQL) is recommended, as is a basic course on algorithms and data structures.

Suggested Readings

There is a free book "Mining of Massive Datasets, by Leskovec, Rajaraman, and Ullman (who by coincidence are the instructors for this course :-).  You can download it at  Hardcopies can be purchased from Cambridge Univ. Press.

Course Format

There will be about 2 hours of video to watch each week, broken into small segments.  There will be automated homeworks to do for each week, and a final exam.

  • Will I get a Statement of Accomplishment after completing this class?

    Yes. Students who successfully complete the class will receive a Statement of Accomplishment signed by the instructors.  A level designated "distinction" will also be offered.


Jure Leskovec Stanford University
Anand Rajaraman Stanford University
Jeff Ullman Stanford University
Mining course feature image


Subscribe to RSS - Engineering & Computer Science