Have you ever been in the middle of a game when the screen suddenly freezes? or watched your dad driving in a narrow alley, staring down another car, where neither can move forward or backward? In Computer Science, this is called a "Deadlock."
The internet is like a road, and data (packets) are like cars. If there are no good traffic rules, or if everyone is too selfish (only taking, never giving), the network will crash.
Today, we are going to turn your house into a mini-network. Using a few "oranges (or balls)," we will play a puzzle game that tests the family's chemistry!
In computer networks, if every program looks out only for itself (Greedy), the whole system becomes paralyzed. Through this "Fruit Passing Game," we will let children personally experience what a "Mega Traffic Jam (Deadlock)" feels like, and how to make the network flow again through cooperation.
Phase 1: The Cost of Selfishness
First, we need to manufacture a "stuck" situation so the child understands why computers crash.
- The Mission Setup:
- Find 5 people (or use stuffed animals to save spots) and sit in a circle.
- Stick a label on everyone (A, B, C, D, E).
- Prepare 5 pairs of fruits (e.g., two labeled A, two labeled B...). Shuffle these fruits and distribute them randomly to everyone.
- Everyone should hold two fruits, but ensure one person only holds one, leaving them with one "Empty Hand."
- Rules Explanation:
- Goal: Your label is A. By the end, you must be holding two "A" fruits.
- Movement Rule: You can only pass fruit to your left or right neighbor. Crucially, you can only pass to them if they have an Empty Hand (because one hand can only hold one fruit).
- Manufacturing Deadlock:
- Tell the child: "Okay, as soon as you get the fruit that matches your label (e.g., A gets an A), hold onto it tight and do not pass it to anyone else!"
- Very quickly, the game will freeze. Because everyone is hoarding their own fruit, no one is willing to free up a hand to help pass someone else's fruit. The "Empty Hand" disappears, and no one can move.
- "This is a 'Deadlock.' It's like four cars at a 4-way stop, and everyone wants to go first. The result? No one goes anywhere."

Phase 2: System Reboot—Let the Empty Space Flow
We need to break the stalemate and introduce the concept of "Routing."
- Guiding Reflection:
- "We failed just now because everyone was too 'Selfish' (refusing to pass after getting their own fruit). For Fruit A to travel from the far left to the far right, don't you think B and C need to help pass it along, even if they already have their own fruits?"
- The New Strategy:
- We are no longer looking out only for ourselves. Our goal is to make that one "Empty Hand" run around the circle.
- The Mantra: 「"If you see a gap, fill it! If you have a ball, pass it!"」
Phase 3: The Algorithm of Cooperation
- Executing the Mission:
- Start over. This time, the children must observe: Where is the empty slot (Empty Hand)?
- Scenario: If I am B, and I am holding C's orange, and my neighbor C happens to have an empty hand, I must quickly pass the orange to them.
- Scenario: If I am D, and I have my own D orange, but A's orange is stuck behind me, I must be willing to pass my D orange to a neighbor temporarily to free up space for A to pass through.
- Dynamic Observation:
- You will see the oranges flowing rapidly around the circle, just like traffic moving on a highway.
- Eventually, everyone will hold the oranges that match their labels!
- The Cheer : "We unlocked the Deadlock! The network is flowing!"
Phase 4: Concept Connection
Why Did Everyone Get Stuck?
We just saw that if everyone grabs an orange and refuses to let go, the game ends. In the real world, this "refusal to yield" happens everywhere:
- 1. Traffic Gridlock
- Scenario: Imagine an intersection where cars enter from all four directions at once. Everyone tries to move forward, and they all get stuck in the middle.
- Connection: This is exactly like our game: Car A blocks Car B, B blocks C, and C blocks A. This is a classic Deadlock.
- Solution: Someone must back up (Release Resource) or follow traffic lights (Communication Protocol).
- 2. New Year's Eve Subway Crowds
- Scenario: Thousands of people trying to enter the subway station at once after the fireworks.
- Connection: When too many people compete for the same resource (the train door), pushing happens, and actually, fewer people get in. Speed drops to zero.
- The Concept of Routing: Station staff use megaphones to say, "To Taipei Main Station, go left; to Tamsui, go right." This is "Routing"—planning a path for the massive crowd (Data Packets) so they don't get tied in knots.
- 3. The Banking Deadlock
- Scenario: This is a computer's worst nightmare. Suppose Mike wants to wire money to Sarah, and Sarah wants to wire money to Mike at the exact same time.
- Connection: For safety, the computer "Locks" the accounts during a transfer.
- If programmed poorly, the computer locks Mike's account (waiting for Sarah's money) and simultaneously locks Sarah's account (waiting for Mike's money).
- Both sides are "waiting for the other to move first." They wait forever. The banking system freezes.
Phase 5: Debug & Challenge
Changing the Topology
Networks aren't always circles. We can change the shape (Topology) to increase difficulty.
- Challenge 1: The Long Snake (Line Topology)
- Line everyone up in a straight row. The person on the far left must send a fruit to the person on the far right. The people in the middle will be extremely busy.
- Observation: If the people in the middle don't help, the ends can never exchange fruits. This demonstrates the critical job of a "Router."
- Challenge 2: Silent Mode
- Rule: No talking allowed! You can only use eye contact to signal your neighbor to extend their hand.
- Discovery: This simulates a real computer network. Computers don't talk; they simply follow a pre-set "Protocol" to pass data.
Teaching Observation Checklist
This chart helps you guide the child to understand the conflict between "Local Greed" and "Global Cooperation."
| Observation Point | ❌ Less Effective Response (Preaching) | ✅ More Effective Scaffolding (Inspiring Thought) |
| When the child gets their ball and refuses to pass | "Don't be so selfish. Pass it on." | "Look, your hands are full. Your neighbor wants to give you a ball you need, but they can't. If you don't pass this one out to make space, will that other ball you want ever reach you?" |
| When the game gets stuck | "You guys are playing it wrong. Start over." | "What is happening right now? Does this look like a traffic jam? Is anyone willing to be the car that 'reverses' to make space so traffic can flow again?" |
| Explaining the need for an Empty Hand | "It's just the game rule." | "This empty hand is like the 'Safety Distance' between cars on the highway. If cars are bumper-to-bumper with zero gap, can anyone change lanes?" |
💡 Suggestions for Parents
Player Count: This activity needs at least 5 participants to be fun (if you have enough people, try letting one person hold two balls to increase the feeling of congestion).
Props: If you don't have enough people, use stuffed animals to fill the spots, with parents or kids operating the dolls' "hands."
The Core Lesson: The most important thing is for the child to experience the logic: "I must give away what I have now, to eventually get what I want." This cooperative spirit is exactly why the Internet works today!
