Approximate Square Roots with Calculus!

  Рет қаралды 74,244

Mathematical Visual Proofs

Mathematical Visual Proofs

Күн бұрын

Пікірлер: 85
@frendlyleaf6187
@frendlyleaf6187 19 күн бұрын
I would love to see you show a visualisation for the generalized version of this like Newton's method of approximation.
@MathVisualProofs
@MathVisualProofs 19 күн бұрын
Is a good idea.
@samiam6962
@samiam6962 18 күн бұрын
OMG! You guys are such nerds!
@MathVisualProofs
@MathVisualProofs 18 күн бұрын
@@samiam6962guilty
@CostinBeiu
@CostinBeiu 16 күн бұрын
A much simpler approximation is to see that 150 is between 144 and 169. So the result is greater than 12. Thus, the approximate value is 12+ (150-144)/(12+13) . 12+6/25, which is 12.24.
@BenjAvendany
@BenjAvendany 15 күн бұрын
@@samiam6962 says the 5 yr old
@MellencePeanut
@MellencePeanut 16 күн бұрын
Since a year ago, I am really interested about that function, but I interpret it as L(x) = a + (x-a^2)/2a, wherein a is the nearest whole number to the square root of x, because those are just the same thing. If you repeat it a lot of times or make a lot of iterations, the result will become much more accurate. Here is an example: 1st iteration: (using the function you showed in the video) √3 = √4 + (1/(2√4))(3-4) => √3 = 2 - 0.25 => √3 = 1.75 (accurate to 1 decimal digit) 2nd iteration: (using my interpretation about the function) √3 = 1.75 + (3 - 1.75^2)/(2 * 1.75) => √3 = 1.75 - 0.0625/3.5 => √3 = (98 - 1)/56 => √3 = 97/56 ≈ 1.7321 (accurate to 3 decimal digits) 3rd iteration: (also using my interpretation about the function) √3 = 97/56 + (3 - (97/56)^2)/(2 * 97/56) => √3 = 97/56 - (1/3136)/(194/56) => √3 = 97/56 - 1/5432 => √3 = (9409 - 1)/5432 => √3 = 9408/5432 ≈ 1.7319 (accurate to 2 decimal digits) Sometimes, that really happens (number of accurate decimal digits decrease), but notice that if the second last digit in the approximation (1.7319) is rounded off, it will become 1.7320, which is accurate to 4 decimal digits. And so on... I remember watching a video from MindYourDecisions a month ago saying that this algorithm is also used by modern computers to calculate square roots. Using my paper for computing and my calculator, the 4th iteration of doing the function on the squareroot of 3 is 18817/10864 is approximately 1.7320508, and it is accurate to 7 decimal digits! Also for my calculations for √267, the result of the first iteration is 16.34375. :) Bonus: Back then, I watched a video of Tecmath about approximating cube roots, and I saw there that the ∛x = a + (x - a^3)/3a^2, wherein a is the cube root of the nearest cube number to x, that can be rewritten as L(x) = ∛a + (1/3(∛a)^2)(x - a), which looks related to the function in your video that can also be rewritten as L(x) = √a + (1/(2(√a)^1))(x - a). Notice something? The radical power obviously changed, but the power of the variable in the coefficient in the denominator of one of the factors of the product to be added to the nth root of a increased by 1, that can be seen here: √a became ∛a^2. Does that mean the approximation method for the 4th root of x is equal to ∜a + (1/4(∜a)^3)(x - a) or L(x) = ∜a + (1/4(∜a)^3)(x - a)? I tried it with ∜50, with a as 81 (50 is nearer to 81 than 16), and the result in the first iteration was 293/108, which when powered by 4, is 7370050801/136048896 or approximately 54.17207, only off by 4 and a bunch of decimal numbers. But when I tried to do the 2nd iteration, I don't know if this was my fault but the result was really far away (in the millions digit) and even is a negative number. That's all, thank you! 🙂
@Dom-kp6ur
@Dom-kp6ur 16 күн бұрын
It’s because the formula comes from the Taylor expansion. The coefficients for the fourth root of x is very different from the square root, and i don’t have the space to argue why but you may need to include higher order terms to get a decent approximation
@KuldipChandJari
@KuldipChandJari 11 күн бұрын
How did u type cube root and fourth root
@MellencePeanut
@MellencePeanut 11 күн бұрын
@@Dom-kp6ur Alright, thank you! :)
@MellencePeanut
@MellencePeanut 11 күн бұрын
​@@KuldipChandJari I just searched on the internet and copied those symbols from some websites. (from the websites Symbol Hippo and HotSymbol, respectively.) :)
@redpepper74
@redpepper74 10 күн бұрын
@@KuldipChandJariIf you’re on windows an easy way to type a lot of math symbols is to use win+period to bring up the symbol menu. Otherwise you can just put “Unicode cube root symbol” in a search engine and copy the character from somewhere
@Salamander876
@Salamander876 19 күн бұрын
Thank you for making square roots easier to calculate.
@brahmbandyopadhyay
@brahmbandyopadhyay 6 күн бұрын
Sarcasm or no?
@daliasprints9798
@daliasprints9798 19 күн бұрын
This is my favorite trick for approximating sqrt. It even works decently rounding to nearest (optionally even) power of two (computationally dirt cheap) as the point to expand at.
@jaja47_coolness
@jaja47_coolness 19 күн бұрын
I'm a nerd so I make it a series every time 😞
@daliasprints9798
@daliasprints9798 19 күн бұрын
It doesn't give a precise value but it's great when the need for a sqrt comes from needing an upper bound for a buffer size or a partition size to guarantee a particular big-O or anything like that.
@StratosFair
@StratosFair 17 күн бұрын
But how do you find the closest perfect square for large numbers ?
@daliasprints9798
@daliasprints9798 17 күн бұрын
@@StratosFair I don't. I find the closest power of two. Which is just a clz.
@hamzavictor2385
@hamzavictor2385 14 күн бұрын
This is where that formula came from. Nice
@ilovee271
@ilovee271 19 күн бұрын
You can also use newton-raphson's method (on f(x) = x²-a to find sqrt(a)), which is not very complicated, but can approximate very well within a few iterations!
@coderamen666
@coderamen666 19 күн бұрын
This method is actually very similar to Newton-Raphson
@ilovee271
@ilovee271 18 күн бұрын
​@coderamen666 Yes, it is pretty similar, (both use a linear approximation) but it's a bit different.
@CrisFelixTolentino
@CrisFelixTolentino 15 күн бұрын
16.34375 or 523/32
@whoff59
@whoff59 19 күн бұрын
x² = (a + b)² = a² + 2ab + b² You can take a : your first approximation b : the rest, or the difference And probably a >> b , a much bigger than b , so : x² = (a + b)² ~ a² + 2ab 2ab ~ x² - a² ==> b ~ (x² - a²)/(2a) In this case 144 is a square number just below 150, so x² = 150 x = a+b a² = 144 x² = 150 ~ a² + 2*a*b = 144 + 2*12*b 150 ~ 144 + 24b 6 ~ 24b b ~ 6/24 = 0.25 So x ~ a+b = 12.25 I think it's the same equation for approximation as in the video, but it's another approach, isn't it ?
@sajidrafique375
@sajidrafique375 13 күн бұрын
no...he is using taylor series but only two terms..
@danielsaldivar5622
@danielsaldivar5622 19 күн бұрын
It is a nice exercise in a calculus class. In general math just use the calculator in your phone.
@MathVisualProofs
@MathVisualProofs 19 күн бұрын
Sure, But this has been used in various other settings where computing multiple square roots can be faster by only using this linear approximation (like rendering backgrounds in video games )
@danielsaldivar5622
@danielsaldivar5622 16 күн бұрын
@ you’re right, In that case use Maple or Mathematica.
@muralisaripalli164
@muralisaripalli164 18 күн бұрын
A quadratic approximation improves accuracy.
@kepperbeegames
@kepperbeegames 12 күн бұрын
Achievement unlocked: How did we get here?
@KrasBadan
@KrasBadan 15 күн бұрын
Even better: try adding 1 to the denominator. You'd be surprised about how good this approximation is. What it does is it linearly interpolates the graph between perfect squares. By graphing them, we can see that the maximum error is much, much lower. [√x]+(x-[√x])/2[√x] vs [√x]+(x-[√x])/(2[√x]+1) [] means whole part. Here's how to derive the thing in the video without calculus. Let's divide √x in whole and fractional part. [√x]=a x=a²+d √x=√(a²+d)= √(a²+d+d²/4a²-d²/4a²)= √((a+d/2a)²-d²/4a²) Notice how small the d² term is, and it is amplified even further by √. So we ignore it. √x≈√(a+d/2a)²=a+d/2a Why does adding 1 improve it? Well, according to the law of odd numbers, the differences between consecutive squares are consecutive odd numbers. It means that if we are currently at the point of the graph (a², a), in order to go 1 on the y-axis, we need to go 2a+1 on x axis. If we do that, we'll find ourselves at the (a²+2a+1, a+1) point. Easy to see that we stay on the graph. And would you look at that, by adding +1 to the denominator we're doing just that! By increasing d, we linearly move d to the right and d/(2a+1) up. So we'll trace a straight path between two perfect squares. It's so cool, I think it deserves to have its own video.
@راكانالسلمي-ح7ظ
@راكانالسلمي-ح7ظ 14 күн бұрын
Can we use Taylor series ?
@MathVisualProofs
@MathVisualProofs 14 күн бұрын
This is the first order Taylor series (linear approximation). You can use higher order as well but this approximation is decent as is.
@amirammar6687
@amirammar6687 19 күн бұрын
Taylor series when n = 1, x0 = a P_n(x) = f(x0) + f’(x0) ( x-x0) + ( f’’(x0) ( x - x0)**2 ) /2! + …… + ( f^n(x0) ( x -x0)**n ) /n!
@stephenwithaph1566
@stephenwithaph1566 14 күн бұрын
that's more like it! Immediately what I thought of when I saw L(x) defined as the first 2 indeces of the Taylor series. Interesting to know that just 2 indeces is generally good enough for a solid approximation of this function.
@cyberawm1158
@cyberawm1158 19 күн бұрын
16 + 267-256/32 ≈ 16.343 There is a simpler way to write it as √(a+b) where a is perfect square. Then the approximate will be = n + b/2n, where n = √a. Actually just a few days ago, I was bored & lazy and just asked chatgpt the same thing
@barnowlcom
@barnowlcom 19 күн бұрын
I get 275. Does it need parentheses?
@cyberawm1158
@cyberawm1158 19 күн бұрын
​@@barnowlcom If you put the part of parenthesis inplace of 1, then you don't need it
@krishnachoubey8648
@krishnachoubey8648 19 күн бұрын
Ah, yes. Actually I derived the same thing through some simple continuous fractions fuckery. You can also put the approximation obtained from the equation, back into the equation, to get a better approximation. Also, the equation can be expressed in a clean way like- √n ≈ (n + s²)/2s Where, s² ≤ n < (s+1)²
@Kiran_Nath
@Kiran_Nath 13 сағат бұрын
√267 ≈ 16.344
@goldmathshow
@goldmathshow 4 күн бұрын
use square root to calculate square root
@error_6o6
@error_6o6 10 күн бұрын
I'm not sure if anyone's noticed this, but this method is actually mathematically equivalent to the visual method.
@opufy
@opufy 6 күн бұрын
That’s fun😮
@izzabelladogalini
@izzabelladogalini 18 күн бұрын
Isn't this pretty much the same as using the the two known squares either side of the target as demonstrated in your other video?
@MathVisualProofs
@MathVisualProofs 18 күн бұрын
Yep. Essentially the same but this one has a better justification (and provides justification for the other one for the most part)
@izzabelladogalini
@izzabelladogalini 18 күн бұрын
@MathVisualProofs agreed, nearer to a technical proof
@beaumatthews6411
@beaumatthews6411 6 күн бұрын
Equivalent to (x^2+a^2)/(2a)
@KrasBadan
@KrasBadan 14 күн бұрын
I just watched your previous video and it is exactly about what I was talking about in my previous comment damn
@deleted-something
@deleted-something 2 күн бұрын
(16+11/32)^2! (Without the factorial I guess)
@samiam6962
@samiam6962 18 күн бұрын
Nerds!!!!!! I love you all
@insearchof9090
@insearchof9090 12 күн бұрын
Dear friend, Share me such formula for cube root as well.
@RohitSingh-rw8cz
@RohitSingh-rw8cz 19 күн бұрын
I my only doubt is how did you plot the tangent equation?is it a general equation?
@undecorateur
@undecorateur 19 күн бұрын
Yes it is The tangent line of a function on a point a is described by the equation : y = f'(a) (x - a) + f(a)
@MathVisualProofs
@MathVisualProofs 19 күн бұрын
The tangent line passes through the point (a, f(a)) and has slope given by the derivative, which is f’(a).
@RohitSingh-rw8cz
@RohitSingh-rw8cz 18 күн бұрын
Ok i got it now thanks everyone This method is mostly good when your slope is ~0, high slope approximation will be give more inaccurate ans Am i correct?
@aadhvikguitarcovers656
@aadhvikguitarcovers656 16 күн бұрын
This formula is obtained using taylor series. Although this is only a linear approximation, the taylor series gives you the formula for every degree
@belv1767
@belv1767 18 күн бұрын
newtons method and eulers method are better to approx.
@geraltofrivia9424
@geraltofrivia9424 14 сағат бұрын
Not in one step like this one
@sajidrafique375
@sajidrafique375 13 күн бұрын
Thanks to Taylor Series
@algodoomarbleracing
@algodoomarbleracing 13 күн бұрын
i used the method to find the square root of 267 as shown at the end of the short. i got 16.34375
@Krageon-Offline
@Krageon-Offline 6 күн бұрын
16+(11/32)
@muhtah6735
@muhtah6735 13 күн бұрын
Is the formula always the same The l(x) one I dont understand Pls help
@muhtah6735
@muhtah6735 13 күн бұрын
And I'm quite confused where some of the other stuff comes from
@randomdudeexe
@randomdudeexe 9 күн бұрын
This is the taylor series expansion
@MathVisualProofs
@MathVisualProofs 9 күн бұрын
This is just the first order Taylor polynomial (which is the linear approximation). Taylor series is infinite series.
@Paul-s2r4t
@Paul-s2r4t 16 күн бұрын
The exact root is 5 * square root of 6.
@peterburch1108
@peterburch1108 13 күн бұрын
Why would you put a square root in a function which is supposed to simulate finding a square root?
@MathVisualProofs
@MathVisualProofs 13 күн бұрын
The idea is you use the square root at a nearby known perfect square. That’s how the calculus works. So to find square root of x, you are using square root of a twice where root(a) is a known quantity.
@Somerandomchap
@Somerandomchap 19 күн бұрын
Can't you just put a McLaurin series and just evaluate it to, like, the fifth/sixth time?
@MathVisualProofs
@MathVisualProofs 19 күн бұрын
Maclaurin series for root(x) isn’t possible. But this is the first order Taylor poly and we could do higher order Taylor polynomials as well but not sure the accuracy they give is worth it.
@Somerandomchap
@Somerandomchap 19 күн бұрын
@@MathVisualProofs Oh because d/dx[sqrt(x)]=x^(-1/2). That makes sense. :)
@MathVisualProofs
@MathVisualProofs 18 күн бұрын
@@Somerandomchap :)
@johnpinckney7269
@johnpinckney7269 7 күн бұрын
Taylor series
@Fadhw
@Fadhw 18 күн бұрын
Make sense
@imaginaryunitlord
@imaginaryunitlord 18 күн бұрын
oh yeah you don't know sqrt(150) but you know sqrt(150) its a joke btw
@chinchang5117
@chinchang5117 14 күн бұрын
To be honest, I am not a fan of this method. square root of 150 is about 12 + 1/24(150-144). How are u going to work out 12 + 1/24(150-144)? U need to press the calculator, right? And if u are going to press the cal, y dun u press square root of 150 in the first place??
@MathVisualProofs
@MathVisualProofs 14 күн бұрын
150-144 is 6. 6/24 is 1/4. So the answer is 12.25. No calculator needed
@brokedude9999
@brokedude9999 13 күн бұрын
What the Hell did You just say?? For those of Us that don't speak Advanced Nerd- Huh??
@kunalchakraborty2090
@kunalchakraborty2090 14 күн бұрын
16.34375
@Bang-z7t
@Bang-z7t 19 күн бұрын
a
@jawico6098
@jawico6098 8 күн бұрын
slow down pease
@Skelet-enda
@Skelet-enda 12 күн бұрын
xy=y¹⁰⁰-x¹⁰⁰
Approximate Square Roots Visually!
1:00
Mathematical Visual Proofs
Рет қаралды 126 М.
The strange cousin of the complex numbers -- the dual numbers.
19:14
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН
IL'HAN - Qalqam | Official Music Video
03:17
Ilhan Ihsanov
Рет қаралды 700 М.
What does the second derivative actually do in math and physics?
15:19
a+b+c+d+e = abcde
12:01
Prime Newtons
Рет қаралды 69 М.
Fast Inverse Square Root - A Quake III Algorithm
20:08
Nemean
Рет қаралды 5 МЛН
What are Catalan Numbers?
9:30
MathVerse Animated
Рет қаралды 5 М.
7 Outside The Box Puzzles
12:16
MindYourDecisions
Рет қаралды 114 М.
Factoring Quadratics WITHOUT Guessing Product & Sum
20:01
JensenMath
Рет қаралды 333 М.
Why You Can't Bring Checkerboards to Math Exams
21:45
Wrath of Math
Рет қаралды 451 М.
Can you crack this beautiful equation? - University exam question
18:39
Can You Beat Minecraft if the Whole World is Water?
16:07
EnderSkull
Рет қаралды 379 М.
I Redesigned the ENTIRE YouTube UI from Scratch
19:10
Juxtopposed
Рет қаралды 1 МЛН