Skip to main content
Logo image

Just Enough Algebra

Section 1.1 Variables and functions

Things change, like the price of gasoline, and just about every day it seems. What does it mean when the price of a gallon of gas drops from $3.999/gal to $3.299/gal? The symbol / is short for “per” or “for each,” so that means each gallon costs
\begin{equation*} \$3.999-\$3.299=\$0.70 = 70\text{¢} \end{equation*}
less. Does this 70¢ truly matter?
Before we answer that question, are you wondering why there’s that extra 9 at the end of the price? We might think a gallon costs $3.99 but there’s really a small 9 following it. Sometimes that 9 is raised up slightly on the gas station sign. You have to read the fine print. What it means is an extra \(\frac{9}{10}\)¢ for each gallon. So the true price of a gallon of gas would be $3.999. Gas costs a tiny bit more than you thought. Good grief.
Back to our question. Does 70¢ truly matter to us? Probably not. Can’t even buy a bag of potato chips for 70¢. But, how often do you buy just one gallon of gas? Typically you might put five, or ten, or even twenty gallons of gas into the tank. We want to understand how the price of gasoline influences what it really costs us at the pump. To do that let’s compare our costs when we buy ten gallons of gas. There’s no good reason for picking ten; it’s just a nice number to work with.
If gas costs $3.999/gal and we buy 10 gallons, it costs
\begin{equation*} 10 \text{ gallons} \ast \frac{\$3.999}{\text{gallon}} = 10 \times 3.999 = \$39.99 \end{equation*}
See how we described the computation twice? First, with units, fractions, and \(\ast\) for multiplication in what’s sometimes called “algebraic notation.” Then, with just numbers and \(\times\) for multiplication - that’s what you can type into a calculator.
If gas drops to $3.299/gal and we buy 10 gallons, it costs
\begin{equation*} 10 \text{ gallons} \ast \frac{\$3.299}{\text{gallon}} = 10 \times 3.299 = \$32.99 \end{equation*}
That’s $7 less. For $7 savings on gas you could buy that bag of potato chips, and an iced tea to go with it, and still have change. That amount matters. I mean, especially since it’s $7 savings every time you put 10 gallons in the tank.
Gas prices have been changing wildly, and along with them, the price of 10 gallons of gas. In mathematics, things that change are called variables. The two variables we’re focusing on in this story are
\begin{align*} P \amp= \text{ price of gasoline (\$/gal) }\\ C \amp= \text{ total cost (\$) } \end{align*}
Notice that we gave each variable a letter name. It is helpful to just use a single letter chosen from the word it stands for. In our example, \(P\) stands for “price” and \(C\) stands for “cost”. In this course we rarely use the letter \(X\) simply because so few words begin with \(X\text{.}\) Whenever we name a variable (\(P\)) we also describe in words what it represents (the price of gasoline), and we state what units it’s measured in ($/gal).
In talking about the relationship between these variables we might say “the total cost depends on the price of gas,” so \(C\) depends on \(P\text{.}\) That tells us that \(C\) is the dependent variable and \(P\) is the independent variable. In general, the variable we really care about is the dependent variable, in this case \(C\text{,}\) the total amount of money it costs us. The concept of dependence is so important that there’s yet another word for it. We say that \(C\) is a function of \(P\text{,}\) as in “cost is a function of price.”
Knowing which variable is independent or dependent is helpful to us. To emphasize the dependence, we often make a notation next to the variable name.
\begin{align*} P \amp= \text{ price of gasoline (\$/gal) } \sim \text{ indep}\\ C \amp= \text{ total cost (\$) } \sim \text{ dep} \end{align*}
This labeling is rarely used outside this textbook, so add it in for yourself if you need it. In some situations dependency can be viewed either way; there might not be one correct way to do it. Labeling the dependence is extra important then, so anyone reading your work knows which way you are thinking of it.
Given a choice, we usually assign dependence such that given a value of the independent variable, it is easy to calculate the corresponding value for the dependent variable. In our example it’s easy to use the price per gallon, \(P\text{,}\) to figure out the total cost, \(C\text{.}\) We can work backwards - from \(C\) to \(P\) - but it’s not as easy.
For example, suppose we buy 10 gallons of gas and it costs $28.99. We can figure out that the price per gallon must be
\begin{equation*} P=\frac{\$28.99}{10 \text{ gallons}}= 28.99 \div 10 = \$2.899 \text{/gal} \end{equation*}
Notice that we use the fraction as part of the algebraic notation, but we use \(\div\) to indicate division on the calculator. Your calculator key for division may be \(/\) instead, which we reserve as a shorthand for “per.”
From our experience we have a sense of what gas might cost. In my lifetime, I’ve seen gas prices as low as 35.9¢/gallon in the 1960s to a high of $4.099/gallon recently. This range of values sounds too specific, so it would sound better to say something general like
“Gas prices are (definitely) between $0/gal and $5/gal.”
The mathematical shorthand for this sentence is
\begin{equation*} 0 \le P \le 5 \end{equation*}
The inequality symbol \(\le\) is pronounced “less than or equal to”. Formally, the range of realistic values of the independent variable is called the domain of the function \(C\text{.}\) In this text, we rarely write the domain because it’s usually clear from the story what realistic values would be. The exercises in this section ask you to do so for practice.
Be aware that there are often many different numbers in a story. Some numbers are examples of values the variables take on, such as $3.999/gal or $39.99 in our example. Other numbers are constants; they do not change (at least not during the story). The one constant in our story is that we are always buying 10 gallons of gas. Occasionally there are other numbers in a story that turn out not to be relevant at all, so be on the lookout.
Back to our story. A report says that the average price of gasoline in Minnesota was $2.900/gal in 2010 and increased approximately 20% per year for the next several years. We would like to check what that says about the average price of gasoline in 2011 and 2012, say. (It is unlikely that the price increase continued much longer at that rate.)
To understand what that report is saying, we need to remember how percents work. Luckily, the word “percent” is very descriptive. The “cent” part means “hundred,” like 100 cents in a dollar or 100 years in a century. And, as usual, “per” means “for each.” Together, percent means “per hundred.” The number 20% means 20 for each hundred. Written as a fraction it is \(\frac{20}{100}\text{.}\) Divide to get the decimal \(20 \div 100 = 0.20.\)
\begin{equation*} \text{Think money: }20\%\text{ is like }20\text{¢ , and }0.20\text{ is like }\$0.20 \end{equation*}
Bottom line: 20%, \(\frac{20}{100}\text{,}\) and 0.20 mean exactly the same number.
\begin{equation*} 20\% = \frac{20}{100} = 20 \div 100 = 0.20 \end{equation*}
To calculate the percent of a number we multiply by the decimal version. For example,
\begin{equation*} 20\% \text{ of } \$2.900 = 0.20 \times 2.900 = \$0.58 \end{equation*}
The report says the price increased by 20% each year, so by 2011 the price had increased an average of $0.58. That 58 cents is not what gas cost in 2011. It’s how much more gas cost in 2011 compared to 2010. To see what the report projected for the 2011 cost we need to add that increase on to the original 2010 price.
\begin{equation*} \$2.900 + \$0.58= \$3.48\text{ per gallon} \end{equation*}
Sounds about right. Expensive, to be sure, but fairly accurate.
For 2012, the price increased by 20% again. That means 20% of what it was in 2011. We can’t just add $0.58 again. That was 20% of the 2010 value, and we want 20% of the 2011 value. Going to have to calculate that.
\begin{equation*} 20\% \text{ of } \$3.48 = 0.20 \times 3.48 = \$0.696 \end{equation*}
so the projected 2012 value was
\begin{equation*} \$3.48 + \$0.696= \$4.176\text{ per gallon} \end{equation*}
One last note. The number 20% in the report sounds like a rough approximation. The report probably means the increase was around 20%, maybe a little less, maybe a little more. So our answers of $3.48/gal and $4.176/gal could be a little less or a little more too. But they sound so perfectly correct. To be safe, we really ought to round off these answers, to something more general like around $3.50/gal in 2011 or approximately $4.20/gal in 2012. Using our “approximately equal to” symbol we write \(P \approx \$3.50\)/gal in 2011 and \(P \approx \$4.20\)/gal in 2012.

Do you know …

  1. The difference between a variable and a constant?
  2. The information needed to “name” a variable?
  3. Which variable is dependent and which variable is independent?
  4. What “domain” means?
  5. How to calculate percent increase?
  6. \(\star\) The symbol for “approximately equal to”?
  7. \(\star\) Why an approximate answer is often as good as we can get?
  8. \(\star\) When to round your answer up or down instead of off?
  9. \(\star\) What the term “precisely” refers to?
  10. \(\star\) How to decide how precisely to round your answer?
    \(\star\) indicates question based on Prelude: approximation
If you’re not sure, work the rest of exercises and then return to these questions. Or, ask your instructor or a classmate for help.

Exercises Exercises

Exercises 1-4 are available in a separate workbook format.

1.

A 32 pound bag of dog food costs $29.97, but an 8 pound bag costs $11.28.
(a)
Identify and name the variables, including the units.
(b)
Which variable is dependent and which is independent?
(c)
What might a 16 pound bag of dog food cost? Explain the reasoning behind your guess.

2.

Rent in the Riverside Neighborhood is expected to increase 7.2% each year. Average rent for an apartment is currently $830 per month. (Story also appears in 3.4.3)
(a)
Identify and name the variables, including the units.
(b)
Explain the dependence using a sentence of the form “ is a function of ”.
(c)
Which number is a constant in this story: the percent increase (7.2) or the apartment rent (830)?
(d)
What is a realistic domain for this function? That means, for how many years might this sort of increase in rent continue? Express your answer as an inequality.
(e)
What is the average rent expected to be in 1 year? In 2 years? In 3 years? Note that
\begin{equation*} 7.2\% = \frac{7.2}{100} = 7.2 \div 100 = 0.072\text{.} \end{equation*}
Try figuring it out.

3.

Round each number up, down, or off to the precision indicated.
For a discussion of rounding, see Prelude: approximation and rounding.
(a)
My calculations show I need a cross brace around 9.388 feet long. I want the board to be long enough, so round up to the nearest foot.
(b)
Gas mileage is usually rounded down to the nearest one decimal place. What is the gas mileage for a car measured as getting 42.812 miles per gallon? What about a car getting 23.09 miles per gallon?
(c)
The original budget estimates for the new community center gym were rounded to the nearest hundred (that means ending in 00), so we want to round our bid of $148,214.79 to the nearest hundred.
(d)
The population estimate was 4.2 million people, but revised estimates suggest 4,908,229 people. Report the revised estimate rounded appropriately.

4.

It’s about time! In each story, time is one (or both) of the variables. Identify and name the variables, including units and dependence. (Stories also appear in 1.1.5)
(a)
The Nussbaums planted a walnut tree years ago when they first bought their house. The tree was 5 feet tall then and has grown around 2 feet a year.
(Story also appears in 0.2.7 and 0.7.6)
(b)
After his first beer, Stephen’s blood alcohol content (BAC) was already 0.04, and as he continued to drink, his BAC level rose 45% per hour. (Story also appears in 2.4.9 and 3.4.1)
(c)
When McKenna drives 60 mph (miles per hour), it takes her 20 minutes on the highway to get between exits, but when traffic is bad, it can take her an hour.
(d)
The sun set at 6:00 p.m. today, and I heard on the radio that at this time of year, it sets about 2 minutes earlier each day. (Hint: measure the sunset time in minutes after 6:00 p.m.)

5.

It’s about time! For each story, try to figure out the answer to the question(s).
(Stories also appear in 1.1.4)
(a)
The Nussbaums planted a walnut tree years ago when they first bought their house. The tree was 5 feet tall then and has grown around 2 feet a year. The tree is now 40 feet tall. How long ago did the Nussbaums plant their walnut tree?
(Story also appears in 0.2.7 and 0.7.6)
(b)
After his first beer, Stephen’s blood alcohol content (BAC) was already 0.04 and as he continued to drink, his BAC level rose 45% per hour. Note that
\begin{equation*} 45\% = \frac{45}{100} = 45 \div 100 = 0.45 \end{equation*}
What was Stephen’s BAC after 1 hour? After 2 hours?
(Story also appears in 2.4.9 and 3.4.1)
(c)
When McKenna drives 60 mph (miles per hour) it takes her 20 minutes on the highway to get between exits, but when traffic is bad it can take her an hour. How slow is McKenna driving when traffic is bad? Hint: can you figure out the distance between exits?
(d)
The sun set at 6:00 p.m. today and I heard on the radio that it sets about 2 minutes earlier each day this time of year. In how many days will the sun set at 4:30 p.m.? Bonus question: in what month is the story set?

6.

The temperature was 40°F at noon yesterday downtown Minneapolis but it dropped 3°F an hour in the afternoon. (Story also appears in 1.2.7 and 4.1.8)
(a)
Which number is a constant in this story: the temperature (40) or the rate at which the temperature dropped (3)?
(b)
Name the variables, including units and dependence.
(c)
When did the temperature drop below freezing (32°F)?

7.

Mrs. Nystrom’s Social Security benefit was $746.17/month when she retired from teaching in 2009. She had taught in elementary school since I was a girl. Benefits have increased by 4% per year. (Story also appears in 0.2.5, 1.2.8, and 5.1.6)
(a)
Name the variables, including units and dependence.
(b)
What was her benefit in 2012?
(c)
When will her benefit pass $900/month? A reasonable guess is fine.

8.

Between e-mail, automatic bill pay, and online banking, it seems like I hardly ever actually mail something. But for those times, I need postage stamps. The corner store sells as many (or few) stamps as I want for 44¢ each but they charge a 75¢ convenience fee for the whole purchase. (Story also appears in 3.1.7)
(a)
Identify and name the variables, including the units.
(b)
Which variable is dependent and which is independent?
(c)
How many stamps could I buy for $10? Try to figure it out from the story.

9.

Sofía bought her car new for $22,500. Now the car is fairly old and just passed 109,000 miles. Sofía looked online and estimates the car is still worth $5,700.
(a)
Identify and name the variables, including the units.
(b)
Explain the dependence using a sentence of the form “ is a function of ”.
(c)
What is a realistic number of miles for a car to drive? Express the domain as an inequality.
(d)
Sofía wonders when the car would be practically worthless, meaning under $500. Make a reasonable guess.

10.

For each story, name the variables including units and dependence.
(a)
The closer you sit to a lamp, the brighter the light is.
(Story also appears in 2.3.6 and 3.3.7)
(b)
The thicker the piece of fish, the longer it takes to grill it.
(Story also appears in 2.3.9 and 3.5.8)
(c)
Wind turbines are used to generate electricity. The faster the wind, the more power they generate. (Story also appears in 1.3.7, 2.4.8, and 3.3.6)