Skip to main content
Mathematics LibreTexts

1.1: Constants, Variables, and Expressions

  • Page ID
    125026

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    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.

    Definition: Variable

    A VARIABLE is a quantity that has a capacity for change in a particular context.

    Definition: Constant

    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.

    Example \(\PageIndex{1}\)

    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

    Example \(\PageIndex{2}\)

    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.

    Example \(\PageIndex{3}\)

    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

    clipboard_e690fc627774461374f77c78f5a4dddab.png

    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.

    1. 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\)
    2. 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\)
    3. 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

    clipboard_e7c7269a59f84b505ed39295dc629e810.png

    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.

    clipboard_eacd8ddf088966a9a3ca1d4863a56a145.png

    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\).

    This screenshot from WolframAlpha shows an evaluation of 15000 +100x where x = 14. The result is 16400.

    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\).

    This screenshot from WolframAlpha shows an evaluation of 15000+100x. There are multiple values of x, where the values are x=14,x=15,x=16,x=17,x=18. The result is a table with the corresponding x value for 15000+100x. For x=14, the answer is 16400, for x=15, the answer is 16500, for x=16, the answer is 16600, for x=17, the answer is 16700, and finally for x=18, the answer is 16800.

    Try These

    Exercise \(\PageIndex{1}\)

    Suppose a subscription to a photograph service costs $50 year and that each downloaded photograph costs $2.

    1. Which of the two quantities is the variable quantity?
    2. Which of the two quantities is the constant?
    3. Write the expression that produces the annual cost of subscribing and downloading \(x\) number of photographs.
    4. What is the annual cost of subscribing and downloading 20 photographs?
    Answer
    1. The variable quantity is the download cost.
    2. The constant is the fixed service cost.
    3. Annual cost = 50 + 2\(x\), where \(x\) represents the number of downloaded photographs.
    4. Annual cost = 50 + 2\(\bullet\)20 = 50 + 40 = 90 The annual cost of downloading 20 photos is $90
    Exercise \(\PageIndex{2}\)

    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.

    1. How many variable quantities are in this problem?
    2. Are there any constants in this problem?
    Answer
    1. There are 2 variable quantities in this problem.
    2. There are no constants in this problem

    This page titled 1.1: Constants, Variables, and Expressions is shared under a CC BY 4.0 license and was authored, remixed, and/or curated by Denny Burzynski (Downey Unified School District) .

    • Was this article helpful?