CPSC 203, 2025 W2
January 8, 2026
Website live – please let me know if you see errors!
POTW starts next week! https://us.prairielearn.com/pl/course_instance/202804
Labs start next week. Answer the qualtrics survey!!
Enroll in CPSC203 on PrairieTest: https://us.prairietest.com
We connect the idea of “elegance” to common items and to software design!
The time it takes to solve a problem is one way of measuring the size of a problem. That time can often be described by simple mathematical function.
On Tuesday we introduced elegance as a conceptual metaphor for software engineering.
We looked at the scissors example—form perfectly matched to function, with no unnecessary complexity.
Today, we’re going to dig deeper into this idea:
Find 2 images, one which exemplifies your definition of elegance, and another, of the same type of subject, which decidedly does not.
Navigate to the Elegance Gallery: https://tinyurl.com/eleganceGallery2025w2
Claim an available slide by entering a title.
Upload your images, and then you’re done!
I will move slides to the COMPLETED section of the gallery.
10:00
Gallery: https://tinyurl.com/eleganceGallery2025w2
After looking at the images in the gallery, reflect and write a short definition of the word elegance:
https://forms.gle/MUkpWeGBdxYfnJT37
05:00
How does this apply to the way we solve problems in computing?
Ingenuity:
Simplicity:
Simplicity is the ultimate sophistication. It takes a lot of hard work to make something simple, to truly understand the underlying challenges and come up with elegant solutions. […] It’s not just minimalism or the absence of clutter. It involves digging through the depth of complexity. To be truly simple, you have to go really deep. […] You have to understand the essence of a product in order to be able to get rid of the parts that are not essential.
— Steve Jobs






The language used to communicate patterns uses exactly the same fundamental constructs as Python!!!








General idea: quantify the size of the problem (\(n\)) and consider the cost of our task as that size increases.
05:00
If we are solving a problem ____________ for a given input, we can parameterize the running time of the solution by the size of the input.
We usually denote this input size using the variable \(n\).
![]()
Discussion:
Knitting model:
Side length is \(n\)
One stitch is a unit of work
\(n\) rows, \(n\) stitches per row
Total work is \(n^2\)
Suppose we can knit 1012 stitches per second…
| 10 | 100 | 1000 | 10,000 | 1012 | |
|---|---|---|---|---|---|
| \(n\) | 10-11s | 10-10 s | 10-9 s | 10-8 s | 1 s |
| \(n \log n\) | 10-11 s | 10-9 s | 10-8 s | 10-7 s | 40 s |
| \(n^2\) | 10-10 s | 10-8 s | 10-6 s | 10-4 s | 1012 s |
| \(n^3\) | 10-9 s | 10-6 s | 10-3 s | 1 s | 1024 s |
| \(2^n\) | 10-9 s | 1018 s | 10289 s |
The amount of computation we do inside our algorithm actually matters!
Elegance
Growth of simple functions over time
Representing complexity of a problem using time
Running time of a Python function