What is Interpolation?
Interpolation is a method of finding new data points within the range of a discrete set of known data points (Source Wiki). In other words interpolation is the technique to estimate the value of a mathematical function, for any intermediate value of the independent variable.
For example, in the given table we’re given 4 set of discrete data points, for an unknown function f(x) :
How to find?
Here we can apply the Lagrange’s interpolation formula to get our solution.
The Lagrange’s Interpolation formula:
If, y = f(x) takes the values y0, y1, … , yn corresponding to x = x0, x1 , … , xn then,
This method is preferred over its counterparts like Newton’s method because it is applicable even for unequally spaced values of x.
We can use interpolation techniques to find an intermediate data point say at x = 3.
Value of f(3) is : 35
The time complexity of the above solution is O(n2) and auxiliary space is O(1).
Higher Engineering Mathematics , Dr. B.S. Grewal
This article is contributed by Ashutosh Kumar. Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Bessel's Interpolation
- Newton Forward And Backward Interpolation
- Program for Stirling Interpolation Formula
- Newton's Divided Difference Interpolation Formula
- Program to implement Inverse Interpolation using Lagrange Formula
- Size of all connected non-empty cells of a Matrix
- Rearrange an Array such that Sum of same-indexed subsets differ from their Sum in the original Array
- Count of Palindromic Strings possible by swapping of a pair of Characters
- Count distinct elements after adding each element of First Array with Second Array
- Count of N digit Numbers whose sum of every K consecutive digits is equal | Set 2
- Probability of Euler's Totient Function in a range [L, R] to be divisible by M
- Minimize count of array elements to be removed to maximize difference between any pair up to K
- Sum of product of all integers upto N with their count of divisors
- Reduce a given Binary Array to a single element by removal of Triplets