Faster than Lightning! Racing on Sorting Networks to Instantly Understand Supercomputer Parallel Computing

We all know computers are fast, but do you know the secret behind their speed? Old computers were like a chef with only one stove—they had to finish making the soup before they could start stir-frying the vegetables (this is called Sequential Processing).
Modern Supercomputers are like a kitchen with thousands of chefs chopping, cooking, and plating all at the same time (this is called Parallel Processing).
Today, we are taking the children outdoors to draw a "Sorting Network" with chalk. We will transform them into "Data Racecars" to experience a magical process where no commander is needed—just follow the lines, and the order sorts itself!

Phase 1: One Person's Limit

First, let's experience what it feels like to have "only one brain."

  1. The Mission Setup:
    • Find 6 children (or use dolls/stuffed animals). Give each one a random number card.
    • The Rules: "I am the only Computer CPU. You need to get in line, but you cannot move on your own. You must wait for my command."
  2. Sequential Processing:
    • The Teacher/Parent begins directing: "Number 3, go to the first spot... Number 5, swap places with Number 2..."
    • Observation: While the parent is directing Person A, Persons B, C, and D are just standing there staring into space.
    • Question: "Did you notice that you spent most of your time just 'waiting'? If I had to sort 100 people this way, would the last person fall asleep before I got to them?"

Phase 2: The Magic Circle on the Ground

Now, we will draw a track that allows everyone to "move without thinking and still get it right."

  1. Drawing the Map:
    • Using reference materials (search for "6-wire sorting network"), use chalk or tape to draw the "Sorting Network" on the ground. It looks like a series of crisscrossing tracks connected by circles (nodes).
    • Clearly mark the "Entrance" and the "Exit."
  2. Explaining the Rules:
    • "This is an auto-pilot race track. You are all racecars holding your number cards."
    • The Mantra:"Stop at the circle, compare your might, then split to the left or right!"
    • The Golden Rule: The Smaller Number takes the Left path (or the Upper path).The Larger Number takes the Right path (or the Lower path).

Phase 3: Racing Against Time

This is the climax of the activity. Children will witness with their own eyes how "Order" automatically emerges from "Chaos."

  1. On Your Marks:
    • 6 children holding random number cards (e.g., 5, 1, 6, 3, 4, 2) stand in the six starting boxes at the Entrance.
  2. Start the Engine:
    • The Teacher/Parent shouts: "Start!"
    • The children walk along the lines.
    • Step 1: Meet a partner, compare numbers, split paths.
    • Step 2: Meet a new partner, compare again, split again.
    • Observation: All comparisons arehappening simultaneously!No one is staring into space; everyone is busy moving.
  3. The Finish Line:
    • When everyone reaches the Exit, ask them to hold up their cards.
    • The Surprise Moment: "Oh my goodness! The numbers were messy, but now they are perfectly lined up: 1, 2, 3, 4, 5, 6!"
    • Teacher/Parent : "Did I give you any commands? No! The Map (The Algorithm) sorted you automatically!"

Phase 4: Concept Connection

Why is this Faster?

  • Teacher/Parent: "We were running around just now, and we actually performed about 12 comparisons (checking who is bigger). But it felt like it only took a tiny bit of time. Why?"
  • Child: "Because we all did it at the same time!"
  • Teacher/Parent: "Bingo! That is the secret of Supercomputers. It is called 'Parallel Processing.'"
  • Real-world Application: This is why your computer can let you watch YouTube, download a game, and run other programs all at once. It has many "hands" working simultaneously.

Phase 5: Debug & Challenge

What if the Rules Change?

Test the children's understanding of the algorithm's logic by tweaking the rules.

  • Challenge 1: Reverse Thinking
    • Question: "If we flip the rule: 'Big goes Left, Small goes Right,' what do you think will happen to the result?"
    • Experiment: Let the children run the course again.
    • Discovery: The final order becomes largest to smallest (6, 5, 4...)!
  • Challenge 2: Music and Words
    • Question: "Does this magic track only work for numbers?"
    • Experiment: Try using cards with letters (A, B, C, D) or different musical notes (Do, Re, Mi).
    • Conclusion: Anything that can be "compared" (Greater than / Less than) can be sorted by this network!

Teaching Observation Checklist

This chart helps you guide the child to observe the power of "Parallelism" rather than just focusing on winning or losing.

Observation PointLess Effective ResponseMore Effective Scaffolding
When a child goes the wrong way"You went the wrong way. Start over.""Hmm? It looks like there is a 'traffic jam' here. If you are holding 5 and he is holding 3, according to the 'Small Left, Big Right' rule, where should the track take you?" (Attribute the error to execution logic, not the child's ability)
Explaining the complex lines"This is just the formula for the sorting network.""This is like designing a conveyor belt in a factory. As long as the belt (lines) is drawn correctly, no matter what numbers you throw in, a tidy product comes out. That is the power of automation!"
Comparing Sequential vs. Parallel"Parallel processing is faster.""If you were alone (like cooking on one stove), how would you do it? If you had many people (four stoves), how would you do it? Which one saves more time?"

Suggestions for Teachers & Parents

"Chalk and Floor" are the best tools for this lesson. Do not play this on paper; you must let the children move.

When a child stops at a circle to wait for a partner to arrive, that is a perfect demonstration of "Synchronization." In parallel computing, the fast processes often must wait for the slow ones to arrive before the next comparison can happen. This physical act of "waiting" is excellent embodied learning!

A Technical Note: While we call this a "Network," it is just one of many types in Computer Science. Common networks are communication networks (like the Internet or phone lines). Note that the Sorting Network in this activity is technically a Comparator Network, because each node compares two values rather than connecting devices. It is distinct from route maps or the internet, but it is a powerful way to visualize logic!

排序網路演示

網路大小
排序模式
速度
1.0x
移動次數
0
進度
0/6
網路拓撲圖
INPUT
COMPARATOR
OUTPUT

Reference :csunplugged sorting networks