Lagrange Interpolation
HTML-код
- Опубликовано: 13 сен 2024
- Lagrange Interpolation Formula
In this video, I present the extremely neat Lagrange Interpolation Formula, which gives a clean formula for a polynomial that goes through given points. And I do this purely using linear algebra techniques, which illustrates how powerful this subject actually is!
For instance, here I find the polynomial of degree 2 that goes through (1,2), (2,3), and (4,11).
It's not too good to be true - it's too good and it's true! Enjoy!
Check out my Vector Spaces playlist: • linear algebra vector ...
Subscribe to my channel: / drpeyam
I find it hard to believe that there's anything in math that could take you 10 years to understand :) But I see your point, sometimes the simplest things are hardest to really grasp.
Also, I love how linear algebra just pops up everywhere, especially if you're trying to calculate stuff or do anything "practical".
I mean he would never be able to understand the hardest parts of math, but Lagrange Interpolation Formula is quite easy to understand maybe it would take 10 hours at most to understand it along with its proof
Am I the only one who constantly looks for his videos after searching something??? Love his lectures!!!
this is a neat way to construct any degree polynomial, super intuitive the way presented it but I could see how it's confusing if you write it out abstractly
Most satisfying video of Lagrange's Polynomial so far.
highly used in statistics for smoothing curves. Thank you Dr. Peyam.
Would that not be cubic spline interpolation?
super intuitive. Thank you !
You're most welcome!
It's worth noting that there isn't a polynomial for every set of pairs; the x coordinate needs to be different for each member of the set. In this case, this is equivalent to assuming the denominators are nonzero or assuming a function (not necessarily polynomial) of x exists which goes through those points
Thanks Dr. Peyam, great explanation!!!
Highly instructive. Congratulations for your great videos!!
Very helpful Thank you Sir 🙏🏻🙏🏻
Very helpful and understandable for my seminar facharbeit( project). Many appreciation!
I have no idea what's going on after the 9:00 mark, But the first 9 minutes were extremely helpful. Thanks!
From the educational point of view it is a very good explanation.Thank you.
I love that intro.
wow , that was a solid explanatin, thank you . could you make a video for newton interpolation as clear as this one?
I first saw this technique in a very basic polynomial question in my book i.e something like f(x) has some degree say 4 sat f(1)=3 f(2)=5 f(3)=7 find f(4)
If we let p(x) = (x-1)(x-2)(x-3) + 2x + 1, it would satisfy the given conditions.
Thanks a lot, it took me so long to get it
Hi! Could you please do a lecture on Vandermonde matrix? I really enjoy your explanations, please don't stop making videos :))
There are 3 videos on Vandermonde on my channel!
@@drpeyam what, where do you hide those treasures?
Just search Vandermonde Determinant dr Peyam
Very nice video thanks D peyam السلام عليكم
Clear explanation thank you!
It is a similar process to partial fraction, except the denominator and numerator is interchanged
Wow! Never thought of it that way, thanks!
This is interesting. I just learned something new 🙂
Any time I see things like this, I like to think of outlandish hypotheticals that might relate to the new method I've learned.
I'd imagine it would be possible to extend this to infinitely many points. If you were to trace e^x, for example, would you just arrive with the taylor series?
Assuming it does, what if you tried it with a polynomial that doesnt have a taylor series of finite convergence interval? What would it do?
Maybe it would it become a sinusoidal wave of infinite magnitude, and a period equal to the distance of your points? But then what if chose points that approached infinite density?
Probably some dumb questions in there, but I thought I'd share my thought process. I always have fun thinking about things like that
That's not dumb , that's how people discover new things. Keep on going with your thought experiments
You just saved my life i love you
❤️
wow this man is amazing!
I don't have time atm to watch the whole video and see why you're doing it this way, but the way I learned to solve for a unique polynomial of degree n given (n+1) points is to solve Xc=y where X is the matrix of exponents of x (x0^0, x0^1,...,x0^n; x1^0, x1^1,...,x1^n;...;xn^0,xn^1,...,xn^n), c is the coefficient vector (c0, c1,...,cn) and y is the vector of y's (y0,y1,...,yn). You solve using RREF to find the coefficients.
But imagine you have a 30x30 system!
Interesting. Thank you.
Right away my first question was: “can you use any 3 points to form a parabola?” And I feel like my answer is yes and no. For example {(0,0),(1,1),(1,-1)} do not form a y=f(x) parabola but instead an x=f(y) parabola. Also {(0,0),(0,1),(1,0)} probably form a parabola at a 45 degree angle(I haven't checked). So now my question is: “what are the requirements for this question?” Are we only looking for points that satisfy parabolas y=f(x)? If so, then there are definitely some restrictions(take 3 colinear points for example, which do not form a parabola).
The beautiful thing is all you need is the x coordinates of the points are all distinct
And non-colinear, correct?
You don’t even need non colinear!
Ok. I see what you are saying. The Lagrange formula works even for colinear points. However, the result is a linear function and not a quadratic.
No, not even that! If you have n+1 points, then there is a polynomial of degree n that goes through the points. So if you have 3 even colinear points, you can find a parabola going through them
So, using Lagrange interpolation, the simplest polynomial that goes through (x₀, y₀) and (x₁, y₁) is
y = y₀(x - x₁)/(x₀ - x₁) + y₁(x - x₀)/(x₁ - x₀)
or y = x(y₀ - y₁)/(x₀ - x₁) + (x₀y₁ - x₁y₀)/(x₀ - x₁)
i.e. a straight line with gradient (y₀ - y₁)/(x₀ - x₁)
and y-intercept (x₀y₁ - x₁y₀)/(x₀ - x₁)
(Why does the y-intercept look like the cross product of (x₀, y₀) and (x₁, y₁)? )
I use this method to find the next number in a sequence when I've failed to see a sufficiently simple pattern.
Yeah, exactly! And it looks like a cross product because it can actually be written as a determinant, just like the cross product can
@@drpeyam Ah yes, because ax + by + c = 0, ax₀ + by₀ + c = 0 & ax₁ + by₁ + c = 0 have to be satisfied simultaneously, det[[x, y, 1], [x₀, y₀, 1], [x₁, y₁, 1]] = 0.
Good Job
خیلی مخلصیم
If you write each of these as a system of equations (p(x_0)=y_0, p(x_1)=y_1, and p(x_2)=y_2), couldn't you write that in the form of a Vandermonde matrix of input variables times a vector of polynomial coefficients equals an output vector (V(x_0,x_1,x_2)A=Y)? If so, how could you take the inverse of the Vandermonde matrix to solve this problem? How easy is it to apply this for higher dimensions (points)? I've done two points and it worked, but I can't know how I can apply this for a variable amount of points. I could write python code for it, but I'd like to see if there is some interesting theory behind it.
Good luck solving that system, especially if it’s a degree 30 polynomial. This formula is much more elegant
great for explanation
sorry please this question solve it please
using the numbers x0=-1 and x1=1. find the second interpolating polynomial for f(x) 1/1+x by lagrange form of interpolating polynomial.
no u
Good job and thanks🙏 during the video I was wondering :are u persian or Indian?
Persian
Dr Peyam nice, keep up the good work 😍
Does this imply that every single possible combination of unique points in R2 can be described by some polynomial function?
Yeah! As long as the x coordinates are distinct
@@drpeyam www.desmos.com/calculator/npfey8glyg
So cool!!!! Thank you!!!
@@drpeyamenjoy ^__^
I did not get the last point.
So at the end you proved the fundamental theorem of algebra? Cool
Not exactly, the Fundamental Theorem of Algebra says every polynomial has EXACTLY n roots. What Dr P did here was prove that it has AT MOST n roots. The difficult part is showing that it has even one root at all!
@@noahtaul oh yeah counting complex roots yeah you're right excuse me
1:20 to 3:18
nice shirt, did you find it at "CrossRoads" store?
Thanks!!! It’s a Calvin Klein shirt I bought at Macy’s
Still a nice shirt , but my comment was meant as a joke because it looks like a road with the broken white line divider ! : )
Oh! I thought you meant Crossroads Clothing Company 😂
What happens when the three points are colibear?
You get a polynomial of degree 1 (a line), which is still of degree less than or equal to 2
Dr Peyam so the quadratic terms annihilate each other. Interesting cuz that’s not as immediately apparent.
@@foreachepsilon try (1,1), (2,2) & (3,3)
y = 1.(x-2)(x-3)/2 - 2.(x-1)(x-3) + 3.(x-1)(x-2)/2
y = x
I am preparing for next month's exam. does it really take 10 years to understand?. :(
Yep
e, sin, cos, tan ultimate Lagrange polynomials
You can also solve for 3 unknowns using 3 equations.
9:38 you said lagrange multiplier XD
LOL 😂
I hate everyone who disliked this video
شما ایرانی هستید، درسته؟
Bale!
@@drpeyam خوشوقتم. لحجه ی سلیس انگلیسی شما نشون میده خارج از ایران زندگی می کنید.
Much needed reminder for cultural appropriators that Lagrange was actually Italian 😠