Hi Trefor, great video! The spiral is a beautiful way to understand the Banach Fixed point theorem! However given this definition of a contraction - namely, there is a k such that for all x,y, blah blah... - cosx is NOT a contraction! Proof: Assume there is such a k and let y=pi/2. Then, for all x eq y, it would be the case that |(cos(pi/2)- cosx)/(pi/2 - x)| \leq k < 1. This is a contradiction because that LH quantity approaches 1 as x-> pi/2. QED (Edit) If this was somewhere else in the comments I'll happily delete the comment, but I didn't see anyone else mention this.
@@td904587 Indeed. Luckily in this case we can apply the argument after the first application of cos, since now we are in [-1, 1] (and won't ever leave it) and cos is a contraction on this restricted domain
So does that mean that every f has a k, the same for all x,ys, such that all x,y in whatever domain make that true or does every x,y has a k? Also the spiral was square; is there a way for turn applicable f()s into curved spirals, perhaps archemdean(sp) or logerithmic(sp)?
@@pauljackson3491 for f to be a contraction on some domain, you need to find *one* value of k that is strictly less than 1 and works for all x,y pairs in that domain. I learned today that if the best you can do is k = 1 then it is called "non-expansive" which is a slightly weaker condition than a contraction (and in particular you can't directly apply Banach fixed point to it) about the spirals I have no idea but maybe there's some convention around doing something similar in polar coordinates or something? may lead to some cool pictures :)
This really demonstrates just how beautiful math is. When I looked at the thumbnail I immediately thought "wow I have no idea what is it," but in hindsight the answer of cos(x) = x is incredibly intuitive. Its amazing how something so complicated can be become so simple
I googled what is cos x = x before watching the video, just by seeing the title. I knew that was a fixed point, and I assumed it might converge there, but wasn’t sure..
At University I learned this in limerick form: If A's a complete metric space, And nonempty we know it's the case That if F's a contraction Then under its action Just one point remains in its place
D'oh, I posted the same thing because I didn't see any of the top comments say this. If only I scrolled down a few more inches I'd realize I was repeating you XD;;
"The name of the constant originates from a professor of French named Dottie who observed the number by repeatedly pressing the cosine button on her calculator." -- I did the same when I was a kid playing with the calculator. It could have been named after me ;D
It's nice to be a software engineer, but be a math enthusiast and watch those kind of videos explaining interesting behaviors. Keep up this work, it's excelent and joyful!
I remember noticing the convergence when I was 12-13 years old. I had bought my first scientific calculator and was so fascinated that I would try all the functions on it for hours. I would calculate repeated operations like this. I calculated cos(cos( .. 23 times)) and found that it converges, although I had no understanding of limits. BTW 23 was the stack size of the calculator operations and I could only repeat cos 23 times beyond which the calculator would report ‘stack error’
Holy crap! Thanks for the memory. I have an old school folder that has a few things doodled on it and one of them is a cos(cos(cos(cos(cos... equation.
On older scientific calculators (without TI's AOS, Casio's V.P.A.M., or whatever), operations and functions that operated on a single operand where typed AFTER the number (similar to RPN calculators where that also applies to binary operators such as '+' and '-'), so you could just enter a number and repeatedly mash the COS key. This worked in any of the angle modes, degrees, radians, or gradians, but of course the value it converged to depended on the current angle mode.
Really interesting. I tried doing the sin(cos(sin(cos(...))) and it has two points it jumps between, those being x1=sin(cos(x1)) and x2=cos(sin(x2)) with them obviously x1=sin(x2) and x2=cos(x1)
cos(x) definitely has one of the more interesting fixed points. I decided to check some other functions, and it seem that if the graph doesn't intersect the x=y graph, then it obviously doesn't have a fixed point (ln(x) diverges to the complex plane, and e^x diverges to infinity). sin(x) has a pretty obvious fixed point of 0, but sqrt(x) and x^2 had some interesting behavior where they both have 2 fixed points at 0 and 1, but for sqrt(x), 0 is an _unstable_ fixed point, and 1 is _stable,_ while for x^2, the relation is flipped. In addition, the fixed point for x^2 is only reached if the starting point is between -1 and 1, otherwise it diverges (away from the unstable fixed point 1) towards infinity. 1/x _neither_ diverges, _nor_ converges to a fixed point, always oscillating between two values depending on the input. (-x would have the same behavior since they're both their own inverses, though both do have fixed points in the form of 1 and -1 for 1/x, and 0 for -x.) tan(x) has _infinitely many_ fixed points, including at 0, but all of them are unstable, but not necessarily diverging to infinity when not at them, instead looking like it would have a chaotic behavior.
The general case of x(n+1) = -ax(n)^2 + bx(n) + c (a, c > 0) is very intetesting. Depending on a, b and c, it has divergent, convergent, bifurcations and chaotic behavior. Look up "This equation will change how you see the world (the logistic map)." They use x(n+1) = rx(n) (1-x(n)).
Interesting - Kind of makes sense that a function and it's inverse would have the opposite in terms of stable and unstable fixed points. (I vaguely remember doing something like this as university homework, and finding some (usually unstable) fixed points the other students missed because I checked for complex ones as well as real.) You say you tried 1/x, but of course the really interesting one (if you haven't seen it before) is 1 + 1/x
Banach Fixed Point theorem is the reason for convergence in most traditional reinforcement learning algorithms and that is basically the reason for a lot of advances in robotics
My favorite way to think about the theorem is that if you have a map of your town, your house or the room you're in, then there's exactly one point on the map in the same place where it is in reality. It's the kind of thing you have to discuss with a stoner at a party. "So there's a small map on the big map and another map in the small map and.. whoa dude"
Another thing I'd like to point out is that questions like this are classically solved with the Intermediate Value Theorem. Although Banach's fixed point theorem is nice, IVT is a much easier way to go about this one.
@@jackm.1628 so once we realize this is a question about the solution to cos(x)=x, we can then look at the function g(x)=cos(x)-x. And IVT tells us that we do indeed have a root of g(x), which is what we are looking for.
@@dackid2831 I see. But we still need Banach's Theorem to prove that ...cos(cos(x))... converges to something. And then we may be interested in solving cos(x) = x. The IVT just shows it's possible to solve cos(x) = x, but it doesn't tell us how.
@@jackm.1628 Yes, that part is certainly true. I would also like to point out Banach's doesn't tell us how to solve it either. Banach's shows us that it exists given those conditions. In contrast, for IVT, we assume such a solution exists, and the IVT helps us confirm that.
@@dackid2831 Well Banach tells us that the sequence x_(n+1) = cos(x_n) converges to the solution, so this is one way (though perhaps not very good) to solve it.
im still trying to get my head around all of the calc sequence but it seems its true that there is always more to learn / discover. thanks for videos like these it helps to reinvigorate a desire for learning math.
Banach fixed point theorem is also related to the Picard-Lindelof theorem and determining the existence of the solution for the cauchy problem y' = f(x,y)
I’m not sure if this is a valid argument but I think you could also recognize: if there are infinitely many cos x = cos(cos(…cos(z)…)) Then removing one cos gives the same expression. Or said differently, the inner term is the same as the whole term (independent of z) so: x = cos(x) and we instantly arrive at the same conclusion.
@@shashanksistla5400 Consider the equation x^x^x^x...=2, you can use this technique to say x^2=2, x=sqrt(2), done. However, if I ask what is x^x^x^x...=3, then this technique fails. This is because the function x^x^x^x...only converges when e^-e < x < e^(1/e). More explanation here: ua-cam.com/video/xaBhTU01vsA/v-deo.html
Nice presentation. I took a more practical approach to get a decimal approximation for the limit. If the limit exists and is L. Then L=cos(cos(...)) So L=cos(L) With a graphing calculator: L is approx 0.74
When I was a kid. I used to play with scientific calculator. I like to see numbers converge by pressing "cos" over and over. It was no fun in "deg" and "grad" mode though.
Me too. I wondered for years what that mysterious result was. Then I read up on chaos theory, where it was described in the introduction as "Picard's method."
This is great. I’m learning about fixed point iteration recently in my numerical algorithm course, and I always have a hard time picturing these process in my head. The spiral graph is a really helpful perspective!
Great video! I remember 3b1b did a video on fixed points where he was looking at f(x) = 1 + 1/x which has two fixed points (phi and -1/phi). If you iterate f on any point except -1/phi and 0 then you'll converge to phi, and the reason boils down to |f'(phi)| < 1 and |f'(-1/phi)| > 1. I notice that the definition of contraction |f(y) - f(x)| < |y - x| would imply |f'(x)| < 1 everywhere.
Interesting, I hadn't thought of recursion in this light. Obvious in hindsight. Weird how the different deffintions of "function" aline... The question is how this works in generalized 'Space' ! :)
if you start with an angle in radiant you reach 0.7391, if you start with an angle in degree you will reach 0.9998. i tested it in matlab: clear all; close all; clc it=1000000; prompt = 'Input a starting angle '; x = input(prompt); for l = 1:it x=cosd(x); %x in degree % x=cos(x); %x in radiant end disp(x)
While this is true, degrees are a completely arbitrary measure of angle. There is no internal mathematical point of reference that makes it sensible. Radians, on the other hand, describe the length of the arc at the unit radius. While degrees may fit better with common experience, mathematically they don't make a lot of sense.
Fun Fact: There's an application of the derivative of a function f at its fixed point x*, and its that it tells us how fast we approach our fixed point by reiterating f around x*. In this case, we have the derivative of cosine evaluated at x* ≈ 0.739, so we get -sin(x*) ≈ -sin(0.739) ≈ -0.674. What this tells us is if we take some value x near x* ≈ 0.739, say x = 0.75, then the distance from f(x) to x* will be about -0.674 times the distance from x to x*. Written as an equation, we have f(x) - x* ≈ f'(x*)(x - x*). And plugging in f(x) = cos(x), x* ≈ 0.739, and x = 0.75 we see that this is true, as we get cos(0.75) - 0.739 ≈ -sin(0.739) (0.75 - 0.739), which gives −0.007396 ≈ −0.007352. f(x) - x* ≈ f'(x*)(x - x*) also lets us approximate cosine in terms of x and x* well if x is close to x*. I won't write out the work but approximating cos(0.74) with the equation should have an error less than a millionth!
I love to hear the logic and see the analysis. It is much more emotionally and intellectually satisfying than the "10-second graphing calculator solution". You can probably tell from my comment that I'm an old geezer, a retired community college math instructor.
My first though was that this is like an eigenvalue, that is to say x st x = f(x), for f(x) = cos(x) because when this is true, the whole cos(cos(cos(...cos(x) sequence collapses. I'm not sure how you find it, other than iteratively. What was interesting was trying this on a calculator, I saw it oscillate around the final value with smaller and smaller amplitude.
It's a very strange coincidence that you are posting this video at this time, because I just accidentally rediscovered the Dottie Number last semester. I was studying Advanced Electromagnetics, and I came across cos(cos(x)) somewhere. I was curious about what the plot looked like, so I entered it into Desmos, and then I plotted cos(cos(cos(x))) and cos(cos(cos(cos(x)))) and so on, and I noticed that every iteration made the plot look more and more like a horizontal line, i.e. a constant. I did some digging and found that the constant had already been discovered, and was named the Dottie Number.
Wow. This video appeared in my feed and I browsed the channel. I m really elated to see something like this made by someone so passionate. Much appreciated. 🔥 I'll tell about this channel to my friends as well. Such a gem should get more subscribers.
I like how intuitive the answer cos(x) = x is when you think about it (if you assume that the sequence does in fact converge). Because whatever number x it converges to, it must be true that applying cos to x one more time will give you back x - if it gave you anything else, then evidently the sequence doesn't converge to x, but to this other number. So it must be true that cos of the answer is equal to the answer itself --> cos(x) = x.
This video is providing a great demonstration of the Banach fixed point theorem. But the video didn't emphasize on, how immensely important this theorem truly is. But to be also honest, I for myself simply cannot stretch enough, how immensely important the Banach fixed point theorem really is. From this theorem basically follows the theorems for inverse functions, the existence and uniqueness of differential equations and basically any numerical approximations and alternative methods like finding the roots of a function with the Newton-method. So basically, what I'm getting at, that ALL modern and current science is basically reliant on the results from this theorem and what it can provide and has already provided.
it's the first time I see your channel here and it's always good to find some great youtube math videos. Most of math videos on youtube are about people who dont know math trying to clickbait saying like "1+2+...=-1/12". The math channels I knew were good were 3b1b and Mathologer, and apparentely yours too. Well, it's just a suggestion, I'm a olympiad student from Brazil and I would love to see videos about olympiad math problems, like IMO or maybe something a bit easier. There are some beautiful problems which dont require much of a basis like combinatoric ones, and I bet everyome should love it. Thanks for the content!
you could also take a more algerbraic approach as well, for example, let y=cos(cos(cos(...... then you would get y=cos(y) by replacing the "cos(cos(...." with y and since y is just some arbitary constant like x then we arrive to the same conclusion in the video :)
A neat way to find a converging iteration method for the solution to the equation. Just like for infinite continuous fractions x=a/(b+a/(b+a/(b+...))) is just like saying x=a/(b+x) and guessing x1 gives x2=a/(b+x1) etc. which is such a neat way of calculating square roots from a formula instead of the long division style method! sqrt(n) = a + b/(2a+b/(2a+...) where b=n-a^2 OK I know this gives increasingly large denominators in fractions and the long division method sorts out the decimal places in the square root which is so much easier than dividing big numbers in fractions. One equation I was trying to find a solution to using iteration didn't work because some iterations took the next value further from the solution than the previous, and it didn't converge. Some take ages to converge. Your x = cos x is a good example. I tried putting in x1=0.73 on Excel to see how many iterations it takes to get the solution to 15 decimal places: 81 iterations! A bit longer than I expected. I was just curious to see what the solution was in terms of pi, because it is in units of radians. OK it's 0.235258...pi radians, not an obviously special number. Maybe naming numbers after people is not as good as giving them a number that is easier to remember like maybe the 'cozzy number' because it comes after reapeating cos(x) many times!
f(x) = cos(ln(x)!) Does not converge under repeated applications. It starts to, gets to about the 6th decimal place uniformly decreasing, then starts bouncing back up... then slowly eases back down, and bounces back up. The closer it gets to converging the farther up it bounces.
Method to reach answer by rearranging: Using BFPT to show limit exists, then cos(cos(…x)) = L => acos(cos(cos(…x))) = acos(L) => cos(cos(…x)) = acos(L), hence L = acos(L) => cos(L) = L => L = 0.7…
f(x) = 2 + x - arctan x, satisfies the definition of a contraction in the video, but doesn't have a fixed point. (See wiki for definition of a contraction.) Great video though! Nice explanation of the spiral geometric view!
For a fixed point to be a solution, the slope of the tangent by that fixed point must be less than 1. If you start with exactly pi/2 you will not converge towards the Dottie number. Solving it with a computer can lead to the solution eventually due to machine epsilon inaccuracies.
You could skip steps just by saying Cos(cos(cos…(x))) = y Then because of the self similarity you can say that Cos(y)=y Which lands you on that same forumula without the spiraling
I started off thinking I had no idea how to even start something like this but feeling like there was something familiar about this. As the video progressed, I realized the problem as stated is just the relaxation method for solving the equation cos(x) = x, an incredibly useful albeit somewhat slapdash way of solving non-linear equations that I've studied in a physical computing class.
After watching the solution of spiraling into the convergence point by bouncing between y = cos(x) and y = x, I felt like there ought to be a graphical way of seeing whether any arbitrary function will converge recursively. After a lot of fiddling, I think I've figured out that a function will recursively converge if: 1. y = f(x) crosses y = x 2. The closest point at which f(x) = x (the two graphs cross) has a slope with absolute value less than 1 ( |f'(x)| < 1 at f(x) = x ) I figured out point 2 from their definition that it is a convergent function if |f(y) - f(x)| < |y-x| Also, you can use f(x) = x to find the solution if it converges Here are some examples of playing with this: Using this methodology, you can see that sqrt(2)^sqrt(2)^sqrt(2) ... = 2. If you use the graphical method (have some starting point other than the convergent point and draw lines) and start from the left, you will approach (2,2) from the left, and sqrt(2)^x has slope less than 1 at x=2, so it converges. However, if you use the graphical method and approach from the right, you approach x = 4 ( sqrt(2)^x = x at both 2 and 4 ), and sqrt(2)^x has slope greater than 1 at that point, so you will actually diverge if you approach from the right (bounce farther and farther away from the convergence point, getting bigger and bigger numbers). I believe there are many such functions that will converge from one direction, but not the other. If you have functions symmetric about y = x, such that the slope where it crosses y = x is -1, then you will neither converge or diverge because using the graphical method will draw a rectangle rather than a spiral. Examples are y = 2-x, y = 1/x, and y = sqrt(2-x^2). In all these cases, 1 is a convergent solution for f(x) = x, but if you use the graphical method, you will trace a box over and over again, indicating that you will never actually get closer to the convergent point if you don't start there from the beginning. 1/x neither converges nor diverges (it draws a box), 1/sqrt(x) converges, and 1/x^2 diverges (the graphical method gets you farther and farther away), even though starting with the point (1,1) gives you a convergent solution for all of them. You can also play with lines. If f(x) = 1-x, it will neither converge nor diverge, since doing the recursion will give you 1 + 1 - 1 + 1 ... . If you use f(x) = 1 - 0.5x, that has slope less than 1 and you will converge, because it will produce the series 1 - 1/2 + 1/4 - 1/8 ... = 2/3. If you use f(x) = 1 - 2x, you will diverge, because the recursion produces 1 - 2 + 4 - 8 ... (although it doesn't exactly converge to a stable point, using 1/(1-r) says it averages 1/3). Using f(x) = 2x -1 will even more obviously diverge, since you will get the series -1 - 2 - 4 - 8 ... .
I remember back in Calc 1 we had to differentiate sin(sin(sin(sin(sin(sin(sin(sin(sin(sin(sin(sin(x)))))))))); it makes a beautiful triangle if you put each factor on its own line and right align everything. This gave me flashbacks. Good video
At first I didn't understand the spiralling but when I tinkered it with pen copy for sometime and understood it was just amazing how they boiled down that iteration to such an intuitive visual spiral.
i would just said: let L= cos(cos(cos...(x), then L = cos(L), which gives a direct solution. however, your proof shows geometrically where this number comes from, and that's what i love about it
Closely related problem Let x_0 = 1 x_1= tan (x_0) x_n = tan( x_n-1) Set {x_0 , x_1,..., x_n,...} is dense in reals. That Fekete's conjecture. Prove it! 😁
Note that you can find the approximate value of Cos(x) = x by considering the Taylor series of Cos(x) = 1 - x^2/2 + O(x^4), such that we now consider the roots of 1 - x^2/2 = x, implying that x \approx \sqrt{3} - 1 using the quadratic formula. This value corresponds to around 0.73205.
a fun heuristic that you can look at to "guess" the answer is that you set a=cos(cos(cos(...))) and notice that inside the first cos you have a again so you get a=cos(a), not very rigorous but still pretty cool
remember trying something like that when I first got a calculator that had trig stuff on it. Just kept hitting the "COS" button over and over (also tried the "!" button over&over and it overflowed, the "SIN" button over&over and it went to zero, etc...)
Assume the infinite expression, call it C(x), has value y. Taking the cos of both sides of y = C(x) leaves the RHS unchanged, so cos(y) = C(x) = y and y = cos(y) -> y = 0.739.
I am currently learning Bellman Operators in Reinforcement learning and this idea of contraction operator is also there. I presume this theorem is used in some way to find the solutions of the recursive bellman expectation equations.
Think I found an easier way to solve this one without using graphical intuition. Say we set the value of cos(cos(cos... to n. cos(cos(cos... = n Applying a cosine to both sides of the equation will not change the value of the expression on the left, because it is infinitely long, and infinity plus 1 is still just infinity. cos(cos(cos... = cos(n) Now, understanding the transitive property of equality, we can deduce that cos(n) = n Since there is only one real number that satisfies this equation, we know exactly what n equals, and so we know what cos(cos(cos(cos... equals. n ≈ 0.739...
cos(x) = x just makes sense outta the get go since you could really look at nested cosines as a recursively defined function which cos(x) = x satisfies as plugging and substituting would give you cos(cos(x)) = x which is then just cos(cos(cos(cos(x))) = x and so forth and so on until infinity.
Is it necessary to have any fixed point at all? Let f(x)=0.5*(x+sqrt(x^2+4)). Which is just one branch of a hyperbola where y=0 and y=x are asymptotes. This function satisfies |f(y)-f(x)| < |y-x|. But it doesn't have a fixed point since y=x is just a asymptote line.
Call the infinite set of cosine functions A. We can take the cosine of A once and still have an infinite number of cosines, so cos(A)=A. Therefore, A is the solution to cos(x)=x.
My way of doing it: Let cos(cos(cos... = k. then cos (k) = k, since the thing inside the first cosine is the replica of itself Then find the k that works and that's the sum for me
Problem with the word "until" : 05:13 .. "This spiral is going to keep on spiralling closer and closer and closer" until it starts to converge .. wait, what? (*) At what point exactly does it "start to converge" ?
Could you use the same intuition for any repeated function? This should exhibit the same properties for any convex periodic function, ie converging to one value where f(x) = x
If you needed to explain why you get to x=cos(x) to someone very quickly you could say this. if you let A = cos(cos(cos(cos(.... then you could rewrite A as A = cos(A), because after the first cos you still have an infinites cosines, which are still equal to A.
Or, alternatively, you can hit a rectangle that is not contracting further. A bifurcation, that splits the solution into two alternating roots y=f(x) and x = f(y).
Its pretty easy to spot that if it does indeed converge to a fixed value it must be the value where the output doesnt change per itteration which is only cosx=x, just like the itterative sequence approaching phi doesnt change with an input of phi, or any other such thing. cool little quicky problem tho:)
One way to prove that cos is a contraction, expand it in power series. Then, when you do it to cos x - cos y, you can factor the results. This gives the answer.
I remember having fun during classes in high schools by starting from a random x, computing cos(cos(...(cos(x))) and watching the sequence converge to the fixed point. I was very intrigued by that behavior
Proof that cos(x) is a contraction (by the definition in the video): |cos(x) - cos(y)| = |-2sin((x+y)/2)sin((x-y)/2))| (by the Sum-to-product identity) = 2|sin((x+y)/2)||sin((x-y)/2))| (using the modulus to make everything positive and split into separate factors) < 2 x (1) x |x-y|/2 (Max of |sin(x)| is 1 and for x > 0, x > sin(x) and hence this expression is greater than the previous expression) Hence |cos(x) - cos(y)| < |x - y|. I've seen some other proofs involving Taylor series but I believe this is the most elegant, though it did take some time to wrap my head around the inequality step but it clicks when you realise (x-y) refers to |x - y| in this context and so (x - y) > 0
This happened to me when I noticed that on an HP-48 iterating ln over anything would lead always to the same number. Then I learned that this was a numerical solution to ln x = x, which in turn led me to know Lambert's W function. :)
This reminds me of when i learned about the sinc function in my work. it blew my mind that an entire industry just divides by zero all day long, and nothing breaks. you aren't really dividing by zero with sinc, but you also kind of are. if you don't know, sinc(x) is just shorthand for sin(x)/x (the sin version of this video's function). sinc gets used a lot in RF and signal processing. sinc is defined as being equal to 1 when x is 0, and if you ask any solver to find when sinc(x) is equal to 1 (again the sin version of this video), it will tell you a number VERY close to 0, but not zero (usually 2x10^-23, or the smallest non-zero positive value you can have with a 32 bit floating point number). i suspect this video uses cos instead of sin because its avoids the weirdness of allowing division by zero and it has a more interesting answer compared to just zero.
I solved it by viewing the solution as the limit to the sequence you provided. Then if you say that the sequence converges to some x_n for which cos(x_n)=x_n, else it wouldn't be converging.
This is a good point. I was *trying* to simplify the idea so as to not have to explain the bit about the k, but choosing k=1 and making it a strict inequality isn't quite the same thing as making it k strictly less than 1. Thank you!
@@Novak2611 Def. Lipschitz function Let A be a subset of R and let f be a mapping of A on R. f is said to be a Lipschitz function if it satisfies the Lipschitz Condition: |f(x)-f(u)|
@@Novak2611 not sure what u mean by contractive function, becoz I’ve only heard of contractive sequences The proper word to be used here is probably “contraction” Again, I’m just a beginner, correct me if I’m wrong
The result is really simply explained: if cos(cos(cos(cos(cos(cos(...)))...)))=itself, then removing one cosin we get cos(itself)=itself, very satisfying.
i think there's an other preety easier way to find the limit. Let cos(cos(cos(...)))=b. Then cos(b) would also be b, so there comes the conclusion that our limit is the sollution of the equation b=cos(b)
given the theorem of engineering one could say that because cos(x) ≈ 1 that cos(1) ≈ 1 and therefore any further cosigning will not change anything about being 1
Bold guess: because cos(x) is always between 1 and -1, and cos(0)=1, it will get closer and closer to 1. But because cos(1)=0, it will be some point between 0 and 1. When x increases, cos(x) decreases and vice versa. So my guess is that the value is the solution to x=cos(x) which Wolframalpha tells is 0.739
The solution for this problem is actually simple to achieve analitically. ------------- Proof 1 (maybe not so rigorous): ------------- Let us define a = cos(cos(cos(...(cos x)))).¹ Noticing that cos(cos(cos(...(cos x)))) is an infinite nest of cos()'s, we can apply arccos() to both sides of the previous equation to get: arccos(a) = arccos(cos(cos(cos(...(cos x))))) But the right side is equal to the same infinite nest of cos()'s, as the arccos() cancels just the exterior cos(). Therefore: arccos(a) = cos(cos(...(cos x))) = a Applying cos() to both sides of this last equation yields a = cos(a). So, the value a is the (single²) solution of the equation a = cos(a). ------------- Proof 2 (more rigorous): ------------- Let xₙ be a sequence defined by x₁=x (where x∈ℝ) and xₙ=cos(xₙ₋₁) for all n≥2. Let lim xₙ = a∈ℝ.¹ Then, given that xₙ₊₁ is a subsequence of xₙ and cos() is a continuous function: a = lim xₙ = lim xₙ₊₁ = lim cos(xₙ) = cos(lim xₙ) = cos(a) So, the value a=lim xₙ is the (single²) solution of the equation a = cos(a). _______________ ¹ We probably need to prove the existance of the limit cos(cos(cos(...(cos x)))) or lim xₙ before the algebraic manipulations that follow. This can be done by showing that cos is a contraction and thus, by the Banach Fixed Point Theorem, lim xₙ exists. ² The uniqueness of the solution of a = cos(a) is garanteed by the Banach Fixed Point Theorem.
Root 2 doesn’t have a special name. Root 2 is shorthand for “the square ROOT of 2”. So it doesn’t have a name, just like the square root of pi doesn’t have a name, but you can refer to it as “root pi”. In a similar way, we can refer to 3 as “2 plus 1”, but that doesn’t mean 3 has multiple names.
I tend to agree, root 2 is not the name of the number, just the expression which evaluates to the number. Though that leads down a rabbit hole: Negative numbers don't have names, you are just specifying them as the negation of a positive number, positive rationals don't have names, you are just specifying them as the quotient of two natural numbers, natural numbers above 9 don't have names, you are just specifying the (usually) base-10 encoding which evaluates to the number, etc. You are eventually left with only 10 named numbers: 0, 1, 2, ..., 9. At certain theoretical levels, the only named number is zero, and all other natural numbers are expressed as the successor to the next-smaller number.
@@kevinmartin7760 You are correct. Most numbers don't have names; they simply have a unique notation that consists of mathematical symbols. Some numbers are named, and it tends to be numbers that have complicated notation like pi, phi, or e. root 2 is not one of them.
🚨🚨Correction!🚨🚨
1) The proper definition of a contraction is that |f(y)-f(x)|
Hi Trefor, great video! The spiral is a beautiful way to understand the Banach Fixed point theorem!
However given this definition of a contraction - namely, there is a k such that for all x,y, blah blah... - cosx is NOT a contraction!
Proof: Assume there is such a k and let y=pi/2. Then, for all x
eq y, it would be the case that |(cos(pi/2)- cosx)/(pi/2 - x)| \leq k < 1.
This is a contradiction because that LH quantity approaches 1 as x-> pi/2. QED
(Edit) If this was somewhere else in the comments I'll happily delete the comment, but I didn't see anyone else mention this.
@@td904587 Indeed. Luckily in this case we can apply the argument after the first application of cos, since now we are in [-1, 1] (and won't ever leave it) and cos is a contraction on this restricted domain
@@Quantris Good point!
So does that mean that every f has a k, the same for all x,ys, such that all x,y in whatever domain make that true or does every x,y has a k?
Also the spiral was square; is there a way for turn applicable f()s into curved spirals, perhaps archemdean(sp) or logerithmic(sp)?
@@pauljackson3491 for f to be a contraction on some domain, you need to find *one* value of k that is strictly less than 1 and works for all x,y pairs in that domain.
I learned today that if the best you can do is k = 1 then it is called "non-expansive" which is a slightly weaker condition than a contraction (and in particular you can't directly apply Banach fixed point to it)
about the spirals I have no idea but maybe there's some convention around doing something similar in polar coordinates or something? may lead to some cool pictures :)
0.739 radians is equivalent to 42 degrees. Therefore the Hitchhiker's Guide to the Galaxy was right in saying that 42 is the answer to everything.
haha nice one!
sadly, the actual solution is not actually 42 degrees, it's about 42.364 :/
@@trbz_8745 Rounding error. :)
I thought it was 24.
But the initially question was how much equals six times nine, wasn't it?
This really demonstrates just how beautiful math is. When I looked at the thumbnail I immediately thought "wow I have no idea what is it," but in hindsight the answer of cos(x) = x is incredibly intuitive. Its amazing how something so complicated can be become so simple
A lot like coding and programming
I googled what is cos x = x before watching the video, just by seeing the title. I knew that was a fixed point, and I assumed it might converge there, but wasn’t sure..
It’s the second fundamental theorem of trigonometry. We had sin(x) = x and now we have this!
At University I learned this in limerick form:
If A's a complete metric space,
And nonempty we know it's the case
That if F's a contraction
Then under its action
Just one point remains in its place
Roses are red
I like to lie in my bed
My favorite color is red
I like bread
Nevertheless, very nice limerick
xD @@The-Devils-Advocate
Every 9th grade math student has evaluated this on their scientific calculator by pressing the cos button repeatedly.
Apparently, that is exactly how Dottie (the person after whom the number is named) "discovered" it. At least that's how wikipedia explains it
its like you're spying on me during math
The point x=0.739 does have a name its called Dotties number/Dotties Constant
Oh! I knew that! How did I forget!
This is the most usefull comment. Thanks this comment completed this great video.
D'oh, I posted the same thing because I didn't see any of the top comments say this. If only I scrolled down a few more inches I'd realize I was repeating you XD;;
Amazingly, there's even an infinite series for it en.wikipedia.org/wiki/Dottie_number
"The name of the constant originates from a professor of French named Dottie who observed the number by repeatedly pressing the cosine button on her calculator." -- I did the same when I was a kid playing with the calculator. It could have been named after me ;D
It's nice to be a software engineer, but be a math enthusiast and watch those kind of videos explaining interesting behaviors. Keep up this work, it's excelent and joyful!
I remember noticing the convergence when I was 12-13 years old. I had bought my first scientific calculator and was so fascinated that I would try all the functions on it for hours. I would calculate repeated operations like this. I calculated cos(cos( .. 23 times)) and found that it converges, although I had no understanding of limits. BTW 23 was the stack size of the calculator operations and I could only repeat cos 23 times beyond which the calculator would report ‘stack error’
Holy crap! Thanks for the memory. I have an old school folder that has a few things doodled on it and one of them is a cos(cos(cos(cos(cos... equation.
Heyy same
By using ANS you can do unlimited. Also old calculators could do unlimited.
Same lmao
On older scientific calculators (without TI's AOS, Casio's V.P.A.M., or whatever), operations and functions that operated on a single operand where typed AFTER the number (similar to RPN calculators where that also applies to binary operators such as '+' and '-'), so you could just enter a number and repeatedly mash the COS key. This worked in any of the angle modes, degrees, radians, or gradians, but of course the value it converged to depended on the current angle mode.
Really interesting.
I tried doing the sin(cos(sin(cos(...))) and it has two points it jumps between, those being x1=sin(cos(x1)) and x2=cos(sin(x2)) with them obviously x1=sin(x2) and x2=cos(x1)
what is the inner function? ...sin(cos(sin(cos(???(x))))...
@@RandomGeometryDashStuff It's alternating, there isn't one.
Define g = sin • cos and then search for fix point of g
@arandomgamer3088 yes, it seems you are right.
cos(x) definitely has one of the more interesting fixed points. I decided to check some other functions, and it seem that if the graph doesn't intersect the x=y graph, then it obviously doesn't have a fixed point (ln(x) diverges to the complex plane, and e^x diverges to infinity). sin(x) has a pretty obvious fixed point of 0, but sqrt(x) and x^2 had some interesting behavior where they both have 2 fixed points at 0 and 1, but for sqrt(x), 0 is an _unstable_ fixed point, and 1 is _stable,_ while for x^2, the relation is flipped. In addition, the fixed point for x^2 is only reached if the starting point is between -1 and 1, otherwise it diverges (away from the unstable fixed point 1) towards infinity. 1/x _neither_ diverges, _nor_ converges to a fixed point, always oscillating between two values depending on the input. (-x would have the same behavior since they're both their own inverses, though both do have fixed points in the form of 1 and -1 for 1/x, and 0 for -x.) tan(x) has _infinitely many_ fixed points, including at 0, but all of them are unstable, but not necessarily diverging to infinity when not at them, instead looking like it would have a chaotic behavior.
The general case of x(n+1) = -ax(n)^2 + bx(n) + c (a, c > 0) is very intetesting. Depending on a, b and c, it has divergent, convergent, bifurcations and chaotic behavior.
Look up "This equation will change how you see the world (the logistic map)." They use x(n+1) = rx(n) (1-x(n)).
Watch:
This equation will change how you see the world (the logistic map)
ua-cam.com/video/ovJcsL7vyrk/v-deo.html
I would love to see visuals on all this work. Well done.
Interesting - Kind of makes sense that a function and it's inverse would have the opposite in terms of stable and unstable fixed points. (I vaguely remember doing something like this as university homework, and finding some (usually unstable) fixed points the other students missed because I checked for complex ones as well as real.) You say you tried 1/x, but of course the really interesting one (if you haven't seen it before) is 1 + 1/x
@@ferb1131 I smell a Phi.
Banach Fixed Point theorem is the reason for convergence in most traditional reinforcement learning algorithms and that is basically the reason for a lot of advances in robotics
oh yeah that's what a PID runs on
My favorite way to think about the theorem is that if you have a map of your town, your house or the room you're in, then there's exactly one point on the map in the same place where it is in reality. It's the kind of thing you have to discuss with a stoner at a party. "So there's a small map on the big map and another map in the small map and.. whoa dude"
@@NickiRusin Value Iteration and Policy Iteration as well.
Another thing I'd like to point out is that questions like this are classically solved with the Intermediate Value Theorem. Although Banach's fixed point theorem is nice, IVT is a much easier way to go about this one.
How do you solve this with IVT?
@@jackm.1628 so once we realize this is a question about the solution to cos(x)=x, we can then look at the function g(x)=cos(x)-x. And IVT tells us that we do indeed have a root of g(x), which is what we are looking for.
@@dackid2831 I see. But we still need Banach's Theorem to prove that ...cos(cos(x))... converges to something. And then we may be interested in solving cos(x) = x. The IVT just shows it's possible to solve cos(x) = x, but it doesn't tell us how.
@@jackm.1628 Yes, that part is certainly true. I would also like to point out Banach's doesn't tell us how to solve it either. Banach's shows us that it exists given those conditions.
In contrast, for IVT, we assume such a solution exists, and the IVT helps us confirm that.
@@dackid2831 Well Banach tells us that the sequence x_(n+1) = cos(x_n) converges to the solution, so this is one way (though perhaps not very good) to solve it.
im still trying to get my head around all of the calc sequence but it seems its true that there is always more to learn / discover. thanks for videos like these it helps to reinvigorate a desire for learning math.
Your average high school student has gotten bored in class and decided to do cos(ans) on the calculator 1000 times to see what happens
Banach fixed point theorem is also related to the Picard-Lindelof theorem and determining the existence of the solution for the cauchy problem y' = f(x,y)
Indeed!
I’m not sure if this is a valid argument but I think you could also recognize: if there are infinitely many cos
x = cos(cos(…cos(z)…))
Then removing one cos gives the same expression. Or said differently, the inner term is the same as the whole term (independent of z) so:
x = cos(x)
and we instantly arrive at the same conclusion.
Yes, if you know it converges then this tells you the answer, but you wouldn’t know it converges
@@DrTrefor are there any counterexamples? i.e, an incorrect solution is obtained because the series does not converge?
@@shashanksistla5400 Consider the equation x^x^x^x...=2, you can use this technique to say x^2=2, x=sqrt(2), done. However, if I ask what is x^x^x^x...=3, then this technique fails. This is because the function x^x^x^x...only converges when e^-e < x < e^(1/e). More explanation here: ua-cam.com/video/xaBhTU01vsA/v-deo.html
@@yuefenggao7483 excellent counterexample👍
@@yuefenggao7483 thank you that was nice to learn
Wow! That's a really cool result, and you made it so easy to understand. Thanks for the awesome content!
Nice presentation. I took a more practical approach to get a decimal approximation for the limit.
If the limit exists and is L.
Then L=cos(cos(...))
So L=cos(L)
With a graphing calculator: L is approx 0.74
This method shows what the limit must be IF it exists, but you don’t know anything about whether it exists or not
What I tried is:
Cos( Cos( Cos( ... Cos( Cos(x) ) ... ) = y
Cos(y) = y
0 < y < Cos(1)
This was exactly my first thought. Pretty straightforward, although the video provides loads of insights.
When I was a kid. I used to play with scientific calculator. I like to see numbers converge by pressing "cos" over and over. It was no fun in "deg" and "grad" mode though.
Me too. I wondered for years what that mysterious result was. Then I read up on chaos theory, where it was described in the introduction as "Picard's method."
This is great. I’m learning about fixed point iteration recently in my numerical algorithm course, and I always have a hard time picturing these process in my head. The spiral graph is a really helpful perspective!
Great video! I remember 3b1b did a video on fixed points where he was looking at f(x) = 1 + 1/x which has two fixed points (phi and -1/phi). If you iterate f on any point except -1/phi and 0 then you'll converge to phi, and the reason boils down to |f'(phi)| < 1 and |f'(-1/phi)| > 1. I notice that the definition of contraction |f(y) - f(x)| < |y - x| would imply |f'(x)| < 1 everywhere.
Indeed! See pinned comment for more info:)
What’s phi, is it the same as pi?
@@Kero-zc5tc it is known as golden ratio.
Thanks
Interesting, I hadn't thought of recursion in this light. Obvious in hindsight. Weird how the different deffintions of "function" aline... The question is how this works in generalized 'Space' ! :)
This is the first time ever I have subscribed to a channel after watching just one podcast.
if you start with an angle in radiant you reach 0.7391, if you start with an angle in degree you will reach 0.9998.
i tested it in matlab:
clear all; close all; clc
it=1000000;
prompt = 'Input a starting angle ';
x = input(prompt);
for l = 1:it
x=cosd(x); %x in degree
% x=cos(x); %x in radiant
end
disp(x)
While this is true, degrees are a completely arbitrary measure of angle. There is no internal mathematical point of reference that makes it sensible. Radians, on the other hand, describe the length of the arc at the unit radius. While degrees may fit better with common experience, mathematically they don't make a lot of sense.
Fun Fact: There's an application of the derivative of a function f at its fixed point x*, and its that it tells us how fast we approach our fixed point by reiterating f around x*.
In this case, we have the derivative of cosine evaluated at x* ≈ 0.739, so we get -sin(x*) ≈ -sin(0.739) ≈ -0.674. What this tells us is if we take some value x near x* ≈ 0.739, say x = 0.75, then the distance from f(x) to x* will be about -0.674 times the distance from x to x*. Written as an equation, we have f(x) - x* ≈ f'(x*)(x - x*). And plugging in f(x) = cos(x), x* ≈ 0.739, and x = 0.75 we see that this is true, as we get cos(0.75) - 0.739 ≈ -sin(0.739) (0.75 - 0.739), which gives −0.007396 ≈ −0.007352.
f(x) - x* ≈ f'(x*)(x - x*) also lets us approximate cosine in terms of x and x* well if x is close to x*. I won't write out the work but approximating cos(0.74) with the equation should have an error less than a millionth!
I love to hear the logic and see the analysis. It is much more emotionally and intellectually satisfying than the "10-second graphing calculator solution". You can probably tell from my comment that I'm an old geezer, a retired community college math instructor.
My first though was that this is like an eigenvalue, that is to say x st x = f(x), for f(x) = cos(x) because when this is true, the whole cos(cos(cos(...cos(x) sequence collapses. I'm not sure how you find it, other than iteratively. What was interesting was trying this on a calculator, I saw it oscillate around the final value with smaller and smaller amplitude.
It's a very strange coincidence that you are posting this video at this time, because I just accidentally rediscovered the Dottie Number last semester. I was studying Advanced Electromagnetics, and I came across cos(cos(x)) somewhere. I was curious about what the plot looked like, so I entered it into Desmos, and then I plotted cos(cos(cos(x))) and cos(cos(cos(cos(x)))) and so on, and I noticed that every iteration made the plot look more and more like a horizontal line, i.e. a constant. I did some digging and found that the constant had already been discovered, and was named the Dottie Number.
Thinking this through:
Always contractions
- Sin (0)
- arctan (0)
- arccot (.86ish)
- cos (.739ish)
- e^-x (.567ish)
Conditionally contractions:
- csc (1.114 within 2.773-pi/4 of pi/2)
Never contractions:
- arcsec (becomes undefined within 3 iterations)
- arccsc (increases until becoming undefined, except at x=arccsc(x)=1.1ish)
- tan (chaotic)
- cot (chaotic)
- sec (chaotic)
- arcsin (range increases until undefined, except at 0)
- arccos (range increases until undefined, except at .937ish)
- logarithms (always become undefined)
- e^x (increases to infinity)
The so call Fixed point method to find the root of equations...nice vid, thanx!
Wow. This video appeared in my feed and I browsed the channel. I m really elated to see something like this made by someone so passionate.
Much appreciated. 🔥
I'll tell about this channel to my friends as well.
Such a gem should get more subscribers.
Thanks so much!
Mathematics teachers are like: HMM THIS IS AN INTERESTING ONE. IT WILL BE A BASIC QUESTION ON YOUR EXAM
Lol everyone with a scientific calculator in high school ended up finding this...
That spiral visual is super helpful. Thanks!
I like how intuitive the answer cos(x) = x is when you think about it (if you assume that the sequence does in fact converge). Because whatever number x it converges to, it must be true that applying cos to x one more time will give you back x - if it gave you anything else, then evidently the sequence doesn't converge to x, but to this other number. So it must be true that cos of the answer is equal to the answer itself --> cos(x) = x.
This video is providing a great demonstration of the Banach fixed point theorem.
But the video didn't emphasize on, how immensely important this theorem truly is.
But to be also honest, I for myself simply cannot stretch enough, how immensely important the Banach fixed point theorem really is.
From this theorem basically follows the theorems for inverse functions, the existence and uniqueness of differential equations and basically any numerical approximations and alternative methods like finding the roots of a function with the Newton-method.
So basically, what I'm getting at, that ALL modern and current science is basically reliant on the results from this theorem and what it can provide and has already provided.
it's the first time I see your channel here and it's always good to find some great youtube math videos. Most of math videos on youtube are about people who dont know math trying to clickbait saying like "1+2+...=-1/12". The math channels I knew were good were 3b1b and Mathologer, and apparentely yours too. Well, it's just a suggestion, I'm a olympiad student from Brazil and I would love to see videos about olympiad math problems, like IMO or maybe something a bit easier. There are some beautiful problems which dont require much of a basis like combinatoric ones, and I bet everyome should love it. Thanks for the content!
7:06 Thats is not the definition of a contraction mapping , as stated the theorem would be false.
you could also take a more algerbraic approach as well, for example,
let y=cos(cos(cos(......
then you would get y=cos(y)
by replacing the "cos(cos(...." with y
and since y is just some arbitary constant like x then we arrive to the same conclusion in the video :)
True, that works IF you know it converges, but how do you know that is true?
A neat way to find a converging iteration method for the solution to the equation.
Just like for infinite continuous fractions x=a/(b+a/(b+a/(b+...))) is just like saying x=a/(b+x) and guessing x1 gives x2=a/(b+x1) etc. which is such a neat way of calculating square roots from a formula instead of the long division style method!
sqrt(n) = a + b/(2a+b/(2a+...) where b=n-a^2
OK I know this gives increasingly large denominators in fractions and the long division method sorts out the decimal places in the square root which is so much easier than dividing big numbers in fractions.
One equation I was trying to find a solution to using iteration didn't work because some iterations took the next value further from the solution than the previous, and it didn't converge. Some take ages to converge. Your x = cos x is a good example. I tried putting in x1=0.73 on Excel to see how many iterations it takes to get the solution to 15 decimal places: 81 iterations! A bit longer than I expected.
I was just curious to see what the solution was in terms of pi, because it is in units of radians. OK it's 0.235258...pi radians, not an obviously special number.
Maybe naming numbers after people is not as good as giving them a number that is easier to remember like maybe the 'cozzy number' because it comes after reapeating cos(x) many times!
f(x) = cos(ln(x)!) Does not converge under repeated applications. It starts to, gets to about the 6th decimal place uniformly decreasing, then starts bouncing back up... then slowly eases back down, and bounces back up. The closer it gets to converging the farther up it bounces.
Method to reach answer by rearranging:
Using BFPT to show limit exists, then cos(cos(…x)) = L => acos(cos(cos(…x))) = acos(L) => cos(cos(…x)) = acos(L), hence L = acos(L) => cos(L) = L => L = 0.7…
f(x) = 2 + x - arctan x, satisfies the definition of a contraction in the video, but doesn't have a fixed point. (See wiki for definition of a contraction.) Great video though! Nice explanation of the spiral geometric view!
Ah true. I tried to simplify the idea for the viewers and ignore saying it was less than k|y-x| for some k
For a fixed point to be a solution, the slope of the tangent by that fixed point must be less than 1. If you start with exactly pi/2 you will not converge towards the Dottie number. Solving it with a computer can lead to the solution eventually due to machine epsilon inaccuracies.
You could skip steps just by saying
Cos(cos(cos…(x))) = y
Then because of the self similarity you can say that
Cos(y)=y
Which lands you on that same forumula without the spiraling
True, but this only works if you know it converges!
MASSIVE thank you for the calculus playlists! Great interesting video making my love for math become stronger
You are most welcome!!
I started off thinking I had no idea how to even start something like this but feeling like there was something familiar about this. As the video progressed, I realized the problem as stated is just the relaxation method for solving the equation cos(x) = x, an incredibly useful albeit somewhat slapdash way of solving non-linear equations that I've studied in a physical computing class.
In Banach Theorem at 8:40 is broken bracket (in sequence x_n=f(...))
After watching the solution of spiraling into the convergence point by bouncing between y = cos(x) and y = x, I felt like there ought to be a graphical way of seeing whether any arbitrary function will converge recursively.
After a lot of fiddling, I think I've figured out that a function will recursively converge if:
1. y = f(x) crosses y = x
2. The closest point at which f(x) = x (the two graphs cross) has a slope with absolute value less than 1 ( |f'(x)| < 1 at f(x) = x )
I figured out point 2 from their definition that it is a convergent function if |f(y) - f(x)| < |y-x|
Also, you can use f(x) = x to find the solution if it converges
Here are some examples of playing with this:
Using this methodology, you can see that sqrt(2)^sqrt(2)^sqrt(2) ... = 2. If you use the graphical method (have some starting point other than the convergent point and draw lines) and start from the left, you will approach (2,2) from the left, and sqrt(2)^x has slope less than 1 at x=2, so it converges. However, if you use the graphical method and approach from the right, you approach x = 4 ( sqrt(2)^x = x at both 2 and 4 ), and sqrt(2)^x has slope greater than 1 at that point, so you will actually diverge if you approach from the right (bounce farther and farther away from the convergence point, getting bigger and bigger numbers). I believe there are many such functions that will converge from one direction, but not the other.
If you have functions symmetric about y = x, such that the slope where it crosses y = x is -1, then you will neither converge or diverge because using the graphical method will draw a rectangle rather than a spiral. Examples are y = 2-x, y = 1/x, and y = sqrt(2-x^2). In all these cases, 1 is a convergent solution for f(x) = x, but if you use the graphical method, you will trace a box over and over again, indicating that you will never actually get closer to the convergent point if you don't start there from the beginning.
1/x neither converges nor diverges (it draws a box), 1/sqrt(x) converges, and 1/x^2 diverges (the graphical method gets you farther and farther away), even though starting with the point (1,1) gives you a convergent solution for all of them.
You can also play with lines. If f(x) = 1-x, it will neither converge nor diverge, since doing the recursion will give you 1 + 1 - 1 + 1 ... . If you use f(x) = 1 - 0.5x, that has slope less than 1 and you will converge, because it will produce the series 1 - 1/2 + 1/4 - 1/8 ... = 2/3. If you use f(x) = 1 - 2x, you will diverge, because the recursion produces 1 - 2 + 4 - 8 ... (although it doesn't exactly converge to a stable point, using 1/(1-r) says it averages 1/3). Using f(x) = 2x -1 will even more obviously diverge, since you will get the series -1 - 2 - 4 - 8 ... .
I’ve been down this rabbit hole before. Glad to see it in a video.
I remember back in Calc 1 we had to differentiate sin(sin(sin(sin(sin(sin(sin(sin(sin(sin(sin(sin(x)))))))))); it makes a beautiful triangle if you put each factor on its own line and right align everything. This gave me flashbacks. Good video
Oh my, that is quite the exercise of the chain rule!
Yeah. My professor reallyyy wanted to emphasize the "chain rule is like peeling an onion" analogy. So he created that monstrosity
Thank you. You saved my life. I really appreciate your efforts.
At first I didn't understand the spiralling but when I tinkered it with pen copy for sometime and understood it was just amazing how they boiled down that iteration to such an intuitive visual spiral.
The y=x line for intuition is brilliant!
It is really beautiful, but I didn’t quite get it :/
I feel Bad Why I was unaware of such Great UA-cam Channel.Maths is love to me and This Guy Is Just awesome
i would just said: let L= cos(cos(cos...(x), then L = cos(L), which gives a direct solution. however, your proof shows geometrically where this number comes from, and that's what i love about it
That’s a good method IF you know it converges
in physics, for small angle approximations you can approximate sin x = x and cos x = x
Cos x is about 1 I think for small x
@@DrTrefor correct
I mixed up the two
Closely related problem
Let
x_0 = 1
x_1= tan (x_0)
x_n = tan( x_n-1)
Set {x_0 , x_1,..., x_n,...} is dense in reals. That Fekete's conjecture. Prove it! 😁
Note that you can find the approximate value of Cos(x) = x by considering the Taylor series of Cos(x) = 1 - x^2/2 + O(x^4), such that we now consider the roots of 1 - x^2/2 = x, implying that x \approx \sqrt{3} - 1 using the quadratic formula. This value corresponds to around 0.73205.
a fun heuristic that you can look at to "guess" the answer is that you set a=cos(cos(cos(...))) and notice that inside the first cos you have a again so you get a=cos(a), not very rigorous but still pretty cool
remember trying something like that when I first got a calculator that had trig stuff on it. Just kept hitting the "COS" button over and over (also tried the "!" button over&over and it overflowed, the "SIN" button over&over and it went to zero, etc...)
Assume the infinite expression, call it C(x), has value y. Taking the cos of both sides of y = C(x) leaves the RHS unchanged, so cos(y) = C(x) = y and y = cos(y) -> y = 0.739.
random dude: why u even made this vid?
Trefor: just cos
I am currently learning Bellman Operators in Reinforcement learning and this idea of contraction operator is also there. I presume this theorem is used in some way to find the solutions of the recursive bellman expectation equations.
Think I found an easier way to solve this one without using graphical intuition.
Say we set the value of cos(cos(cos... to n.
cos(cos(cos... = n
Applying a cosine to both sides of the equation will not change the value of the expression on the left, because it is infinitely long, and infinity plus 1 is still just infinity.
cos(cos(cos... = cos(n)
Now, understanding the transitive property of equality, we can deduce that
cos(n) = n
Since there is only one real number that satisfies this equation, we know exactly what n equals, and so we know what cos(cos(cos(cos... equals.
n ≈ 0.739...
This gives you the answer if you already k own it converges
me: tries to sleep after studying some trig*
my brain: *_WHAT IS COS(COS(COS(COS(COS(COS(COS...)_*
Very nice video really enjoyed it! I’m glad that Jerrod Smith referred me to this channel!
cos(x) = x just makes sense outta the get go since you could really look at nested cosines as a recursively defined function which cos(x) = x satisfies as plugging and substituting would give you cos(cos(x)) = x which is then just cos(cos(cos(cos(x))) = x and so forth and so on until infinity.
Is it necessary to have any fixed point at all? Let f(x)=0.5*(x+sqrt(x^2+4)). Which is just one branch of a hyperbola where y=0 and y=x are asymptotes. This function satisfies |f(y)-f(x)| < |y-x|. But it doesn't have a fixed point since y=x is just a asymptote line.
Check out the pinned comment. I slightly misstated the definition of a contraction in a way that allows your example.
Call the infinite set of cosine functions A. We can take the cosine of A once and still have an infinite number of cosines, so cos(A)=A. Therefore, A is the solution to cos(x)=x.
My way of doing it:
Let cos(cos(cos... = k.
then cos (k) = k, since the thing inside the first cosine is the replica of itself
Then find the k that works and that's the sum for me
That works IF you know the limit exists
I nominate to name the constant the 🅱️ emoji for Banach. You're welcome Math community.
Problem with the word "until" : 05:13 .. "This spiral is going to keep on spiralling closer and closer and closer" until it starts to converge .. wait, what? (*) At what point exactly does it "start to converge" ?
Really enjoyed this video. Thanks for posting. Liked and subbed!
Prime example of a question I’ve never thought of.
Could you use the same intuition for any repeated function? This should exhibit the same properties for any convex periodic function, ie converging to one value where f(x) = x
As long as the function has the contraction property yes!
Trig function spam is the spawn of the beautifully weird graphs of math
I'm not sure why you did what you did at 1:33 on the graph. Why did you depict 1 and -1 on the x-axis instead of the y-axis?
got it !
If you needed to explain why you get to x=cos(x) to someone very quickly you could say this.
if you let A = cos(cos(cos(cos(....
then you could rewrite A as
A = cos(A), because after the first cos you still have an infinites cosines, which are still equal to A.
Or, alternatively, you can hit a rectangle that is not contracting further. A bifurcation, that splits the solution into two alternating roots y=f(x) and x = f(y).
Its pretty easy to spot that if it does indeed converge to a fixed value it must be the value where the output doesnt change per itteration which is only cosx=x, just like the itterative sequence approaching phi doesnt change with an input of phi, or any other such thing. cool little quicky problem tho:)
One way to prove that cos is a contraction, expand it in power series. Then, when you do it to cos x - cos y, you can factor the results. This gives the answer.
Kudos for the Banach fixed point theorem
I remember having fun during classes in high schools by starting from a random x, computing cos(cos(...(cos(x))) and watching the sequence converge to the fixed point. I was very intrigued by that behavior
Contraction Mapping Theorem just sounds so much cooler than Banach Fixed Point Theorem
Thank you very much for the video! That was very good to visualize ehat I just learned at university :)
Proof that cos(x) is a contraction (by the definition in the video):
|cos(x) - cos(y)|
= |-2sin((x+y)/2)sin((x-y)/2))| (by the Sum-to-product identity)
= 2|sin((x+y)/2)||sin((x-y)/2))| (using the modulus to make everything positive and split into separate factors)
< 2 x (1) x |x-y|/2 (Max of |sin(x)| is 1 and for x > 0, x > sin(x) and hence this expression is greater than the previous expression)
Hence |cos(x) - cos(y)| < |x - y|.
I've seen some other proofs involving Taylor series but I believe this is the most elegant, though it did take some time to wrap my head around the inequality step but it clicks when you realise (x-y) refers to |x - y| in this context and so (x - y) > 0
This happened to me when I noticed that on an HP-48 iterating ln over anything would lead always to the same number. Then I learned that this was a numerical solution to ln x = x, which in turn led me to know Lambert's W function. :)
This reminds me of when i learned about the sinc function in my work. it blew my mind that an entire industry just divides by zero all day long, and nothing breaks. you aren't really dividing by zero with sinc, but you also kind of are. if you don't know, sinc(x) is just shorthand for sin(x)/x (the sin version of this video's function). sinc gets used a lot in RF and signal processing. sinc is defined as being equal to 1 when x is 0, and if you ask any solver to find when sinc(x) is equal to 1 (again the sin version of this video), it will tell you a number VERY close to 0, but not zero (usually 2x10^-23, or the smallest non-zero positive value you can have with a 32 bit floating point number).
i suspect this video uses cos instead of sin because its avoids the weirdness of allowing division by zero and it has a more interesting answer compared to just zero.
I solved it by viewing the solution as the limit to the sequence you provided. Then if you say that the sequence converges to some x_n for which cos(x_n)=x_n, else it wouldn't be converging.
Clementino likes this content
I think there's a problem with your definition of contraction, it should be |f(x)-f(y)|
This is a good point. I was *trying* to simplify the idea so as to not have to explain the bit about the k, but choosing k=1 and making it a strict inequality isn't quite the same thing as making it k strictly less than 1. Thank you!
I think there’s something called Lipschitz criterion… not sure if it’s related to this
@@makJeff The result in the video is still true if one replaces "contraction" by "contractive".
@@Novak2611 Def. Lipschitz function
Let A be a subset of R and let f be a mapping of A on R. f is said to be a Lipschitz function if it satisfies the Lipschitz Condition:
|f(x)-f(u)|
@@Novak2611 not sure what u mean by contractive function, becoz I’ve only heard of contractive sequences
The proper word to be used here is probably “contraction”
Again, I’m just a beginner, correct me if I’m wrong
The result is really simply explained: if cos(cos(cos(cos(cos(cos(...)))...)))=itself, then removing one cosin we get cos(itself)=itself, very satisfying.
i think there's an other preety easier way to find the limit. Let cos(cos(cos(...)))=b. Then cos(b) would also be b, so there comes the conclusion that our limit is the sollution of the equation b=cos(b)
Click on 5:00 it's easier. 10 seconds and you can close the video
given the theorem of engineering one could say that because cos(x) ≈ 1 that cos(1) ≈ 1 and therefore any further cosigning will not change anything about being 1
Lol at theorem of engineering, love that
Bold guess: because cos(x) is always between 1 and -1, and cos(0)=1, it will get closer and closer to 1. But because cos(1)=0, it will be some point between 0 and 1. When x increases, cos(x) decreases and vice versa. So my guess is that the value is the solution to x=cos(x) which Wolframalpha tells is 0.739
The solution for this problem is actually simple to achieve analitically.
-------------
Proof 1 (maybe not so rigorous):
-------------
Let us define a = cos(cos(cos(...(cos x)))).¹ Noticing that cos(cos(cos(...(cos x)))) is an infinite nest of cos()'s, we can apply arccos() to both sides of the previous equation to get:
arccos(a) = arccos(cos(cos(cos(...(cos x)))))
But the right side is equal to the same infinite nest of cos()'s, as the arccos() cancels just the exterior cos(). Therefore:
arccos(a) = cos(cos(...(cos x))) = a
Applying cos() to both sides of this last equation yields a = cos(a). So, the value a is the (single²) solution of the equation a = cos(a).
-------------
Proof 2 (more rigorous):
-------------
Let xₙ be a sequence defined by x₁=x (where x∈ℝ) and xₙ=cos(xₙ₋₁) for all n≥2. Let lim xₙ = a∈ℝ.¹ Then, given that xₙ₊₁ is a subsequence of xₙ and cos() is a continuous function:
a = lim xₙ = lim xₙ₊₁ = lim cos(xₙ) = cos(lim xₙ) = cos(a)
So, the value a=lim xₙ is the (single²) solution of the equation a = cos(a).
_______________
¹ We probably need to prove the existance of the limit cos(cos(cos(...(cos x)))) or lim xₙ before the algebraic manipulations that follow. This can be done by showing that cos is a contraction and thus, by the Banach Fixed Point Theorem, lim xₙ exists.
² The uniqueness of the solution of a = cos(a) is garanteed by the Banach Fixed Point Theorem.
Root 2 doesn’t have a special name. Root 2 is shorthand for “the square ROOT of 2”. So it doesn’t have a name, just like the square root of pi doesn’t have a name, but you can refer to it as “root pi”. In a similar way, we can refer to 3 as “2 plus 1”, but that doesn’t mean 3 has multiple names.
I tend to agree, root 2 is not the name of the number, just the expression which evaluates to the number.
Though that leads down a rabbit hole: Negative numbers don't have names, you are just specifying them as the negation of a positive number, positive rationals don't have names, you are just specifying them as the quotient of two natural numbers, natural numbers above 9 don't have names, you are just specifying the (usually) base-10 encoding which evaluates to the number, etc. You are eventually left with only 10 named numbers: 0, 1, 2, ..., 9. At certain theoretical levels, the only named number is zero, and all other natural numbers are expressed as the successor to the next-smaller number.
@@kevinmartin7760 You are correct. Most numbers don't have names; they simply have a unique notation that consists of mathematical symbols. Some numbers are named, and it tends to be numbers that have complicated notation like pi, phi, or e. root 2 is not one of them.