Linear Functions
Key Ideas:
- Define linear functions
- Establish graphical properties of linear functions
Linear functions are used in several areas of knowledge, such as mathematics engineering and even the social sciences. Some concrete applications in computer science involve optimization, image processing, graph algorithms, quantum computing, cryptography, and machine learning just to name a few.
A simple example
You can easily calculate the expected pay of an hourly job as a function of the hours that were worked using a linear function. For example if you are paid $ $35 $ then your expected pay function would be
$EP(h) = 35 \cdot h$ where $h$ is the number of hours worked.
Linearity
A function $f$ is said to be linear if it satisfies the following two conditions
- $f(x + y) = f(x) + f(y)$ for all inputs $x, y$
- $f(a x) = a f(x)$ for all real numbers $a$
In the real numbers, linear functions on one variable are always going to have the form
- $f(x) = k x$ for some real number $k$.
In particular the function only depends on the value of $f(1)$. As indeed, if $x$ is a real number then $f(x)= x f(1)$.
Graphs of linear functions
The graph of every linear functions in one variable look like a line that goes through the origin. It is easy to graph this functions as you only need one value that is non-zero, and then just join the origin to the point corresponding to the (input,output) that you obtained.
When dealing with linear functions of two variables, their graphical representation will correspond to that of planes in the three dimensional space that cut through the origin.