What is cos( cos( cos( cos( cos( cos( cos( cos( cos( cos( cos( cos(…?? // Banach Fixed Point Theorem

Поділитися
Вставка
  • Опубліковано 19 гру 2024

КОМЕНТАРІ • 631

  • @DrTrefor
    @DrTrefor  2 роки тому +747

    🚨🚨Correction!🚨🚨
    1) The proper definition of a contraction is that |f(y)-f(x)|

    • @td904587
      @td904587 2 роки тому +12

      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.

    • @Quantris
      @Quantris 2 роки тому +14

      @@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

    • @td904587
      @td904587 2 роки тому +3

      @@Quantris Good point!

    • @pauljackson3491
      @pauljackson3491 2 роки тому

      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)?

    • @Quantris
      @Quantris 2 роки тому +2

      @@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 :)

  • @jameshenner5831
    @jameshenner5831 2 роки тому +3565

    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.

    • @DrTrefor
      @DrTrefor  2 роки тому +533

      haha nice one!

    • @trbz_8745
      @trbz_8745 2 роки тому +193

      sadly, the actual solution is not actually 42 degrees, it's about 42.364 :/

    • @PlutoTheSecond
      @PlutoTheSecond 2 роки тому +342

      @@trbz_8745 Rounding error. :)

    • @Kurtlane
      @Kurtlane 2 роки тому +6

      I thought it was 24.

    • @berndstange-gruneberg9898
      @berndstange-gruneberg9898 2 роки тому +12

      But the initially question was how much equals six times nine, wasn't it?

  • @ronanshanley7829
    @ronanshanley7829 2 роки тому +801

    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

    • @FritzMusicFoReal
      @FritzMusicFoReal 2 роки тому +7

      A lot like coding and programming

    • @MarcLucksch
      @MarcLucksch 2 роки тому +10

      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..

    • @Deupey445
      @Deupey445 Рік тому +3

      It’s the second fundamental theorem of trigonometry. We had sin(x) = x and now we have this!

  • @zygoloid
    @zygoloid 2 роки тому +281

    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

    • @The-Devils-Advocate
      @The-Devils-Advocate 2 роки тому +10

      Roses are red
      I like to lie in my bed
      My favorite color is red
      I like bread
      Nevertheless, very nice limerick

    • @isobaric
      @isobaric 11 місяців тому

      xD @@The-Devils-Advocate

  • @jessstuart7495
    @jessstuart7495 2 роки тому +238

    Every 9th grade math student has evaluated this on their scientific calculator by pressing the cos button repeatedly.

    • @itsalongday
      @itsalongday 2 роки тому +26

      Apparently, that is exactly how Dottie (the person after whom the number is named) "discovered" it. At least that's how wikipedia explains it

    • @hemish1
      @hemish1 2 роки тому +5

      its like you're spying on me during math

  • @mihirsanghvi9876
    @mihirsanghvi9876 2 роки тому +758

    The point x=0.739 does have a name its called Dotties number/Dotties Constant

    • @DrTrefor
      @DrTrefor  2 роки тому +281

      Oh! I knew that! How did I forget!

    • @collegemathematics6698
      @collegemathematics6698 2 роки тому +44

      This is the most usefull comment. Thanks this comment completed this great video.

    • @mme725
      @mme725 2 роки тому +13

      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;;

    • @scathiebaby
      @scathiebaby 2 роки тому +9

      Amazingly, there's even an infinite series for it en.wikipedia.org/wiki/Dottie_number

    • @scathiebaby
      @scathiebaby 2 роки тому +35

      "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

  • @RedPardo
    @RedPardo 2 роки тому +94

    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!

  • @manpreet9766
    @manpreet9766 2 роки тому +118

    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’

    • @GynxShinx
      @GynxShinx 2 роки тому +9

      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.

    • @itismethatguy
      @itismethatguy Рік тому +2

      Heyy same

    • @okaro6595
      @okaro6595 Рік тому +2

      By using ANS you can do unlimited. Also old calculators could do unlimited.

    • @darkzonegaming9169
      @darkzonegaming9169 Рік тому

      Same lmao

    • @ijabbott63
      @ijabbott63 Рік тому

      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.

  • @tipoima
    @tipoima 2 роки тому +100

    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)

    • @RandomGeometryDashStuff
      @RandomGeometryDashStuff Рік тому

      what is the inner function? ...sin(cos(sin(cos(???(x))))...

    • @tipoima
      @tipoima Рік тому +6

      @@RandomGeometryDashStuff It's alternating, there isn't one.

    • @lpi3
      @lpi3 Рік тому

      Define g = sin • cos and then search for fix point of g

    • @lpi3
      @lpi3 11 місяців тому

      @arandomgamer3088 yes, it seems you are right.

  • @angeldude101
    @angeldude101 2 роки тому +111

    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.

    • @Kurtlane
      @Kurtlane 2 роки тому +8

      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)).

    • @Kurtlane
      @Kurtlane 2 роки тому +1

      Watch:
      This equation will change how you see the world (the logistic map)
      ua-cam.com/video/ovJcsL7vyrk/v-deo.html

    • @Xonatron
      @Xonatron 2 роки тому +1

      I would love to see visuals on all this work. Well done.

    • @ferb1131
      @ferb1131 2 роки тому +3

      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

    • @scathiebaby
      @scathiebaby 2 роки тому +1

      @@ferb1131 I smell a Phi.

  • @covidiotseverywhere2179
    @covidiotseverywhere2179 Рік тому +28

    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

    • @NickiRusin
      @NickiRusin Рік тому

      oh yeah that's what a PID runs on

    • @Kalumbatsch
      @Kalumbatsch Рік тому +3

      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"

    • @covidiotseverywhere2179
      @covidiotseverywhere2179 Рік тому

      @@NickiRusin Value Iteration and Policy Iteration as well.

  • @dackid2831
    @dackid2831 2 роки тому +48

    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
      @jackm.1628 2 роки тому

      How do you solve this with IVT?

    • @dackid2831
      @dackid2831 2 роки тому +5

      @@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.

    • @jackm.1628
      @jackm.1628 2 роки тому +2

      @@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.

    • @dackid2831
      @dackid2831 2 роки тому +3

      @@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.

    • @jackm.1628
      @jackm.1628 2 роки тому +1

      @@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.

  • @JHaas117
    @JHaas117 2 роки тому +32

    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.

  • @jorgelenny47
    @jorgelenny47 2 роки тому +11

    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

  • @francescoghizzo
    @francescoghizzo 2 роки тому +26

    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)

  • @ngruhn
    @ngruhn 2 роки тому +57

    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.

    • @DrTrefor
      @DrTrefor  2 роки тому +35

      Yes, if you know it converges then this tells you the answer, but you wouldn’t know it converges

    • @shashanksistla5400
      @shashanksistla5400 2 роки тому +3

      @@DrTrefor are there any counterexamples? i.e, an incorrect solution is obtained because the series does not converge?

    • @yuefenggao7483
      @yuefenggao7483 2 роки тому +50

      @@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

    • @poundcayx
      @poundcayx 2 роки тому +7

      @@yuefenggao7483 excellent counterexample👍

    • @shashanksistla5400
      @shashanksistla5400 2 роки тому +2

      @@yuefenggao7483 thank you that was nice to learn

  • @gabenuss3063
    @gabenuss3063 2 роки тому +5

    Wow! That's a really cool result, and you made it so easy to understand. Thanks for the awesome content!

  • @henrytang2203
    @henrytang2203 2 роки тому +4

    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

    • @DrTrefor
      @DrTrefor  2 роки тому +6

      This method shows what the limit must be IF it exists, but you don’t know anything about whether it exists or not

  • @pilotomeuepiculiares3017
    @pilotomeuepiculiares3017 2 роки тому +7

    What I tried is:
    Cos( Cos( Cos( ... Cos( Cos(x) ) ... ) = y
    Cos(y) = y
    0 < y < Cos(1)

    • @bobnewell7888
      @bobnewell7888 2 роки тому +1

      This was exactly my first thought. Pretty straightforward, although the video provides loads of insights.

  • @cipherxen2
    @cipherxen2 2 роки тому +16

    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.

    • @Kurtlane
      @Kurtlane 2 роки тому

      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."

  • @aquilazyy1125
    @aquilazyy1125 2 роки тому +4

    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!

  • @johnchessant3012
    @johnchessant3012 2 роки тому +21

    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.

    • @DrTrefor
      @DrTrefor  2 роки тому +5

      Indeed! See pinned comment for more info:)

    • @Kero-zc5tc
      @Kero-zc5tc Рік тому

      What’s phi, is it the same as pi?

    • @oo_rahbel_oo
      @oo_rahbel_oo Рік тому

      @@Kero-zc5tc it is known as golden ratio.

    • @Kero-zc5tc
      @Kero-zc5tc Рік тому +1

      Thanks

  • @carly09et
    @carly09et 2 роки тому +15

    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' ! :)

  • @zdikbiodr7341
    @zdikbiodr7341 2 роки тому +1

    This is the first time ever I have subscribed to a channel after watching just one podcast.

  • @94psy
    @94psy 2 роки тому +1

    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)

    • @phoenixshade3
      @phoenixshade3 Рік тому

      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.

  • @fantiscious
    @fantiscious Рік тому +2

    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!

  • @fredrussell5539
    @fredrussell5539 2 роки тому +1

    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.

  • @ianboard544
    @ianboard544 2 роки тому +4

    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.

  • @nathanielkilmer5022
    @nathanielkilmer5022 2 роки тому +13

    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.

  • @0xEmmy
    @0xEmmy 2 роки тому

    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)

  • @franciscojavierramirezaren4722
    @franciscojavierramirezaren4722 2 роки тому +2

    The so call Fixed point method to find the root of equations...nice vid, thanx!

  • @adityamrai3892
    @adityamrai3892 2 роки тому +2

    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.

  • @petarniciforovic6543
    @petarniciforovic6543 2 роки тому +2

    Mathematics teachers are like: HMM THIS IS AN INTERESTING ONE. IT WILL BE A BASIC QUESTION ON YOUR EXAM

  • @teslapower220
    @teslapower220 2 роки тому +2

    Lol everyone with a scientific calculator in high school ended up finding this...

  • @stvp68
    @stvp68 2 роки тому +2

    That spiral visual is super helpful. Thanks!

  • @udgeyjudge4289
    @udgeyjudge4289 Рік тому +1

    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.

  • @zsoltnagy5654
    @zsoltnagy5654 2 роки тому +2

    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.

  • @felipegiglio2047
    @felipegiglio2047 2 роки тому +1

    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!

  • @deepthakur14916
    @deepthakur14916 2 роки тому +1

    7:06 Thats is not the definition of a contraction mapping , as stated the theorem would be false.

  • @derekkim5520
    @derekkim5520 2 роки тому +1

    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 :)

    • @DrTrefor
      @DrTrefor  2 роки тому +1

      True, that works IF you know it converges, but how do you know that is true?

  • @yahccs1
    @yahccs1 2 роки тому +1

    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!

  • @Wouldyoukindly4545
    @Wouldyoukindly4545 2 роки тому +1

    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.

  • @JonnyPowell
    @JonnyPowell 2 роки тому

    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…

  • @Robert-jy9jm
    @Robert-jy9jm 2 роки тому +6

    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!

    • @DrTrefor
      @DrTrefor  2 роки тому +2

      Ah true. I tried to simplify the idea for the viewers and ignore saying it was less than k|y-x| for some k

  • @Bollibompa
    @Bollibompa Рік тому

    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.

  • @toddmcknight9989
    @toddmcknight9989 2 роки тому +1

    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

    • @DrTrefor
      @DrTrefor  2 роки тому +1

      True, but this only works if you know it converges!

  • @drmonty6823
    @drmonty6823 2 роки тому +2

    MASSIVE thank you for the calculus playlists! Great interesting video making my love for math become stronger

    • @DrTrefor
      @DrTrefor  2 роки тому +1

      You are most welcome!!

  • @allanjmcpherson
    @allanjmcpherson 2 роки тому

    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.

  • @staswisniewski4101
    @staswisniewski4101 2 роки тому

    In Banach Theorem at 8:40 is broken bracket (in sequence x_n=f(...))

  • @brendangolledge8312
    @brendangolledge8312 2 роки тому

    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 ... .

  • @brockobama257
    @brockobama257 2 роки тому +1

    I’ve been down this rabbit hole before. Glad to see it in a video.

  • @zachpence8283
    @zachpence8283 2 роки тому +2

    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

    • @DrTrefor
      @DrTrefor  2 роки тому +1

      Oh my, that is quite the exercise of the chain rule!

    • @zachpence8283
      @zachpence8283 2 роки тому

      Yeah. My professor reallyyy wanted to emphasize the "chain rule is like peeling an onion" analogy. So he created that monstrosity

  • @muxammadrizo3643
    @muxammadrizo3643 2 роки тому +1

    Thank you. You saved my life. I really appreciate your efforts.

  • @bidish2224
    @bidish2224 2 роки тому

    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.

  • @imranq9241
    @imranq9241 2 роки тому +1

    The y=x line for intuition is brilliant!

    • @vladimirshitov2160
      @vladimirshitov2160 2 роки тому

      It is really beautiful, but I didn’t quite get it :/

  • @tarunbalchandbhaimulchanda6929
    @tarunbalchandbhaimulchanda6929 2 роки тому +1

    I feel Bad Why I was unaware of such Great UA-cam Channel.Maths is love to me and This Guy Is Just awesome

  • @francescfloresgamez657
    @francescfloresgamez657 2 роки тому +1

    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

    • @DrTrefor
      @DrTrefor  2 роки тому +2

      That’s a good method IF you know it converges

  • @rooksman64
    @rooksman64 2 роки тому +1

    in physics, for small angle approximations you can approximate sin x = x and cos x = x

    • @DrTrefor
      @DrTrefor  2 роки тому +1

      Cos x is about 1 I think for small x

    • @rooksman64
      @rooksman64 2 роки тому

      @@DrTrefor correct
      I mixed up the two

  • @imeprezime1285
    @imeprezime1285 2 роки тому +1

    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! 😁

  • @josephelmes2165
    @josephelmes2165 2 роки тому

    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.

  • @zo1o281
    @zo1o281 6 місяців тому

    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

  • @bledlbledlbledl
    @bledlbledlbledl 2 роки тому +3

    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...)

  • @padraiggluck2980
    @padraiggluck2980 Рік тому

    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.

  • @headecas
    @headecas 2 роки тому +1

    random dude: why u even made this vid?
    Trefor: just cos

  • @anotherrandomguy1297
    @anotherrandomguy1297 2 роки тому +4

    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.

  • @Bismvth
    @Bismvth 2 роки тому +1

    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...

    • @DrTrefor
      @DrTrefor  2 роки тому +1

      This gives you the answer if you already k own it converges

  • @nobivy3524
    @nobivy3524 2 роки тому

    me: tries to sleep after studying some trig*
    my brain: *_WHAT IS COS(COS(COS(COS(COS(COS(COS...)_*

  • @2meganestor
    @2meganestor 2 роки тому +1

    Very nice video really enjoyed it! I’m glad that Jerrod Smith referred me to this channel!

  • @freeshavaacadooo1095
    @freeshavaacadooo1095 2 роки тому

    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.

  • @28aminoacids
    @28aminoacids 2 роки тому +2

    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.

    • @DrTrefor
      @DrTrefor  2 роки тому +2

      Check out the pinned comment. I slightly misstated the definition of a contraction in a way that allows your example.

  • @PentagonalSquid
    @PentagonalSquid 2 роки тому

    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.

  • @habukichan
    @habukichan 2 роки тому +1

    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

    • @DrTrefor
      @DrTrefor  2 роки тому +1

      That works IF you know the limit exists

  • @BboyKeny
    @BboyKeny 2 роки тому +4

    I nominate to name the constant the 🅱️ emoji for Banach. You're welcome Math community.

  • @frentz7
    @frentz7 2 роки тому

    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" ?

  • @chessandmathguy
    @chessandmathguy 2 роки тому +1

    Really enjoyed this video. Thanks for posting. Liked and subbed!

  • @DoiInthanon1897
    @DoiInthanon1897 2 роки тому

    Prime example of a question I’ve never thought of.

  • @imranq9241
    @imranq9241 2 роки тому +2

    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

    • @DrTrefor
      @DrTrefor  2 роки тому +2

      As long as the function has the contraction property yes!

  • @legate7158
    @legate7158 2 роки тому

    Trig function spam is the spawn of the beautifully weird graphs of math

  • @rezapourbahreini4473
    @rezapourbahreini4473 2 роки тому

    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?

  • @edwardspence5361
    @edwardspence5361 2 роки тому

    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.

  • @acoral1035
    @acoral1035 2 роки тому

    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).

  • @monkerud2108
    @monkerud2108 2 роки тому

    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:)

  • @brothberg
    @brothberg 2 роки тому

    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.

  • @AlFasGD
    @AlFasGD 2 роки тому

    Kudos for the Banach fixed point theorem

  • @hach1koko
    @hach1koko Рік тому

    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

  • @isobaric
    @isobaric 11 місяців тому

    Contraction Mapping Theorem just sounds so much cooler than Banach Fixed Point Theorem

  • @ft6637
    @ft6637 2 роки тому +1

    Thank you very much for the video! That was very good to visualize ehat I just learned at university :)

  • @squeezy8414
    @squeezy8414 Рік тому

    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

  • @nihil1
    @nihil1 Рік тому

    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. :)

  • @Gunbudder
    @Gunbudder 2 роки тому

    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.

  • @taektiek526
    @taektiek526 Рік тому

    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.

  • @badrumfra
    @badrumfra 2 роки тому +1

    Clementino likes this content

  • @Novak2611
    @Novak2611 2 роки тому +37

    I think there's a problem with your definition of contraction, it should be |f(x)-f(y)|

    • @DrTrefor
      @DrTrefor  2 роки тому +28

      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!

    • @makJeff
      @makJeff 2 роки тому +3

      I think there’s something called Lipschitz criterion… not sure if it’s related to this

    • @Novak2611
      @Novak2611 2 роки тому

      @@makJeff The result in the video is still true if one replaces "contraction" by "contractive".

    • @makJeff
      @makJeff 2 роки тому

      @@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)|

    • @makJeff
      @makJeff 2 роки тому

      @@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

  • @jackys_handle
    @jackys_handle 2 роки тому

    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.

  • @spock8505
    @spock8505 2 роки тому

    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)

  • @munkustrap79
    @munkustrap79 2 роки тому

    Click on 5:00 it's easier. 10 seconds and you can close the video

  • @WralthChardiceVideo
    @WralthChardiceVideo 2 роки тому +1

    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

    • @DrTrefor
      @DrTrefor  2 роки тому +2

      Lol at theorem of engineering, love that

  • @Henrix1998
    @Henrix1998 2 роки тому

    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

  • @navilistener
    @navilistener 2 роки тому

    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.

  • @Dziaji
    @Dziaji 2 роки тому +1

    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.

    • @kevinmartin7760
      @kevinmartin7760 2 роки тому

      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.

    • @Dziaji
      @Dziaji 2 роки тому

      @@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.