ENGR108: Introduction to Matrix Methods

Announcements

  • This is the website for ENGR108, Fall Quarter 2025–26.

  • The first lecture is Tuesday September 23, 9am, in Hewlett Teaching Center 201.

  • Course materials, assignments, and the discussion forum will be accessed through Ed, which can also be accessed via Canvas. You must be registered in the course to access these. (The course slides and textbook are accessible to anyone, from this web page.)

About ENGR108

ENGR108 was originally created as EE103/CME103 by Stephen Boyd and a group of (then) undergraduate students, and taught for the first time Autumn quarter 2014–15.

ENGR108 covers the basics of vectors and matrices, solving linear equations, least-squares methods, and many applications. We'll cover the mathematics, but the focus will be on using matrix methods in applications such as tomography, image processing, data fitting, time series prediction, finance, and many others. Matrix methods should not be a spectator sport. In this course, students use the language Julia to do computations with vectors and matrices.

The course is suitable for any undergraduate with the prerequisites or equivalent background.

The class is based on a book by Stephen Boyd and Lieven Vandenberghe (at UCLA), which is available on-line.

ENGR108 is part of the EE and MS&E core requirements, and certified as a Ways of Thinking course for both formal reasoning (FR) and applied quantitative reasoning (AQR). Additionally, this course is approved for the Computer Science BS Math Elective and also satisfies the Mathematics & Statistics requirement in the School of Engineering.

Instructors

CAs / section leaders

Contacting the course staff

You can use the messaging system in Ed to contact us about course-related topics. Alternatively, the email address engr108-aut2526-staff@lists.stanford.edu will go to the instructor and CAs. Please do not use the Professor's or the CAs’ direct email addresses for matters related to the course.

Textbook

The textbook is written by Stephen Boyd and Lieven Vandenberghe, and is available on-line. You will not need to consult any other books or materials, but you are welcome to do so.

Lectures

Tuesdays and Thursdays, 9am–10:20am, in Hewlett Teaching Center 201. Our first lecture will be Tuesday September 23.

Sections

The sections will be assigned and meet weekly starting the second week of classes.

Course requirements

  • Attendance and participation at sections.

  • Weekly homework assignments. Homework will normally be assigned each Thursday, and due the following Thursday at midnight PST. Late homework will not be accepted. You are allowed, even encouraged, to work on the homework in small groups, but you must write up your own homework to hand in.

  • Midterm exam. In class, during the Thursday of week five, October 23.

  • Final exam. Wednesday December 10, 8:30–11:30am.

Grading

  • Grades will be based on section attendance/participation 10%, homework 35%, midterm 20%, and final 35%.

  • Each homework problem will be graded roughly, with grades 0 (no attempt or major errors), 1 (OK, but some errors), and 2 (good, possibly with a minor error).

Large language model policy

When you later use the material you learn in this class, you will definitely have access to and use LLMs, at least to generate code. An important skill you will need is the ability to check that what's generated is correct, and debug it if it is not. For this reason we allow you to use LLMs on your homework, though we recommend you do this after you've solved the problems yourself. We will grade homework submissions that use notation that we do not use, or concepts we have not yet covered, harshly. It's your responsiblity to learn the material; if you simply let an LLM do your homework, you won't learn, and you will do very poorly on the exams.

Prerequisites

You do not need to have seen any linear algebra before; we will develop it from scratch. Math 51 is nominally a prerequisite, but we will use very little of this material. In the course you'll do some very simple programming in the language Julia, so you should have seen some very basic simple programming. CS106A or equivalent (which is much more than you will need) is a prerequisite or corequisite. You do not need to know about any applications; we'll cover that in detail. Even if you have already seen all the material in the course (e.g., vectors, matrices, least squares) we encourage you to take it, because (we guess) you haven't seen it the way we will present it.

Syllabus

We will cover textbook chapters 1–17 (i.e., up through constrained least squares applications).

Catalog description

Introduction to applied linear algebra with emphasis on applications. Vectors, norm, and angle; linear independence and orthonormal sets; applications to document analysis. Clustering and the k-means algorithm. Matrices, left and right inverses, QR factorization. Least-squares and model fitting, regularization and cross-validation. Constrained and nonlinear least squares. Applications include time-series prediction, tomography, optimal control, and portfolio optimization. Prerequisites: MATH 51 or CME 100, and basic knowledge of computing (CS 106A is more than enough, and can be taken concurrently).

ENGR108 is part of the EE and MS&E core requirements, approved for the CS BS Math Elective and the Mathematics & Statistics requirement in the School of Engineering, and certified as a Ways of Thinking (Formal Reasoning) course.

ENGR108 and Math 104 cover complementary topics in applied linear algebra. The focus of ENGR108 is on a few linear algebra concepts, and many applications; the focus of Math 104 is on algorithms and concepts.

Course objectives

The goal of this course is to introduce you to the basic ideas of vectors, matrices, and (very basic) linear algebra, emphasizing applications. We hope that you'll learn how linear algebra is all around you, and how it is used in zillions of applications. You'll learn some basic machine learning, portfolio optimization and finance, audio and image processing, and other applications.

Intended audience

The course is targeted at undergraduate students in all fields, just as CS106a is. As long as you've got the prerequisites, and are up for it, you're welcome.