An algorithm is a clear, step-by-step set of instructions for solving a problem.
It tells a computer:
-
What to do
-
In what order
-
Under what conditions
Without algorithms, computers cannot function.
🔹 SIMPLE REAL-LIFE EXAMPLES
Example 1: Cooking Posho
Imagine explaining how to cook posho.
Bad instructions:
“Cook posho.”
Good algorithm:
-
Boil 2 cups of water.
-
Slowly add 1 cup maize flour while stirring.
-
Continue stirring for 5 minutes.
-
Reduce heat.
-
Cover and cook for 10 minutes.
That is an algorithm.
Example 2: Using Mobile Money
Algorithm for sending money:
-
Dial *165#
-
Select “Send Money”
-
Enter phone number
-
Enter amount
-
Enter PIN
-
Confirm
Every step must be exact.
🔹 WHY ALGORITHMS MATTER IN CODING
Computers do NOT think like humans.
They do NOT guess.
They follow instructions exactly.
If you forget a step, the computer fails.
If you are unclear, the computer behaves incorrectly.
In app development:
Algorithms control:
-
Login systems
-
Score calculations
-
Data sorting
-
AI predictions
-
Decision making
🔹 WHAT HAPPENS WITHOUT CLEAR ALGORITHMS?
Imagine building a school attendance app.
If you write:
“When student presses button, mark present.”
But you do not define:
-
Which student?
-
Which date?
-
What if pressed twice?
The app will behave incorrectly.
That is why algorithms must be:
✔ Clear
✔ Ordered
✔ Precise
✔ Complete
🔹 ALGORITHMS IN AI
AI systems also follow algorithms.
For example:
Crop Disease Detection App:
Algorithm might be:
-
Capture image.
-
Preprocess image.
-
Compare image to trained model.
-
Predict disease type.
-
Display treatment advice.
Even AI runs on algorithms.
🔹 ACTIVITY 1: HUMAN ROBOT GAME (Classroom Activity)
One student becomes a “robot.”
The robot can only do exactly what is said.
Task: Arrange chairs in a row.
Students must give step-by-step instructions.
If they say:
“Move chair.”
Robot asks:
“How far?”
“Which direction?”
“Which chair?”
Lesson:
Be specific.
🔹 ACTIVITY 2: DRAWING ALGORITHM
Students give instructions to draw:
A simple house.
Instructions must include:
-
Draw square
-
Draw triangle roof
-
Add door
-
Add windows
Swap instructions with another team.
If drawing is wrong → Algorithm was unclear.
🔹 ACTIVITY 3: WRITE AN APP ALGORITHM
Scenario:
You are building a simple quiz app.
Write the algorithm for:
When user answers a question.
Example:
-
Display question.
-
Wait for user selection.
-
If answer is correct → Add 1 to score.
-
If incorrect → Show correct answer.
-
Move to next question.
🔹 REFLECTION QUESTIONS
-
Did you realize how detailed instructions must be?
-
Where were your instructions unclear?
-
How does this relate to coding?
-
How will this help your app development?
🔹 KEY TERMS
Algorithm – Step-by-step instructions
Condition – A decision (if/else)
Sequence – Order of steps
Logic – The reasoning behind steps
🔹 ADVANCED EXTENSION (For Strong Teams)
Introduce Flowcharts.
Example:
Start → Input → Decision → Output → End
Teach students:
-
Sequence
-
Selection (If/Else)
-
Iteration (Loop)
These are core programming structures.
🔹 WHY THIS LESSON IS IMPORTANT
Before students start coding:
They must understand:
Apps are not magic.
They are structured logic.
Algorithms are the foundation of:
-
Coding
-
Artificial Intelligence
-
Robotics
-
Software Engineering
🔹 STRATEGIC NOTE
This lesson is optional but highly recommended because:
It prepares students for:
-
Debugging
-
Writing better logic
-
Using AI effectively
-
Participating competitively at NCC level
