2.2.1Functions

Concept of a function — input, output, mapping

2,071 words9 min readdifficulty · medium

Why functions matter: They're the language of relationships in mathematics. Temperature depends on time, distance depends on speed, profit depends on sales — all functions. Without this concept, we can't model the universe.

What IS a Function? (Precise Definition)

We write: f:ABf: A \to B or y=f(x)y = f(x)

  • Domain (AA): The set of all possible inputs (what you're allowed to put in)
  • Codomain (BB): The set where outputs live (the "target" set)
  • Range: The set of actual outputs produced (subset of codomain)
  • Image of xx: The output f(x)f(x) when we input xx

WHY "exactly one"? If f(2)f(2) could be both 5 and 7, we couldn't predict anything. Mathematics needs determinism. This rule makes functions well-defined.

Figure — Concept of a function — input, output, mapping

How Does Mapping Work? The Rule

A function is fundamentally a mapping or correspondence.

The Three Parts:

  1. Input set (Domain): Where we choose xx from
  2. Rule: The operation ff that transforms xx
  3. Output set (Codomain/Range): Where f(x)f(x) lands

Read as: "f is a function from the real numbers to the real numbers, defined by the rule f(x)=x2f(x) = x^2"

  • ff is the name of the function
  • RR\mathbb{R} \to \mathbb{R} specifies domain and codomain
  • xx is the independent variable (input)
  • f(x)f(x) is the dependent variable (output)
  • x2x^2 is the rule or formula

WHY this notation? It separates the function (the machine) from its inputs. ff and f(x)f(x) are different: ff is the whole process, f(x)f(x) is the result of applying it to xx.

Derivation: Why "Exactly One Output"?

Let's build this from scratch. Suppose we have two sets A={1,2,3}A = \{1, 2, 3\} and B={4,5,6,7}B = \{4, 5, 6, 7\}.

Attempt 1 — Is this a function?

  • 141 \to 4
  • 252 \to 5
  • 363 \to 6

Check: Each input (1, 2, 3) has exactly one output. ✓ This IS a function.

Attempt 2 — Is this a function?

  • 141 \to 4
  • 252 \to 5
  • 272 \to 7
  • 363 \to 6

Check: Input 2 maps to both 5 AND 7. ✗ This is NOT a function (it's a relation, but not a function).

WHY does this matter? If we write f(2)=?f(2) = ?, we need a single answer. Ambiguity breaks computation.

Attempt 3 — Is this a function?

  • 141 \to 4
  • 363 \to 6

Check: Input 2 has no output. ✗ NOT a function — domain must be fully covered.

Derivation: A vertical line x=cx = c represents all points (c,y)(c, y) for different yy values. If it crosses twice, say at (c,y1)(c, y_1) and (c,y2)(c, y_2), then input cc produces two outputs — violating the definition.

Worked Examples — Building Intuition

Compute specific values:

  • f(3)=32=9f(3) = 3^2 = 9 — Input 3, output 9
  • f(2)=(2)2=4f(-2) = (-2)^2 = 4 — Input -2, output 4
  • f(0)=02=0f(0) = 0^2 = 0 — Input 0, output 0

Key observations:

  • Domain: All real numbers (any xx works)
  • Codomain: All real numbers (stated in definition)
  • Range: [0,)[0, \infty) — outputs are never negative (WHY? A square is always ≥0)

Why this step? We squared because that's the rule. Notice f(3)f(3)f(3) \neq f(-3) in value, but f(3)=f(3)=9f(3) = f(-3) = 9different inputs can give the same output. That's allowed! What's forbidden is one input giving multiple outputs.

The rule: g(x)={xif x0xif x<0g(x) = \begin{cases} x & \text{if } x \geq 0 \\ -x & \text{if } x < 0 \end{cases}

Compute:

  • g(5)=5g(5) = 5 (since 505 \geq 0, use top branch)
  • g(5)=(5)=5g(-5) = -(-5) = 5 (since 5<0-5 < 0, use bottom branch)

WHY piecewise? Some functions need different rules for different inputs. Still one output per input! For x=5x = -5, we use the second rule (not both), getting exactly 5.

Test: At x=0x = 0, solve 0+y2=1y=±10+ y^2 = 1 \Rightarrow y = \pm 1.

Input x=0x = 0 produces two outputs: y=1y = 1 and y=1y = -1. ✗ Not a function.

How to fix? Restrict to top half: y=1x2y = \sqrt{1 - x^2} (single-valued). Now it's a function.

Common Mistakes — Steel-Manning Wrong Ideas

Why it feels right: The ±\pm symbol appears in algebra (quadratic formula), so it seems natural.

The fix: Functions require determinism. If you want both roots, define two functions: f(x)=+xf(x) = +\sqrt{x} and g(x)=xg(x) = -\sqrt{x}, or return a set (but that's a different type of object, not a standard real function).

Why it feels right: Most early examples are formulas.

The fix: Functions can be defined by:

  • Formulas: f(x)=x3f(x) = x^3
  • Tables: f={(1,2),(2,4),(3,6)}f = \{(1,2), (2,4), (3,6)\}
  • Graphs: A ploted curve
  • Words: "Round to nearest integer"
  • Algorithms: Computer code

The essence is the input-output pairing, not the representation.

Why it feels right: We see outputs are 0\geq 0 and mix it up.

The fix:

  • Domain = inputs you put in
  • Range = outputs you get out

For f(x)=x2f(x) = x^2: Domain =R= \mathbb{R} (you can square any real), Range =[0,)= [0, \infty) (squares are non-negative).

Active Recall Practice

Recall Feynman Explanation (Explain to a 12-Year-Old)

Imagine you have a magic box. You drop a number in the top, and a number pops out the bottom. The rule is: the same number in always gives the same number out. If you drop in 3today, you get 9. If you drop in 3 tomorrow, you still get 9 — the box never changes its mind.

That's a function! The numbers you can drop in are the "domain" (like, you can't drop in a basketball, only numbers the box accepts). The numbers that can pop out are in the "codomain." The actual numbers that DO pop out are the "range."

Why do we care? Because everything in the world works like this: time goes in, temperature comes out. Money goes in, stuff comes out. Functions let us predict and understand patterns.

Or: "Function = Faithful Delivery" — mail service analogy. Address (input) → Package (output). One address can't receive two different packages labeled the same way.

Connections to Other Concepts

  • Domain and Range: Natural next step — how to find them
  • Types of Functions: One-one, onto, bijective classifications
  • Inverse Functions: When can we reverse a function?
  • Composition of Functions: Chaining functions together
  • Relations: Functions are special relations (single-valued)
  • Graphs of Functions: Visual representation of mappings
  • Real-world Applications: Physics laws, economics, computer science

#flashcards/maths

What is a function? :: A rule that assigns to each input exactly one output. Written f:ABf: A \to B where AA is domain, BB is codomain.

What does "exactly one output" mean?
For every input xx in the domain, there is one and only one value f(x)f(x). No input can produce multiple outputs.
Distinguish: Domain vs Codomain vs Range
Domain = all possible inputs. Codomain = set where outputs live (target set). Range = actual outputs produced (subset of codomain).
Vertical Line Test
A graph represents a function iff every vertical line intersects it at most once. If twice, one input has two outputs → not a function.
Why can different inputs give the same output?
The rule only forbids one input giving multiple outputs. Many-to-one is allowed (e.g., f(2)=f(2)=4f(2) = f(-2) = 4 for f(x)=x2f(x)=x^2).

Give a relation that is NOT a function :: The circle x2+y2=1x^2 + y^2 = 1. At x=0x=0, y=±1y = \pm 1 (two outputs). Any relation where xx maps to multiple yy values.

Can a function be defined without a formula?
Yes. Functions can be tables, graphs, verbal rules, or algorithms. A formula is just one representation.
What is f(x)f(x)?
The output (or image) when input xx is processed by function ff. It's the dependent variable.
Why is the notation f:ABf: A \to B important?
It separates the function (the machine ff) from its action (f(x)f(x)). Specifies domain AA and codomain BB upfront.

Concept Map

assigns each x

ensures

takes inputs from

outputs live in

subset of

transforms x into fx

feeds into

describes

written as

graphical check for

Function f

Domain A - inputs

Codomain B - target

Range - actual outputs

Rule fx

Exactly one output

Well-defined

Mapping / correspondence

Vertical Line Test

Notation f:A to B

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Function kya hai? Socho ek machine hai — jaise ek formula calculator. Tum usme ek number dalo (input), aur woh tumhe ek specific number wapas dega (output). Par rule ye hai ki same input ka hamesha same output hona chahiye. Agar tum 5 dalo, aur kabhi 25 mile, kabhi 30 mile — toh woh function nahi hai, confusion hai!

Mapping ka matlab? Har input kiek "posting" hoti hai exactly ek output pe. Jaise ek school mein har student kaek roll number hota hai — tum ek student ko do roll numbers nahi de sakte. Isliye kehte hain: "One input, one output" — ye function ki jaan hai. Domain matlab sab valid inputs (jaise 1, 2, 3..), codomain matlab output ka pool, aur range matlab actual outputs jo mil rahe hain.

Vertical line test — agar graph par koi bhi straight vertical line (upar-niche) ek se zyada points pe cut kare, matlab ek x pe do y values hain, toh woh function nahi hai. Example: circle ka equation x2+y2=1x^2 + y^2 = 1 — isme x=0x = 0 pe y=+1y = +1 aur y=1y = -1 dono possible hain. Isliye circle ek function nahi, bas ek relation hai.

Kyun zaroori hai? Physics, engineering, economics — sab jagah relationships functions ke through express hote hain. Agar clear mapping na ho, prediction impossible ho jata hai. Isliye function concept mathematics ki nenv hai!

Go deeper — visual, from zero

Test yourself — Functions

Connections