Free preview
83 lessons
Mathematical Foundations for ML
Free preview
Mathematical Foundations for ML · 83 lessons
No surprise gaps
Actually remember it
Skip what you know
One subscription. All learning paths included.
Our content is best on a larger screen
Input-output relationship
A function from a set to a set is a rule that assigns to each element of exactly one element of . We write and call the domain and the codomain.
Definition
A function assigns to each element of exactly one element of . If , we write for the element of assigned to .
The word "rule" here is deliberately broad - a function does not have to be defined by an equation. A table, a graph, or a verbal description can all define functions, as long as each input is assigned exactly one output. Any such rule is called a mapping, and the terms "function" and "mapping" are used interchangeably.
This is the only requirement. In particular:
Does the rule for define a function?
For any , squaring gives exactly one real number. Each input is assigned a single output, so is a function.
Different inputs can share the same output: . This is allowed - the definition requires each input to have one output, not that each output comes from one input.
Practice questions
4 questions
Let and . A rule assigns:
Does this rule define a function ?
Select the correct answer:
+ 3 more questions
Functions from graphs
When a function is defined by a formula, its graph is the set of all input-output pairs plotted as points in the plane. We can use this to determine whether a graph represents a function without knowing the formula - by checking whether each -value corresponds to at most one -value.
Definition
A graph represents a function if and only if every vertical line crosses the graph at most once. If any vertical line crosses the graph at two or more points, the same input produces different outputs, and the graph does not represent a function.
Use the visualisation below to see this in action. Drag the red diamond on the -axis across the plane and use the buttons to cycle through different curves.
Straight line:
Every vertical line crosses a non-vertical straight line exactly once. This graph represents a function.
The following points are plotted on a coordinate plane. Determine whether each set represents a function.
Set A:
Set B:
Set A
We apply the vertical line test by checking whether any -coordinate appears more than once.
The -coordinates are , , , - all distinct. A vertical line at each of these values crosses exactly one point.
Every vertical line passes through at most one point. Set A is a function.
Set B
The -coordinates are , , , . The value appears twice, with different -values: and .
The vertical line at crosses two points. The input has two different outputs ( and ), so the vertical line test fails.
Set B is not a function.
Practice questions
4 questions
A circle is drawn on the coordinate plane, centred at the origin. Does this graph represent a function?
Select the correct answer:
+ 3 more questions