S3-SA5-0012
What is a Mapping?
Grade Level:
Class 9
AI/ML, Data Science, Physics, Economics, Cryptography, Computer Science, Engineering
Definition
What is it?
A mapping is like a rule that connects each item from one group to exactly one item in another group. It shows how inputs are related to outputs in a structured way. Think of it as a clear instruction for pairing things up.
Simple Example
Quick Example
Imagine you have a list of students in your class and a list of roll numbers. A mapping would be assigning each student to their unique roll number. For example, 'Anjali' maps to 'Roll No. 1', 'Bharat' maps to 'Roll No. 2', and so on.
Worked Example
Step-by-Step
Let's say we have three types of fruits: Apple, Banana, Cherry, and we want to map them to their colors: Red, Yellow, Red.
Step 1: Identify the first group (Domain) and the second group (Codomain).
Domain = {Apple, Banana, Cherry}
Codomain = {Red, Yellow, Green} (We include Green even if not used yet)
---
Step 2: Define the mapping rule. Here, the rule is 'fruit maps to its primary color'.
---
Step 3: Apply the rule to each item in the first group.
Apple maps to Red
---
Step 4: Continue for the next item.
Banana maps to Yellow
---
Step 5: Continue for the last item.
Cherry maps to Red
---
Step 6: We have successfully mapped each fruit to its color. Notice that 'Red' is used twice, which is perfectly fine in a mapping, but each fruit only maps to one color. Green from the Codomain is not used, which is also fine.
Answer: The mapping is: (Apple -> Red), (Banana -> Yellow), (Cherry -> Red).
Why It Matters
Mappings are super important in computer science, helping computers understand how data is linked, like how your fingerprint maps to unlocking your phone. In data science, they help analyze patterns, such as mapping customer purchases to product categories. Engineers use them to design systems, like mapping button presses to actions in a machine.
Common Mistakes
MISTAKE: Mapping one item from the first group to *multiple* items in the second group (e.g., 'Cricket Bat' maps to 'Wood' and 'Leather'). | CORRECTION: In a true mapping, each item from the first group (domain) must map to *exactly one* item in the second group (codomain).
MISTAKE: Leaving some items in the first group unmapped (e.g., in a student-to-roll-number mapping, one student doesn't get a roll number). | CORRECTION: Every item in the first group (domain) must be mapped to an item in the second group.
MISTAKE: Thinking that every item in the second group (codomain) must be 'hit' by a mapping. | CORRECTION: It's okay if some items in the second group are not mapped to by any item from the first group.
Practice Questions
Try It Yourself
QUESTION: If we map 'Mobile Phone' to 'Brand', what would 'Samsung' map to? | ANSWER: 'Samsung' is a brand, not a mobile phone. So, 'Samsung' would be an item in the 'Brand' group. The mapping would be 'Mobile Phone Model' -> 'Brand', e.g., 'Galaxy S23' -> 'Samsung'.
QUESTION: You have a group of students {Priya, Rohan, Sanjana} and a group of subjects {Math, Science, English}. Create a mapping where each student is assigned their favorite subject, ensuring each student has only one favorite. | ANSWER: Priya -> Math, Rohan -> Science, Sanjana -> Math (or any other valid single assignment for each student).
QUESTION: Consider a mapping where 'City' maps to 'State in India'. If your domain is {Mumbai, Bengaluru, Kolkata} and your codomain is {Maharashtra, Karnataka, West Bengal, Tamil Nadu}. Show the mapping. Is it possible for one city to map to two states? | ANSWER: Mumbai -> Maharashtra, Bengaluru -> Karnataka, Kolkata -> West Bengal. No, it is not possible for one city to map to two states because each item in the domain must map to exactly one item in the codomain.
MCQ
Quick Quiz
Which of the following best describes a mapping?
Connecting items from two groups randomly.
A rule that links each item from one group to exactly one item in another group.
A list of items without any connections.
A way to compare two items to see if they are the same.
The Correct Answer Is:
B
Option B correctly defines a mapping as a rule that ensures each element in the first set is associated with exactly one element in the second set. The other options describe random connections, unconnected lists, or comparisons, which are not mappings.
Real World Connection
In the Real World
When you use a QR code scanner on your phone, there's a mapping at play. The image of the QR code maps to a specific website link or payment address. Similarly, in UPI payments, your unique UPI ID maps to your bank account, making transactions super easy and secure.
Key Vocabulary
Key Terms
DOMAIN: The first set or group of items from which the mapping starts.| CODEDOMAIN: The second set or group of items to which the mapping goes.| RULE: The specific instruction or logic that defines how items are connected.| INPUT: An item from the domain that is being mapped.| OUTPUT: The item in the codomain that an input maps to.
What's Next
What to Learn Next
Now that you understand mappings, you're ready to explore 'Functions'. Functions are a special type of mapping with even stricter rules, which are fundamental to algebra and calculus. Keep up the great work!


