Sorting Socks is Algorithm Complexity

0 Review(s)
641 Download(s)
Rate & Review

Lesson synopsis

socksHow do you know how fast a computer can calculate an answer, or whether an answer can be calculated at all? The field of Computational Complexity is the study of whether problems can be solved, and how fast. This lesson introduces some simple ideas about algorithms and their complexity through a series of exercises involving a collection of socks. Of course, other objects can be used as well. This is an active learning lesson that does not require access to a computer. Linear, polynomial, and logarithmic algorithms are explored building an intuitive understanding of order of magnitude.

Age Levels

11 - 13 years


Introduce students to classic algorithms:
for finding something in a sequence.
for finding something in an ordered list.
for simple sorting.
and provide informal methods for determining algorithm complexity.

Anticipated learner outcomes

Students will be able to:
describe why finding an item in a collection may require looking at each item.
discuss that ordering objects significantly reduces the time needed to find a specified one.
discuss that there are many ways to sort objects.

Optional Writing Activity

Pick your favorite algorithm among the ones you’ve studied. Describe how the algorithm would work on a collection of objects. What attribute would you use for the searching or sorting. Why is it your favorite?

Rate this lesson plan

Add new review

@ symbol
Ray Tomlinson
Ray Tomlinson

Have you ever considered that someone, at some point, was in a position to choose what symbol would be used separate the user from their location in an email address? That person, it turns out, was Ray Tomlinson, and in 1971 he chose "@". Tomlinson is credited with demonstrating the first email sent between computers on a network, and when asked what inspired him to make this selection he said, “Mostly because it seemed like a neat idea.”

After completing his Master’s degree at MIT in 1965, Ray joined the Information Sciences Division of Bolt Beranek and Newman Inc. of Cambridge, Massachusetts. Since then he has made many notable contributions to the world of network computing. He was a co-developer of the TENEX computer system that was popular in the earliest days of the Internet; he developed the packet radio protocols used in the earliest internetworking experiments; he created the first implementation of TCP; and he was the principle designer of the first workstation attached to the Internet.

Liz Gerber - Image credit Lisa Beth Anderson
Liz Gerber
Liz Gerber - Image credit Lisa Beth Anderson

Liz Gerber earned her MS and PhD in Product Design and Management Science and Engineering at Stanford. She specializes in design and human-computer interaction, particularly how social computing supports the innovation process. Her current research investigates crowd-funding as a mechanism for reducing disparities in entrepreneurship.
Gerber's work funded by the US National Science Foundation and the National Collegiate Inventors and Innovators Alliance has appeared in peer-reviewed journals, including Transactions on Computer Human Interactions, Design Studies, and Organization Science.
As an award-winning teacher and researcher, Liz has touched the lives of more than 6,000 students through her teaching at Northwestern's Segal Design Institute and Stanford University's Hasso Plattner's Institute of Design and through her paradigm-shifting creation, Design for America, a national network of students using design to tackle social challenges.

Image credit - Lisa Beth Anderson

MATLAB graph
Cleve Moler

Cleve Moler improved the quality and accessibility of mathematical software and created a highly respected software system called MATLAB. He was a professor of mathematics and computer science for almost 20 years at the University of Michigan, Stanford University, and the University of New Mexico. In the late 1970’s to early 1980’s he developed several mathematical software packages to support computational science and engineering. These packages eventually formed the basis of MATLAB, a programming environment for algorithm development, data analysis, visualization, and numerical computation. MATLAB can be used to solve technical computing problems faster than with traditional programming languages, such as C, C++, and Fortran. Today, Professor Moler spends his time writing books, articles, and MATLAB programs.

Listen to what Professor Moler has to say about his life’s work:

Bletchley Park
Dr. Sue Black
Dr. Sue Black

Dr. Sue Black has demonstrated the power of social networking. She used Web 2.0 technologies to help raise awareness of, and critical funding for, Bletchley Park, the UK World War II center for decrypting enemy messages. She has also been an active campaigner for equality and support for women in technology fields, founding a number of online networking platforms for women technology professionals. A keen researcher, Dr. Black completed a PhD in software measurement in 2001. Her research interests focus on software quality improvements. She has recently won the PepsiCo Women's Inspiration Network award, been named Tech Hero by ITPRO magazine and was awarded the first John Ivinson Award from the British Computer Society. In 2011 Dr. Black set up The goto Foundation, a nonprofit organization which aims to make computer science more meaningful to the public, generate public excitement in the creation of software, and build a tech savvy workforce. Read Sue's blog about The goto Foundation:

Punch card from a COBOL program
Jean Sammet

Jean E. Sammet was one of the first developers and researchers in programming languages. During the 1950’s - 1960’s she supervised the first scientific programming group for Sperry Gyroscope Co. and served as a key member of the original COBOL (COmmon Business-Oriented Language) committee at Sylvania Electric Products. She also taught one of the first graduate programming courses in the country at Adelphi College. After joining IBM in 1961, she developed and directed the first FORMAC (FORmula MAnipulation Compiler). This was the first widely used general language and system for manipulating nonnumeric algebraic expressions. In 1979 she began handling Ada activities for IBM’s Federal Systems Division. Ada is a structured, object-oriented high-level computer programming language, designed for large, long-lived applications, where reliability and efficiency are paramount. Jean has a B.A. from Mount Holyoke College and an M.A. from the University of Illinois, both in Mathematics. She received an honorary D.Sc. from Mount Holyoke (1978).

Image credits