Lab 1: Math Foundations and Environment Setup

due for completion at 11:59PM Ann Arbor Time on Wednesday, May 6th, 2026

Each lab worksheet will contain several activities, some of which will involve writing code and others that will involve writing math on paper. To receive credit for a lab, you must complete as many of the activities as you can in 2 hours and submit a PDF of your work to Gradescope. We will provide specific instructions on how to submit programming activities (e.g. submitting the notebook or including a screenshot of some output).

Feel free to work with others in the course, but you must submit individually.


Activities


Activity 1: Environment Setup and Python Basics

Labs and homeworks will both involve writing some Python code in a Jupyter Notebook.

There are two ways to access the supplemental Jupyter Notebook:

  • Option 1 (preferred): Set up a Jupyter Notebook environment locally, use git to clone our course repository, and open labs/lab01/lab01.ipynb. For instructions on how to do this, see the Environment Setup page of the course website.

  • Option 2: Click here to open lab01.ipynb on DataHub. Before doing so, read the instructions on the Environment Setup page on how to use the DataHub.

Read the Environment Setup section of the course website, eecs245.org/env-setup, for detailed steps on setting up a local environment on your machine. Take the time to follow the steps under Option 1: Local Setup, and let us know if you have any questions.

Then, open the notebook labs/lab01/lab01.ipynb, read it, and complete the tasks inside. Once you’re done, include a screenshot of your completed Task 5 implementation in your PDF submission of Lab 1 to Gradescope, making sure to include proof that the (local) autograder passed.

Optionally, you can submit your completed notebook itself to the Lab 1 Notebook (for practice) assignment on Gradescope; this is not required for credit, but it’s a good way to practice submitting code to Gradescope, which you’ll need to do for some homeworks.


Activity 2: Running Mean

Over the break, you ran a hot chocolate stand. On days 1 through 5 (inclusive), you averaged 50 dollars per day in sales. On days 6 and 7, you averaged 22 dollars per day in sales. What were your average daily sales from days 1 through 7?


Activity 3: A New Meaning

Over the break, in addition to running your hot chocolate stand, you took a road trip to Chicago, 240 miles away.

a)

For the first 120 miles, you averaged 80 miles per hour (mph). For the second 120 miles, you averaged 50 mph. What was your average speed throughout the entire journey? Leave your answer unsimplified in terms of fractions, but plug it into a calculator to get an approximation.

b)

Suppose, instead, you drove 3 segments of 80 miles each, in which you averaged 80 mph, 80 mph, and 50 mph. What was your average speed throughout the entire journey?

c)

In general, suppose you drove \(n\) segments of equal length, and averaged \(x_i\) mph in segment \(i\) (\(i = 1, 2, …, n\)). What was your average speed throughout the entire journey? Give your answer using summation notation. Your answer is the formula for the harmonic mean of the numbers \(x_1, x_2, …, x_n\).


Activity 4: The Meaning of Calculus

Here, we’ll review key ideas from Calculus 1. If you’d like a refresher, see Appendix 2 of the course notes, notes.eecs245.org.

Consider the function:

$$ f(x) = (x-3)^2 + (x-4)^2 + (x-5)^2 + (x - 16)^2 $$
a)

What is the shape of \(f(x)\)? Your answer should be a single word.

b)

Find \(\frac{\text{d}f}{\text{d}x}\), the derivative of \(f(x)\).

c)

Find \(x^*\), the value of \(x\) that minimizes \(f(x)\), and prove that it is indeed a minimum, rather than a maximum.

d)

What does the value of \(x^*\) have to do with the numbers 3, 4, 5, and 16?


Activity 5: Basics of Summation Notation

Here, we’ll review the basics of summation notation. If you’d like a refresher, see Appendix 1 of the course notes, notes.eecs245.org.

Consider the following formula involving the first \(n\) natural numbers, \(1,2,\dots, n\).

$$ 1 + 2 + 3 + \ldots + n = \sum_{i=1}^n i = \frac{n(n+1)}{2} $$

Using the fact above, find \(\displaystyle \sum_{k = 4}^{12} (k+2)\). Verify your answer by calculating the sum directly.


The rest of this worksheet is extra practice. Don’t feel pressured to answer all of these problems in lab, but make sure to attempt them at some point.

Activity 6: The Meaning of Calculus, Continued

$$ f(x) = (x-3)^2 + (x-4)^2 + (x-5)^2 + (x - 16)^2 $$

For each of the following functions \(g(x)\), identify all extrema (that is, maximums and/or minimums). You don’t need to take the derivative in each case, but explain your reasoning.

a)

\(g(x) = \frac{1}{4} f(x)\)

b)

\(g(x) = -f(2x)\)

c)

\(g(x) = \sqrt{f(x)}\)

d)

\(g(x) = f(x) + cx^2\), where \(c \in \mathbb{R}\) (Hint: This may take more effort than the previous 4 did.)


Activity 7: Summation Notation Properties

Suppose \(x_1, x_2, \dots, x_n\) and \(y_1, y_2, \dots, y_n\) are both lists of numbers. Determine whether each of the following expressions is true or false.

a)

\(\displaystyle \sum_{i=1}^n (a x_i + b) = a \sum_{i=1}^n x_i + bn\), where \(a\) and \(b\) are constants.

b)

\(\displaystyle \sum_{i=1}^n (x_i + y_i)^2=\sum_{i=1}^n x_i^2 + \sum_{i=1}^n y_i^2\)

c)

\(\displaystyle \sum_{i=2}^n x_i=\sum_{i=2}^k x_i + \sum_{i=k}^n x_i\)

d)

\(\displaystyle \sum_{i=1}^n (x_i - \bar{x})=\sum_{i=1}^n x_i - n\bar x\), where \(\displaystyle \bar{x}=\frac{1}{n}\sum_{i=1}^{n}x_i\)


Activity 8: Manipulating Sums

Consider the following summations involving the first \(n\) natural numbers, \(1, 2, 3, …, n\).

$$ \begin{align*} 1 + 2 + 3 + \ldots + n &= \sum_{i=1}^n i = \frac{n(n+1)}{2} \\\\ 1^2 + 2^2 + 3^2 + \ldots + n^2 &= \sum_{i=1}^n i^2 = \frac{n(n+1)(2n+1)}{6} \end{align*} $$

Using the formulas above, determine the values of each of the following sums.

a)

\(\displaystyle \sum_{i = 5}^{15} i^2\)

b)

\(\displaystyle \sum_{i = 4}^{9} 3\)

c)

\(\displaystyle \sum_{j = 1}^{20} (1 - 3j)^2\)