top of page
Inaugurated by IN-SPACe
ISRO Registered Space Tutor

S8-SA2-0017

What is an Algorithm?

Grade Level:

Class 7

AI/ML, Data Science, Research, Journalism, Law, any domain requiring critical thinking

Definition
What is it?

An algorithm is simply a set of step-by-step instructions or rules that tell you how to solve a problem or complete a task. Think of it as a recipe for solving a problem, guaranteeing you get the right result if you follow all steps correctly.

Simple Example
Quick Example

Imagine you want to make a cup of chai. The steps you follow – boiling water, adding tea leaves, sugar, milk, and then straining – form an algorithm for making chai. If you follow these steps, you will get chai.

Worked Example
Step-by-Step

Let's find the total cost of buying 3 packets of biscuits and 2 bottles of juice from a shop.---Step 1: Find the price of one packet of biscuits. Let's say it's ₹10.---Step 2: Calculate the total cost of biscuits: 3 packets * ₹10/packet = ₹30.---Step 3: Find the price of one bottle of juice. Let's say it's ₹25.---Step 4: Calculate the total cost of juice: 2 bottles * ₹25/bottle = ₹50.---Step 5: Add the total cost of biscuits and juice: ₹30 + ₹50 = ₹80.---Answer: The total cost is ₹80.

Why It Matters

Algorithms are everywhere, from how your phone sorts photos to how search engines find information. Understanding them helps you think logically and solve problems in any field, whether you want to work in AI, create apps, or even analyze cricket statistics.

Common Mistakes

MISTAKE: Thinking an algorithm is only for computers. | CORRECTION: An algorithm is a general problem-solving method; computers just follow them very quickly and accurately. Humans use algorithms all the time too!

MISTAKE: Missing or skipping steps in an algorithm. | CORRECTION: Every step in an algorithm is important. Skipping a step can lead to a wrong answer or an incomplete task, just like missing an ingredient in a recipe.

MISTAKE: Not understanding the order of steps matters. | CORRECTION: The sequence of steps in an algorithm is crucial. Doing steps in the wrong order can change the outcome completely (e.g., adding milk before tea leaves in chai).

Practice Questions
Try It Yourself

QUESTION: Write down the steps to pack your school bag for tomorrow. | ANSWER: 1. Check tomorrow's timetable. 2. Collect all required books and notebooks. 3. Collect pencil box, water bottle, tiffin. 4. Arrange items neatly in the bag. 5. Zip up the bag.

QUESTION: A delivery rider has to visit 3 houses: House A (5km away), House B (3km from A), House C (2km from B). What is the shortest total distance if they start from their office and must visit all houses? (Assume a straight line path from office to A, then A to B, then B to C). | ANSWER: Office to A (5km) + A to B (3km) + B to C (2km) = 10km. The shortest total distance is 10km.

QUESTION: You have ₹100. You want to buy samosas (₹15 each) and jalebis (₹10 per 100g). You need at least 2 samosas and 200g jalebis. Write an algorithm to find how many of each you can buy without exceeding ₹100, and how much money is left. | ANSWER: 1. Calculate cost of 2 samosas: 2 * ₹15 = ₹30. 2. Calculate cost of 200g jalebis: 2 * ₹10 = ₹20. 3. Total spent so far: ₹30 + ₹20 = ₹50. 4. Money remaining: ₹100 - ₹50 = ₹50. 5. Now, use remaining ₹50 to buy more. Can buy 3 more samosas (3 * ₹15 = ₹45). 6. Total samosas: 2 + 3 = 5. Total jalebis: 200g. Total cost: ₹50 + ₹45 = ₹95. Money left: ₹100 - ₹95 = ₹5. (Other combinations are possible, but this is one valid algorithm).

MCQ
Quick Quiz

Which of the following best describes an algorithm?

A random guess to solve a problem

A set of clear, step-by-step instructions to achieve a goal

A single, complex mathematical formula

A quick shortcut that might not always work

The Correct Answer Is:

B

Option B is correct because an algorithm is defined by its clear, sequential steps that guarantee a solution. Options A and D are incorrect because algorithms are not random or unreliable. Option C is too narrow; an algorithm can be more than just a formula.

Real World Connection
In the Real World

When you use a navigation app like Google Maps or Ola/Uber, it uses complex algorithms to find the best route from your current location to your destination, considering traffic, distance, and time. Even UPI payments follow a precise algorithm to ensure your money reaches the correct person securely.

Key Vocabulary
Key Terms

INSTRUCTION: A single action or command to be performed. | SEQUENCE: The order in which steps are followed. | PROBLEM-SOLVING: The process of finding solutions to difficulties. | LOGIC: Reasoning conducted or assessed according to strict principles of validity. | TASK: A piece of work to be done or undertaken.

What's Next
What to Learn Next

Now that you understand what an algorithm is, you can explore 'Flowcharts' next. Flowcharts are visual ways to represent algorithms, making it even easier to understand and design step-by-step solutions for various problems. Keep practicing!

bottom of page