Programming, problem solving, and algorithms

CPSC 203, 2025 W2

January 6, 2026

Introductions

Teaching Staff

  • Prof: Cinda Heeren πŸ“§ cheeren@cs.ubc.ca ⏰ Mon 2–4pm Β· 🏒 ICCS 233 Β· Zoom

  • TA: Minh Anh Nguyen πŸ“§ ⏰ TBD Β· 🏒 TBD

  • TA: Paulette Koronkevich πŸ“§ ⏰ TBD Β· 🏒 TBD

You!

  • Turn to your neighbor and introduce yourself πŸ‘‹
  • Together, come up with one binary question
    that you think will divide the class about in half

Examples:

  • Coke or Pepsi?
  • Spaghetti or Sushi?
  • Morning person or Night owl?

The Flashlight Game πŸ”¦

Rules:

  • Everyone starts in play
  • Each turn, a student poses a valid yes/no question
    • YES = turn on your phone flashlight
    • NO = keep it dark
  • YES people are now on vacation 🌴
    (light stays off from now on β€” relax and enjoy!)

A question is valid if it puts at least 5 and no more than half of the current group on vacation.

End of Game:

  • We stop when 10 or fewer people remain in play
  • Everyone else is happily on vacation 🌴

Debrief πŸ’‘

Punchline questions:

  1. We know we will need at least ______ questions.

  2. We know we will need no more than ______ questions.

  3. Why did we stop at 10 instead of 1?

  4. Why did we do this?

Where to start?

Canvas: https://canvas.ubc.ca/courses/176702

Course Website: https://ubc-cs.github.io/cpsc203

PrairieLearn: https://us.prairielearn.com/pl/course_instance/202804

About This Course

This course will teach you a bunch of different things!

  • Tools: Terminal, Markdown, Git, marimo, PrairieLearn
  • Computer science: Python (!!!), efficiency, web scraping, graphs
  • Data science: pandas, data frames, visualizations
  • Algorithms: many algorithms!
  • Art and creativity: lots of examples!

Term Schedule

Week Monday T R Lab Examlet POTW
1 1/5/2026 πŸŽ‰ πŸŽ‰
2 1/12/2026 πŸŽ‰ πŸŽ‰ πŸͺ„ 🏎️
3 1/19/2026 πŸŽ‰ πŸŽ‰ πŸͺ„ πŸ‹οΈ 🏎️
4 1/26/2026 πŸŽ‰ πŸŽ‰ πŸͺ„ 🀩 🏎️
5 2/2/2026 πŸŽ‰ πŸŽ‰ πŸͺ„ πŸ‹οΈ 🏎️
6 2/9/2026 πŸŽ‰ πŸŽ‰ πŸͺ„ 🀩 🏎️
7 2/16/2026    
8 2/23/2026 πŸŽ‰ πŸŽ‰ πŸͺ„ πŸ‹οΈ 🏎️
9 3/2/2026 πŸŽ‰ πŸŽ‰ πŸͺ„ 🀩 🏎️
10 3/9/2026 πŸŽ‰ πŸŽ‰ πŸͺ„ πŸ‹οΈ 🏎️
11 3/16/2026 πŸŽ‰ πŸŽ‰ πŸͺ„ 🀩 🏎️
12 3/23/2026 πŸŽ‰ πŸŽ‰ πŸͺ„ πŸ‹οΈ 🏎️
13 3/30/2026 πŸŽ‰ πŸŽ‰ πŸͺ„ 🀩 🏎️
14 4/6/2026 πŸŽ‰ πŸŽ‰ πŸͺ„ πŸ‹οΈ

Evaluation

Item Weight Due date(s)
Problems of the Week 10% (10 x 1%) Sundays at 11:59 PM
Labs 5% (10 x 0.5%) Sundays at 11:59 PM
Programming Projects 9% (3 x 3%) Three in the term
Examlets. 50% (5 x 10%) ~ Bi-weekly
Final Exam 26% TBD

Communications

Name Time Location & Zoom
Cinda Mon 2–4pm 🏒 ICCS 233 Β· Zoom
Minh Anh TBD 🏒 TBD
Paulette TBD 🏒 TBD

Semester overview

Handcraft Billboard Hot 100 The Overstory and Pointillism Artificial Music Composition Road Trip Planning Spiderman’s Social Network

Design

Objects

Iteration

Web Scraping

Data Frames

MatPlotLib

Voronoi Diagrams

Efficiency

Markov Chains

Random Numbers

Graphs

Traveling Salesperson

Intractable Problems

Natural Language

This course consists of a sequence of six explorations, assembled to provide a tour through data structure applications and algorithmic design. Built around topics from arts, sciences, and technology, the explorations are thought provoking and engaging. You will emerge from the course with increased proficiency in Python programming, and with a broad spectrum of tools for algorithmic problem solving.

Tangrams

The different geometric shapes of a tangram form a square.

The different geometric shapes of a tangram form a house

Your turn: tangrams

  1. Define a small working group of size up to 4.

  2. One of you share: https://mathigon.org/tangram

  3. Solve as many as you’d like, together

  4. Speculate together on why you’re doing this!!

10:00

Tangrams: Why?

Key insight: The pieces never change. You’re learning to see how the same fundamental components can be combined differently to solve different problems.

This is exactly how programming works:

  • Decomposition: Breaking complex problems into simpler pieces
  • Reusability: The same building blocks (variables, loops, conditionals, functions) solve countless different problems
  • Composition: Different arrangements of the same pieces create different solutions

Just like tangram pieces, programming constructs don’t change. What changes is how you arrange them.

Elegance

We’re going to spend some time on another conceptual metaphor…

A poser: What does it mean for something to be elegant?

Elegance Example?

Scissors

A set of scissors.

A pair of scissors with a single merged handle instead of two making it impossible to open and close blades.

A variety of scissors in different colours.

Summary

Today we have begun to introduce some of the themes and ideas that we’ll see all term long:

  1. Counting steps: what’s the best that can happen? what’s the worst?

  2. Design of Programmatic solutions:

    • decomposition
    • reusability
    • creativity
  3. Elegance?? WHY?