Linear Interpolation

In statistics, linear interpolation is often used to find the estimated median, quartiles or percentiles of a set of data and particularly when the data is presented in a group frequency table with class intervals. In this article we will look at how to do a linear interpolation calculation with the use of a table and graph to find the median, 1st quartile and 3rd quartile.

Get started

Review generated flashcards

Sign up for free
You have reached the daily AI limit

Start learning or create your own AI flashcards

StudySmarter Editorial Team

Team Linear Interpolation Teachers

  • 7 minutes reading time
  • Checked by StudySmarter Editorial Team
Save Article Save Article
Contents
Contents

Jump to a key chapter

    Linear interpolation formula

    The linear interpolation formula is the simplest method used to estimate the value of a function between any two known points. This formula is also useful for curve fitting using linear polynomials. This formula is often used for data forecasting, data prediction and other mathematical and scientific applications. The linear interpolation equation is given by:

    \[y = y_1 + (x-x_1) \frac{(y_2-y_1)}{(x_2-x_1)}\]

    where:

    x1 and y1 are the first coordinates.

    x2 and y2 are the second coordinates.

    x is the point to perform the interpolation.

    y is the interpolated value.

    Solved example for linear interpolation

    The best way to understand linear interpolation is through the use of an example.

    Find the value of y if x = 5 and some set of value given are (3,2), (7,9).

    Step 1: First assign each coordinate the right value

    x = 5 (note that this is given)

    x1 = 3 and y1 = 2

    x2 = 7 and y2 = 9

    Step 2: Substitute these values into the equations, then get the answer for y.

    \(y = 2 +(5-3)\frac{(9-2)}{(7-3)} \quad y = \frac{11}{2}\)

    How to do linear interpolation

    There are a few useful steps that will help you compute the desired value such as the median, 1st quartile and 3rd quartile. We will go through each step with the use of an example so that it is clear.

    In this example, we will look at grouped data with class intervals.

    ClassFrequency
    0-105
    11-2010
    21-301
    31-408
    41-5018
    51-606
    61-7020

    Frequency is how often a value in a specific class appears in the data.

    Step 1: Given the class and the frequency, you have to create another column called the cumulative frequency (also known as CF).

    Cumulative frequency is therefore defined as the running total of frequencies.

    ClassFrequencyCF
    0-1055
    11-201015
    21-30116
    31-40824
    41-501842
    51-60648
    61-702068

    Step 2: Plot the cumulative frequency graph. To do this, you plot the upper boundary of the class against the cumulative frequency.

    Linear Interpolation Cumulative frequency graph StudySmarter

    Finding the median

    The median is the value in the middle of the data.

    The position of the median is at the \(\Big( \frac{n}{2} \Big)^{th}\) value, where n is the total cumulative frequency

    In this example, n = 68

    Step 1: Solve for the position of the median \(\frac{68}{2} = 34^{th} \space position\)

    Step 2: Look for where the 34th position lies in the data using the cumulative frequency.

    According to the cumulative frequency, the 34th value lies in the 41-50 class interval.

    Step 3: Given the graph, use linear interpolation to find the specific median value.

    We treat the segment of the graph where the class interval lies as a straight line and use the gradient formula to assist.

    Linear Interpolation Cumulative frequency graph StudySmarter

    \(\text{Gradient} = \frac{(\text{Median cf - previous cf})}{(\text{upper bound - lower bound})} =\frac{(42-24)}{(50-41)} = 2\)

    We can manipulate this formula and substitute the value of the median (m) as the upper bound and the position of the median as the median cf which is also equal to the gradient.

    \(\text{Gradient} = \frac{(34-24)}{(m-41)}\)

    So it follows that,

    \(2 = \frac{(34-24)}{(m-41)} \quad 2 = \frac{10}{m-41} \quad m-41 = \frac{10}{2} \quad m-41 = 5 \quad m = 46\)

    So the median is 46.

    Finding the first quartile

    The 1st quartile is also known as the lower quartile. This is where the first 25% of the data lies.

    The position of the 1st quartile is the \(\Big(\frac{n}{4} \Big)^{th}\) value.

    The steps to find the 1st quartile are very similar to the steps to find the median.

    Step 1: solve for the position of the 1st quartile \(\frac{68}{4} = 17^{th} \text{ position}\)

    Step 2: Look for where the 17th position lies in the data using the cumulative frequency.

    According to the cumulative frequency, the 17th value lies in the 31-40 class interval.

    Step 3: Given the graph, use linear interpolation to find the specific 1st quartile value.

    We treat the segment of the graph where the class interval lies as a straight line and use the gradient formula to assist.

    Linear Interpolation Cumulative frequency graph StudySmarter

    \(\text{Gradient} = \frac{(1^{st}\text{quartile cf - previous cf})}{(\text{upper bound - lower bound})} =\frac{(24-16)}{(40-31)} = \frac{8}{9}\)

    We can manipulate this formula and substitute the value of the 1st quartile (Q1) as the upper bound and the position of the 1st quartile as the 1st quartile cf which is also equal to the gradient.

    \(\text{Gradient} = \frac{(17-16)}{(Q_1-31)}\)

    It follows that,

    \(\frac{8}{9} = \frac{(17-16)}{(Q_1 - 31)} \quad \frac{8}{9} = \frac{1}{Q_1 - 31} \quad Q_1 - 31 = \frac{9}{8} \quad Q_1 = 32.125\)

    So the 1st quartile is 32.125.

    Finding the third quartile

    The 1st quartile is also known as the lower quartile. This is where the first 25% of the data lies.

    The position of the 3rd quartile is the \(\Big(\frac{3n}{4} \Big)^{th}\) value.

    Step 1: solve for the position of the 3rd quartile \(\frac{3(68)}{4} = 51^{st} \text{ position}\)

    Step 2: Look for where the 51st position lies in the data using the cumulative frequency.

    According to the cumulative frequency, the 51st value lies in the 61-70 class interval.

    Step 3: Given the graph, use linear interpolation to find the specific 3rd quartile value.

    We treat the segment of the graph where the class interval lies as a straight line and use the gradient formula to assist.

    Linear Interpolation Cumulative frequency graph StudySmarter

    \(\text{Gradient} = \frac{3^{rd} \text{quartile cf - previous cf}}{\text{upper bound - lower bound}} = \frac{(68-48)}{(70-61)} = \frac{20}{9}\)

    We can manipulate this formula and substitute the value of the 3rd quartile (Q3) as the upper bound and the position of the 3rd quartile as the 3rd quartile cf which is also equal to the gradient.

    \(\text{Gradient} = \frac{(51-48)}{(Q_3 -61)}\)

    It follows that, \(\frac{20}{9} = \frac{(51-48)}{(Q_3 - 61)} \quad \frac{20}{9} = \frac{3}{Q_3 - 61} \quad Q_3 - 61 = \frac{27}{20} \quad Q_3 = 62.35\)

    So the 3rd quartile is 32.125.

    Linear Interpolation - Key takeaways

    • Linear interpolation is used to find an unknown value of a function between any two known points.
    • The formula for linear interpolation is \(y = y_1 +(x-x_1) \frac{(y_2-y_1)}{(x_2-x_1)}\)
    • Linear interpolation can also be used to find the median, 1st quartile and 3rd quartile
    • The position of the median is \(\frac{n}{2}\)
    • The position of the 1st quartile is \(\frac{n}{4}\)
    • The position of the 3rd quartile \(\frac{3n}{4}\)
    • A graph of the upper bounds in each class interval plotted against the cumulative frequency can be used to locate the median, 1st quartile and 3rd quartile.
    • The gradient formula can be used to find the specific value of the median, 1st quartile and 3rd quartile
    Frequently Asked Questions about Linear Interpolation

    What is linear interpolation?

    Linear interpolation is a method to fit a curve using linear polynomials.

    How do you calculate linear interpolation?

    How to calculate linear interpolation: Linear interpolation can be calculated using the formula

    y=y1+(x-x1)(y2-y1)/(x2-x1)

    where,

    x1 and y1 are the first coordinates.

    x2 and y2 are the second coordinates.

    x is the point to perform the interpolation. 

    y is the interpolated value. 

    How do you use linear interpolation?

    How to use linear interpolation: Linear interpolation can be be used by substituting the values of x1, x2, y1  and y2 in the below formula

    y=y1+(x-x1)(y2-y1)/(x2-x1)

    where,

    x1 and y1 are the first coordinates.

    x2 and y2 are the second coordinates.

    x is the point to perform the interpolation. 

    y is the interpolated value. 

    Save Article

    Discover learning materials with the free StudySmarter app

    Sign up for free
    1
    About StudySmarter

    StudySmarter is a globally recognized educational technology company, offering a holistic learning platform designed for students of all ages and educational levels. Our platform provides learning support for a wide range of subjects, including STEM, Social Sciences, and Languages and also helps students to successfully master various tests and exams worldwide, such as GCSE, A Level, SAT, ACT, Abitur, and more. We offer an extensive library of learning materials, including interactive flashcards, comprehensive textbook solutions, and detailed explanations. The cutting-edge technology and tools we provide help students create their own learning materials. StudySmarter’s content is not only expert-verified but also regularly updated to ensure accuracy and relevance.

    Learn more
    StudySmarter Editorial Team

    Team Math Teachers

    • 7 minutes reading time
    • Checked by StudySmarter Editorial Team
    Save Explanation Save Explanation

    Study anywhere. Anytime.Across all devices.

    Sign-up for free

    Sign up to highlight and take notes. It’s 100% free.

    Join over 22 million students in learning with our StudySmarter App

    The first learning app that truly has everything you need to ace your exams in one place

    • Flashcards & Quizzes
    • AI Study Assistant
    • Study Planner
    • Mock-Exams
    • Smart Note-Taking
    Join over 22 million students in learning with our StudySmarter App
    Sign up with Email