Programming, problem solving, and algorithms

CPSC 203, 2025 W2

April 9, 2026

Strongly Connected Components

I ♥ National Parks

Pointillism

Stained Glass?

Stained Glass?

Phone a Friend

 

“What you need are superpixels!”

Superpixels

Equal sized, continuous, compact regions that honor boundaries.

Phone a Friend

 

“How will you know if you’ve done a good job?”

Gerrymandering

Gerrymandering

NC — gerrymandered

NC — compact

Equal sized, continuous, compact regions?

Canada Fixed It

In 1964 a law was passed requiring each province to form an independent panel to draw boundaries.

Which is fair?

Which is fair?

Which is fair?

How will you know if you’ve done a good job?

For each district, count wasted votes:

Observe:

  • Any vote over 50% for the district winner is wasted.
  • Any vote over 0% for the district loser is wasted.

Suggests a simple metric of quality!

For each district:

  • Count votes over 50% for district winner
  • Count votes for district loser
  • Sum wasted votes for each party
  • Find difference between two numbers as fraction of votes cast

Efficiency Gap

The Rabbit Hole

What should we do with the gap?

  1. What would Nate Silver do?
  2. What happens in the limit?
  3. What happens in a multi-party system?
  4. Is there an MLE for the gap?
  5. Can I apply this within a clustering algorithm on pixels?

Strong Connectivity


A Diversity Diversion

Diverse teams improve results:

  • Cognitive Diversity and Speed: cognitively diverse teams solve problems up to 3x faster and consider 48% more solutions (HBR/SA).

  • Reduced Groupthink and Bias: groups with diverse members are more likely to correct errors and avoid groupthink, making them more accurate in decisions (NLI).

  • Innovation Boost: cognitive diversity can improve team innovation by 20% (JoAP).

Inherent diversity: characteristics we’re born with or into.

Acquired diversity: the breadth of our interests, experiences, and connections.

A Diversity Diversion

Gratitude

Thank you for being so bright and so fun to teach.

Thank you for all the ways you’re going to make the world a better place.