Functions
Think of a function as a machine that takes something in, does some work on it, and then gives something out.
🚗 Everyday Analogy: The Function Machine
Imagine a machine where:
- You input a number (like putting an ingredient into a blender).
- The machine processes it in a specific way (e.g., doubles it, adds 5, squares it).
- It outputs a new number (like getting a smoothie after blending).
For example, if the function is “double the input”, it works like this:
- Input: 3 → Output: 6
- Input: 5 → Output: 10
This can be written as: f(x)=2xf(x) = 2x
where f(x) means “the function of x.”
🎯 Key Points About Functions
✅ Each input has exactly one output → No confusion, one input gives only one result.
✅ The rule stays the same → If the function is “add 5,” then every input follows that rule.
✅ Functions can be anything → Doubling, squaring, adding, subtracting, even something like “if x is a cat, return ‘meow’!”
📊 Real-Life Examples of Functions
1️⃣ Temperature Conversion
- Celsius to Fahrenheit: F(x)=(9/5)x+32F(x) = (9/5)x + 32
- If you input 0°C, the output is 32°F.
- If you input 100°C, the output is 212°F.
2️⃣ Monthly Salary Calculation
- Suppose your hourly pay is $10, and hours worked is h: Salary(h)=10hSalary(h) = 10h
- If you work 40 hours, you earn $400.
3️⃣ Speed Calculation
- If speed is distance ÷ time, then: Speed(t)=100tSpeed(t) = \frac{100}{t}
- If you take 2 hours to travel 100 km, your speed is 50 km/h.
🔢 Fun Challenge
If a function is f(x) = x² + 3, what happens when you input:
- 2?
- 5?
- -1?
Hope you will have got the answers.