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

S0-SA3-0757

What is Sad (Logic Primitive)?

Grade Level:

Pre-School – Class 2

All domains without exception

Definition
What is it?

SAD stands for 'Sum of Absolute Differences'. It's a way to measure how different two sets of numbers are. We find the absolute difference between corresponding numbers in each set and then add all these differences together.

Simple Example
Quick Example

Imagine you have two friends, Rahul and Priya, who bought different vegetables from the market. Rahul bought 2 kg potatoes and 3 kg onions. Priya bought 3 kg potatoes and 2 kg onions. To find the SAD in their purchases, we compare potato quantities (3-2 = 1 kg) and onion quantities (3-2 = 1 kg), then add these differences (1+1 = 2 kg).

Worked Example
Step-by-Step

Let's find the SAD between two lists of marks a student scored in 3 subjects in two different tests.

List 1 (Test 1 Marks): [70, 85, 60]
List 2 (Test 2 Marks): [75, 80, 65]

---Step 1: Find the absolute difference for the first subject (Maths).
Absolute difference = |Test 2 Math Mark - Test 1 Math Mark| = |75 - 70| = |5| = 5

---Step 2: Find the absolute difference for the second subject (Science).
Absolute difference = |Test 2 Science Mark - Test 1 Science Mark| = |80 - 85| = |-5| = 5

---Step 3: Find the absolute difference for the third subject (English).
Absolute difference = |Test 2 English Mark - Test 1 English Mark| = |65 - 60| = |5| = 5

---Step 4: Sum all the absolute differences.
SAD = 5 (from Math) + 5 (from Science) + 5 (from English) = 15

---Answer: The Sum of Absolute Differences (SAD) between the two test scores is 15.

Why It Matters

SAD helps us compare things accurately and find out how much they vary. This is super useful in fields like computer vision for comparing images, in finance for comparing stock prices over time, and even in sports analytics for comparing player performance. It's a basic building block for many advanced algorithms.

Common Mistakes

MISTAKE: Not taking the absolute value, leading to negative differences that cancel out. For example, (70-75) + (85-80) = -5 + 5 = 0. | CORRECTION: Always take the absolute value of each difference using the '| |' symbol, which means making any negative number positive.

MISTAKE: Comparing numbers that don't correspond to each other (e.g., comparing the first number of one list with the second number of another list). | CORRECTION: Ensure you compare the first item with the first, the second with the second, and so on. The order matters!

MISTAKE: Forgetting to sum all the individual absolute differences at the end. | CORRECTION: After calculating each absolute difference, remember that the final step is to add all these positive differences together to get the total SAD.

Practice Questions
Try It Yourself

QUESTION: Find the SAD between the prices of mobile data packs for two companies:
Company A: [199 rupees, 299 rupees, 399 rupees]
Company B: [205 rupees, 290 rupees, 400 rupees]
| ANSWER: 6 + 9 + 1 = 16 rupees

QUESTION: Two cricket teams scored runs in 4 overs:
Team 1: [10, 15, 8, 12]
Team 2: [12, 13, 10, 10]
Calculate the SAD in their run scores over these overs.
| ANSWER: |12-10| + |13-15| + |10-8| + |10-12| = 2 + 2 + 2 + 2 = 8 runs

QUESTION: A grocery store wants to compare its actual sales (in thousands of rupees) with target sales for 3 months.
Actual Sales: [50, 65, 72]
Target Sales: [55, 60, 70]
Calculate the SAD to understand the total difference from target. If the SAD is more than 10, the manager gets a bonus. Does the manager get a bonus?
| ANSWER: |55-50| + |60-65| + |70-72| = 5 + 5 + 2 = 12. Yes, the manager gets a bonus because 12 is more than 10.

MCQ
Quick Quiz

What does 'Absolute Difference' mean in SAD?

The difference between two numbers, always positive or zero.

The difference between two numbers, which can be positive or negative.

The sum of two numbers.

The product of two numbers.

The Correct Answer Is:

A

Absolute difference means we ignore the sign and only care about the magnitude of the difference, making it always positive or zero. Options B, C, and D describe other mathematical operations or do not correctly define 'absolute'.

Real World Connection
In the Real World

SAD is used in many computer applications. For instance, when you use facial recognition on your phone, algorithms might use SAD to compare parts of your face with stored images. In video compression, SAD helps identify how much a part of a video frame has changed from the previous one, making the video files smaller. ISRO scientists might use similar concepts to compare satellite images for changes over time.

Key Vocabulary
Key Terms

ABSOLUTE VALUE: The distance of a number from zero, always positive or zero (e.g., |-5| = 5) | DIFFERENCE: The result of subtracting one number from another | SUM: The result of adding numbers together | CORRESPONDING: Matching items in the same position in different sets or lists

What's Next
What to Learn Next

Now that you understand SAD, you can explore other ways to compare data, like 'Sum of Squared Differences (SSD)' or 'Mean Absolute Error (MAE)'. These build on the idea of measuring differences and are used in more complex data analysis and machine learning.

bottom of page