Site map 

 Contact Graeme 

 Skip Navigation LinksMath Help > Basic Math > Linear Functions > Linear Patterns > Linear Patterns

A linear function of x is a function of the form y = ax + b, where a and b are constants.  It's called a "linear" function because a plot of the x and y coordinates for which this equation is true takes the shape of a straight line.

Here's an example of a table of x and y values similar to ones in (my son) Matthew's 6th grade math book:













The student is supposed to see a pattern, and fill in the blanks, then write an equation for calculating the values in the table.

Here is the procedure for solving this type of problem.

  1. Start by assuming the relationship between x and y is linear.  That means whenever x increases by some specific amount (the x-increment), y will increase by some other specific amount (the y-increment).  The y-increment depends only on the x-increment, not the value of x.
  2. Look for a basic x-increment.  The first two x values differ by 3.  The next two differ by 3.  The next difference is 9, and the final difference is 6.  These are all multiples of 3, so the basic x-increment is 3.
  3. Look for the ratio of the y-increment to the x-increment.  Do this using two rows of the table that have both x and y values shown.  Calculate the x-increment for these two rows by subtracting the x values.  Calculate the y-increment by subtracting the two y values.  Divide the y-increment by the x-increment to get the ratio of the y-increment to the x-increment.  In the example above, using the first two rows, the x-increment is 10 - 7, or 3.  The y-increment is 20 - 13, or 7.  The ratio of the y-increment to the x-increment is 7/3.  This means when the x-increment is 3, the y-increment is 7, which is the basic y-increment.
  4. Check to see if the x values are multiples of the x-increment by dividing the lowest x value by the basic x-increment, and looking at the remainder.  In our example, the lowest x value is 7.  7 divided by the basic x-increment, 3, is 2 with a remainder of 1.  I'll call this the x-constant.
  5. At this point, you are almost ready to calculate the y-value for any x-value.  Here's the procedure:
    1. Start with the x-value.
    2. Subtract the x-constant.
    3. Divide by the basic x-increment.
    4. Multiply by the basic y-increment.
    5. Add the y-constant.
    6. This gives you the y-value.

    In our example, let's start with the first x-value, 7.
    Subtracting the x-constant, 1, leaves 6.
    Dividing by the basic x-increment, 3, gives 2.
    Multiplying by the basic y-increment, 7, gives 14.
    Now add the y-constant -- wait a minute!  What's the y-constant?  The next step answers that question:

  6. To find the y-constant, use a row of the table that has both an "x" and "y" value filled in.  Now do the procedure, above, through step "e".  Subtract the result from the actual y-value to get the y-constant.  If the result of step e is bigger than the actual y-value, then the y-constant is a negative number.  In our example, the result of step "e" was 14, and the actual y-value is 13 so the y-constant is -1.
    So far I've taught you how to get the y-value if you know the x-value.  Suppose it's the other way around.  What do you do if you know the y-value, but not the x-value?  It's simple.  Just do the same procedure, just switching the x's and y's.
  7. Here's how to find the x-value if you know the y-value:
    1. Start with the y-value.
    2. Subtract the y-constant.
    3. Divide by the basic y-increment.
    4. Multiply by the basic x-increment.
    5. Add the x-constant.
    6. This gives you the x-value.

    In our example, let's start with the first y-value, 13.
    Subtract the y-constant, -1 (remember subtracting a negative is really adding) giving 14.
    Divide by the basic y-increment, 7, giving 2.
    Multiply by the basic x-increment, 3, giving 6.
    Add the x-constant, 1, giving 7, which is the right answer!

  8. Now to write the formula, it's simple:
    y = y-increment/x-increment * (x - x-constant) + y-constant
    In our example, the formula is this:
    y = 7 / 3 * (x - 1) - 1

Do you have any questions about this procedure?  Send me an email.

Related pages in this website


Matrix Math -- a way of solving much more complicated linear systems involving several variables.  This section includes determinants, the Reduced Row Echelon method, also called Gauss-Jordan Elimination and Cramer's rule.


The webmaster and author of this Math Help site is Graeme McRae.