2.1 Introduction to functions
Functions as equations
A variable represents a value that can change or “vary”, hence the name “variable”. Sometimes one variable’s value is related to another variable’s value. Ex: If Jan saves $1000 per month, what is the total savings y after x months? A person can create an equation to describe how a value for x converts to a value for y.
2.1.1: An equation can relate any value of one variable (x) to a value of another variable (y).Start2x speed
Jan saves $1000 per month.
Total dollars saved (y) for number of months (x)?
y = 1000x
Total savings for 5 months?
y = 1000 × 5
“Plug in” 5 for x
y = 5000
Total savings for 20 months?
y = 1000 × 20
y = 20000
Plug in 20 for x
y = 1000x keyboard_arrow_downCaptionsFeedback?
Mathematically, a relation of each value of one variable (x) to a value of another variable (y) is called a function. One says that “y is a function of x”, meaning y’s value is based on, or comes from, x’s value.
2.1.2: Relating one variable’s values to another.
Jan saves $1000 per month, so total savings y can be written as y = 1000x, where x is the number of months. How much will Jan have saved after 5 months?
Jan saves $1000 per month, so total savings y can be written as y = 1000x, where x is the number of months. How much will Jan have saved after 30 months?
Lee puts $20,000 into a savings account that earns 5% interest each year. A simple equation for calculating the total savings y after x years is: y = 20000 + (20000 × 0.05)x. What is the total savings after 10 years?
A catering company charges a $500 setup plus $10 per person, so total cost y can be written as y = 500 + 10x, where x is the number of people. What is the cost for 100 people, and for 200 people?
Pat is a salesperson. Pat earns a base monthly salary of $4000, plus 10% of sales. Pat’s total monthly earnings y can be written as y = 4000 + 0.10x, where x is the dollar amount of Pat’s sales. How much will Pat earn if sales are $5000, $6000, or $7000?$4500, $4600, $4700$5000, $6000, $7000
Val wishes to provide free haircuts at an event for homeless people. Setting up and taking down the haircut booth takes 30 min combined. Each haircut takes 10 min. What is the total time y to cut x people’s hair?y = 30xy = 30 + 10x
Lee burns 1.5 calories per minute at rest, and 4 calories per min when walking. A day has 24 × 60 =1440 minutes. What is Lee’s total calories burned if Lee walks x min per day and is at rest for the other minutes of the day? y = 1.5 × 1440 + 4xy = 1.5 × (1440 – x) + 4x
Functions as tables and graphs
Beyond an equation, a relationship of a variable x to a variable y (a function) can be described with a table or as a graph as well. A table is a partly-visual representation of a function, with a column for each variable, and a row for each value of x and the corresponding y value. A graph is a mostly-visual representation of a function, with x values displayed horizontally, and corresponding y values displayed vertically.
2.1.3: Relating one variable to another via an equation, table, or graph.Start2x speed
Jan saves $1000 per month.
Total dollars saved (y) for x months?
y = 1000x
y (dollars saved)
y axis keyboard_arrow_downCaptionsFeedback?
Drawing a point on a graph is called plotting the point. Good practice is to label both x (horizontal) and y (vertical) axes with units.
2.1.4: Relating one variable’s values to another.
Looking at the table above, how much had Jan saved after 3 months?$3000$4000
Looking at the graph above, how much had Jan saved after 4 months?$3000$4000
How many points were plotted on the graph above?14Feedback?
Example: Water bill
(True story) One thing Frank did after moving into a home was disable the automated outdoor irrigation. He replaced the water-hungry plants and lawn (his kids were grown so a lawn wasn’t needed) with rocks and low-water plants.
Frank’s water company provides graphs showing the bi-monthly water bill as a function of the month. Below are two graphs on the same axes, a graph for 2011 (previous owner), and a graph for 2018 (Frank). The company labeled each point with the dollar cost for water usage. The lines connecting the points have no meaning other than to help a viewer follow each graph’s points.
Note that the 2018 costs are 2x to 3x lower. Ex: For Feb (February), the 2011 cost was $44, while the 2018 cost was only $19. The main difference? That outdoor watering. Irrigating can use a lot of water (at least in a warm-weather low-rain state like California). 2011 total usage cost was 44 + 47 + 45 + 46 + 49 + 23 = 254 dollars, vs. 2018 being 19 + 13 + 18 + 19 + 16 + 11 = 96 dollars, a difference of $158 per year.
Figure 2.1.1: Graphs for water usage costs with lawn/plant irrigation (2011) and without (2018).
2.1.5: Water usage graphs.
Consider the example above.
How much was the water bill in October of 2011?$49$16
How much was the water bill in October of 2018?$49$16
What good practice do the graphs fail to follow?Providing units for the x axisProviding units for the y axisFeedback?
2.1.1: Intro to functions.
What are the values for y when x is 2, 4, and 6?
y = 20x + 6
Need help with your math or Computer Science task! Let us help
Reach out anytime