1.1: Constants, Variables, and Expressions
Constants and variables, at least one of these objects appear in every mathematical expression one can imagine. Let’s get a sense of just what they are.
A VARIABLE is a quantity that has a capacity for change in a particular context.
A CONSTANT is a quantity that has no capacity for change in a particular context.
Let’s put both in the context of hiring a programmer to write a program that performs some particular task. Suppose there are three programmers, A , B , and C , we are considering.
Programmer A charges a flat fee of $25,000 for writing the program.
Programmer A’s fee is constant.
In this context, the fee has no capacity for change. The fee is $25,000, no more, no less. Outside this context, maybe writing a less complicated
Programmer B charges $100 hour for writing the program.
Programmer B's fee is variable.
In this context, the fee has the capacity for change. The total fee varies with the amount of time taken to write the program.
Programmer C charges a flat fee of $15,000 and $100/whole hour (1, 2, 3, …, 50) for writing the program.
Programmer C’s fee is variable since the total fee varies since it has the capacity for change. The fee varies with the amount of time taken to write the program. Programmer C's fee structure comprises both a constant, the flat fee of $15,000, and a variable, the $100/ whole hour. But because it contains a variable, the entire quantity is variable.
A bit more detail
It is convenient to think of a variable as a container that can hold different objects at different times. In the programmer example, we might let the letter \(x\) represent the number of hours Programmer C takes to write the program. The number of hours can vary from, say, 1 to 50. Think of \(x\) as a container into which could be placed the numbers 1, 2, 3, and so on up to and including 50.
- If C takes only 1 hour to write the program, think of the number 1 being placed into the container named letter \(x\) . Then C ’s total fee would be \(\$ 15,000+1 \times \$ 100=\$ 15,100\)
- If C takes 2 hours to write the program, think of the number 2 being placed into the container named letter \(x\) . Then C ’s total fee would be \(\$ 15,000+2 \times \$ 100=\$ 15,200\)
- If C takes 50 hours to write the program, think of the number 50 being placed into the container named letter \(x\) . Then C ’s total fee would be \(\$ 15,000+50 \times \$ 100=\$ 20,000\)
Mathematical Expressions
For example, using the letter \(x\) to represent the number of hours C takes to write the program, we could express Programmer C ’s total fee with the expression
\(15,000+100 x\)
The variable \(x\) (the container named \(x\) ) can hold, one at a time, any of the fifty numbers 1, 2, 3, … 50. See this expression as a set of computing instructions that take an input value, one of the numbers 1, 2, 3, … 50, and converts it to a single output value.
Using Teechnology
We can use technology to evaluate expressions.
Go to www.wolframalpha.com
To evaluate \(15,000+100 x\) at \(x = 14\), use the “evaluate” command. Enter evaluate \(15000 + 100x, x = 14\) in the entry field. Wolframalpha tells you what it thinks you entered, then tells you its answer. In this case, \(15000+100 x, x=14\) .
To evaluate \(15,000+100x\) at \(x = 14\) through 18, use the “table” command. Enter table \(15000 + 100x, x = 14\).. 18 in the entry field. Wolframalpha tells you what it thinks you entered, then tells you its answer. In this case it shows you a table with answers for \(15000+100x, x = 14..18\) .
Try These
Suppose a subscription to a photograph service costs $50 year and that each downloaded photograph costs $2.
- Which of the two quantities is the variable quantity?
- Which of the two quantities is the constant?
- Write the expression that produces the annual cost of subscribing and downloading \(x\) number of photographs.
- What is the annual cost of subscribing and downloading 20 photographs?
- Answer
-
- The variable quantity is the download cost.
- The constant is the fixed service cost.
- Annual cost = 50 + 2 \(x\) , where \(x\) represents the number of downloaded photographs.
- Annual cost = 50 + 2 \(\bullet\) 20 = 50 + 40 = 90 The annual cost of downloading 20 photos is $90
What is the minimum number of cookies a person must eat to be happy? What is the minimum number of cookies beyond that number must eat to feel sick? These numbers are likely different for all of us. Let the variable \(x\) represent the minimum number of cookies someone must eat to be happy, and the variable \(y\) be the minimum number that makes that person sick.
- How many variable quantities are in this problem?
- Are there any constants in this problem?
- Answer
-
- There are 2 variable quantities in this problem.
- There are no constants in this problem