Here I want to share a numerical method of approximating the roots of the equation \(x^y\) = \(y^x\) = \(k\), where \(k\) is a real number, \(k>1\).
Interestingly I came upon it while playing with a scientific calculator two years ago, and later on I proved the algorithm, and wrote the code for it. I discovered this entirely by accident, I had not even wanted to do this. I just saw something and realized that 'this' might work for something like 'this'. To know what the two 'this' refer to, read ahead.
Here is my claim.
We define a sequence \(a_{i}\) such that \(a_{i}\)=\(k^{1/a_{i1}}\) , and \(a_{1}\)=\(k^{1/m}\) where m is any positive real number. Now we go on evaluating the terms of the sequence. Let us take the odd numbered terms to be a subsequence \(M\), and the even numbered terms to be a subsequence \(T\). Then my claim is that,
The subsequence \(M\) is convergent, and so is the subsequence \(T\) and if their limits are \(z\) and \(g\) respectively, then \((z,g)\) and \((g,z)\) are solutions to our equation.
And here goes the proof:
\(P\) = \(a_{1}\) = \(k^{1/m}\), and \(b_{j+1}\) = \(k^{1/b_{j1}}\) for all j in \(N\) ( \(N\) is the set of all natural numbers.) and m is any positive real number. (domain of m is \((0,∞)\) )
Let us take the two subsequences { \(a_{1}\) , \(a_{3}\), \(a_{5}\) …… } and { \(a_{2}\), \(a_{4}\), \(a_{6}\), ….. } that is the subsequences formed by the odd numbered terms and that formed by the even numbered terms respectively.
Let the sequence formed by the odd numbered terms be M and the sequence formed by the even numbered terms be T.
Now we express \(a_{n+2}\) in terms of \(a_{n}\) . By definition,
\(a_{n+2}\) = \(k^{1/a_{n+1}}\) =\(k^{1/{k^{1/a_{n}}}}\) __ \((1)\)
Our first observation is that the two subsequences that I have considered are both bounded below by \(0\) and above by \(k\) itself.
The lower bound is easy to observe because we know that the exponential function \(a^x\) is positive for all real \(x\) and positive \(a\). And our sequence is of the exponential form only. So \(0\) is indeed a lower bound.
Now we can establish the validity of \(k\) as an upper bound by the method of contradiction.
Let us assume that the sequence \(P\) contains a number which is greater than \(k\) itself. i.e. \(a_{h}\) = \(v>k\) for some \(h\) in \(N\).
But \(a_{h}\) = \(k^{1/{a_{h1}}}\) = \(v\) necessary implies that \(a_{h1}\) is less than \(1\) and greater than \(0\) i.e. \(1/{a_{h1}}\) is greater than \(1\), and \(k^{1/{a_{h1}}}\) is greater than \(k\). All this holds if \(a_{h1}\) is less than \(1\). But again
\(a_{h1}\) = \(k^{1/{a_{h2}}}\) . Now if we take logarithm to the base \(k\) on both sides ,
then on L.H.S. we get something negative as \(a_{h1}\) belongs to \((0,1)\) by assumption and \(k\) is greater than \(1\) (domain of k is \((1,∞)\) ) but on R.H.S we have \(1/{a_{h2}}\) which is positive because \(a_{h2}\) is positive as the lower bound of the sequence {\(a_{1}\), \(a_{2}\), \(a_{3}\), ….} is 0. Thus a negative number on the L.H.S is equal to a positive number on the R.H.S by assumption that \(a_{h}>k\) for some natural number \(h\).
So we have a direct contradiction if \(a_{h}>k\) for some natural number \(h\), therefore this assumption must be false. So the negation of this statement must be true. That is ‘\(a_{h}<k\) for all natural numbers \(h\).’ So we have established that \(k\) itself is an upper bound.
Our second aim is to prove that these two subsequences are monotonic.
Let us consider the subsequence M={ \(a_{1}\), \(a_{3}\), \(a_{5}\), .......} and we take \(M_{1}\) = \(a_{1}\) , \(M_{2}\) = \(a_{3}\), \(M_{3}\) = \(a_{5}\), and in general \(M_{k}\) = \(a_{2k1}\) for all \(k\) in \(N\).
We know by order property (Law of Trichotomy) ‘Given two reals \(a\) and \(b\), either \(a=b\), or \(a>b\), or \(a<b\).’ Here we observe that \(M_{n}\) is not equal to \(M_{n+1}\) for any natural number \(n\), because of the relation between two consecutive terms of the sequence { \(a_{1}\), \(a_{3}\), \(a_{5}\), …. } derived in \((1)\) above.
So \(M_{1}>M_{2}\) or \(M_{2}>M_{1}\):
Case I:
\(M_{1}>M_{2}\) i.e. \(a_{1}>a_{3}\) . Next we proceed by the principle of mathematical induction to show that \(M_{n}>M_{n+1}\) for all natural numbers \(n\). In fact we have already checked the first step for \(n=1\).
Next we assume the validity of the statement to hold true for some \(n=k\). i.e. \(M_{k}>M_{k+1}\) or \(a_{m}>a_{m+2}\) (where obviously \(m={2k1}\)
Now
\(M_{k}>M_{k+1}\)
\(a_{m}>a_{m+2}\)
\(1/{a_{m}}\) < \(1/{a_{m+2}}\) [reciprocating the positive numbers reverses the sign of inequality]
\(k^{1/{a_{m}}}\) < \(k^{1/{a_{m+2}}}\)
\(1/{k^{1/{a_{m}}}}\) > \(1/{k^{1/{a_{m+2}}}}\) [reciprocating the positive numbers reverses the sign of inequality]
\(k^{1/{k^{1/{a_{m}}}}}\) > \(k^{1/{k^{1/{a_{m}}}}}\)
\(a_{m+2}\)>\(a_{m+4}\) (by the relation derived in \((1)\) )
i.e.
\(M_{k+1}\) > \(M_{k+2}\)
So we have \(M_{1}\) > \(M_{2}\) and \(M_{k}\) > \(M_{k+1}\) implies \(M_{k+1}\) > \(M_{k+2}\) for all natural numbers \(k\).
So \(M\) is a strictly decreasing monotone sequence.
Having established that we also see that \(M_{1}\) > \(M_{2}\) i.e. \(a_{1}\) > \(a_{3}\) implies that
\(1/{a_{1}}\) < \(1/{a_{3}}\)
\(k^{1/{a_{1}}}\) < \(k^{1/{a_{3}}}\)
\(a_{2}\) < \(a_{4}\)
Therefore \(a_{1}\)>\(a_{3}\) implies that \(a_{2}\) < \(a_{4}\) . If we consider the subsequence \(T\) consisting of { \(a_{2}\), \(a_{4}\), \(a_{6}\), ….. } then we have \(a_{2}\) < \(a_{4}\) i.e. \(T_{1}\) < \(T_{2}\) . By a similar inductive argument as above we can see that
\(T\) is a strictly increasing monotone sequence.
It is to be noted that the conclusions drawn above are under the heading of [ Case I: ]
Case II:
\(M_{1}\) < \(M_{2}\) . Under this consideration we proceed exactly as in Case I: and prove that
\(M\) is a strictly increasing monotone sequence.
And on the same lines as in Case I: we have that
\(T\) is a strictly decreasing monotone sequence.
In both the cases which are mutually exhaustive we see that \(M\) and \(T\) are monotone sequences of the opposite nature, i.e. if one is increasing the other is decreasing.
Also \(M\) and \(T\) are subsequences of a sequence \(P\) which is bounded as a whole with \(0\) as a lower bound and \(k\) as an upper bound.
So \(M\) and \(T\) themselves are also bounded with \(0\) as a lower bound for both and \(k\) as an upper bound for both.
So from 1, 2 and 3 we see that M and T are both monotonic and bounded.
By the MonotoneConvergence theorem, ‘Any monotonic bounded sequence has a finite limit.’
Since the sequences \(M\) and \(T\) meet the requirements of the theorem, they are convergent and have a finite limit. Let the limit of \(M_{n}\) as \(n\) tends to \(∞\) be \(z\) and the limit of \(T_{n}\) as \(n\) tends to \(∞\) be \(g\).
Now we note that as \(n\) tends to infinity the terms of the sequence \(P\) = { \(a_{1}\), \(a_{2}\), \(a_{3}\),….. } take the limiting values \(z\) and \(g\) alternatively because these are the limits of the odd numbered subsequence and the even numbered subsequence respectively which have alternate terms occurring in \(P\).
That is as \(n\) tends to infinity the sequence \(P\) takes limiting values \(z\) and \(g\) alternately i.e. \(z\), \(g\), \(z\), \(g\), \(z\), \(g\), \(z\), \(g\), \(z\), \(g\), ……….. But we have defined the function as { \(a_{n}\) = \(k^{1/{a_{n1}}}\) }. So as \(n\) tends to infinity we have successive values coming as \(z\) = \(k^{1/g}\) and the next term as \(g\) = \(k^{1/z}\).
From the above two equations we get \(g^z=k\) and \(z^g=k\). So we can say that \((z,g)\) is a solution to the equation \(x^y\) = \(y^x\) = \(k\).
Hence Proved.
When I was playing about with this, the first value I got this on was 3. So I have displayed the code for k=3 below. Interestingly for \(3\) the two convergence values \(z\) and \(g\) are so close by that they seem to be identical. As a result it also gives the result for \(x^x=3\). In fact it actually gives two different values which are very close by, hence it seems that they are equal.Interesting, huh?
For those interested here is the code in Python and the output with it. You are welcome to copy paste it and test it with your own values.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 

[and the output of the program is]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 

Also I have started with the 12th root of 59 here just to demonstrate that it does not matter what value of \(m\) we are choosing at the beginning.
P.S. Please leave your comments and feedback for improvement.
Comments
Sort by:
Top Newest@Soumava Pal I made a small change to fix the formatting. Can you check the code to see if there is something you want to edit out? – Agnishom Chattopadhyay · 9 months, 2 weeks ago
Log in to reply
@Agnishom Chattopadhyay Thanks for pointing it out, I did not even notice. I have pasted the code for a wrong hypothesis here. I am modifying it immediately. This is the last code I have written. Do tell me if it is all right now. – Soumava Pal · 9 months, 2 weeks ago
Log in to reply
By the way, thanks for sharing your work. This is Brilliant. (Pun intended with genuine appreciation) – Agnishom Chattopadhyay · 9 months, 2 weeks ago
Log in to reply
P.S. Could you please tell me how to include code in replies and solutions? So far all I have done is to give ideone links. Because everytime I include code, the indentations don't come properly, till I have used a new line between every other line.
Log in to reply
Here is the full reference – Agnishom Chattopadhyay · 9 months, 2 weeks ago
Log in to reply
– Soumava Pal · 9 months, 2 weeks ago
Thanks a lot!Log in to reply
@Otto Bretscher Please help me out here.
This algorithm relies on the fact that \(x \mapsto k^{k^{\frac{1}{x}}}$\) is a contraction for k > 1
How do I show this (in an alternate way)? – Agnishom Chattopadhyay · 9 months, 1 week ago
Log in to reply
@Otto Bretscher – Agnishom Chattopadhyay · 9 months, 1 week ago
Log in to reply
Magnificent work! – Nihar Mahajan · 9 months, 1 week ago
Log in to reply
– Soumava Pal · 9 months, 1 week ago
Thanks. XDLog in to reply
@Soumava Pal that is great! ... BTW how did you exactly get this idea? – Abhinav Raichur · 9 months, 2 weeks ago
Log in to reply
@Abhinav Raichur As I said, I was playing with the calculator, precisely I was doing the following steps over and over again:
In this way I got to this observation. Though at first I thought it would be the solution to \(x^x=k\) because I was taking small values of k, the convergence values were very close. But as I went on taking larger values they alternated. I had to modify my observation. I only found a proof to this last year, and have discussed it with many important people before publishing it here.
– Soumava Pal · 9 months, 2 weeks agoLog in to reply
– Abhinav Raichur · 9 months, 2 weeks ago
That is great use of the calculator ... all I used to do is force the calculator to stack error :p .. +1 for patiently developing a rigorous proof .. and yes!, waiting for your next note :)Log in to reply
@Abhinav Raichur Good to know. It will be some time before I can publish my next note because my board exams for the 12th are from March 1st, and I need to get decent marks in Chemistry and Physics. Also I need to consult some more before publishing that note. Meanwhile, Thanks for your support. – Soumava Pal · 9 months, 2 weeks ago
Log in to reply
– Abhinav Raichur · 9 months, 2 weeks ago
just to share my experience, I used to press a lot of nested sines ( i.e. sin(sin(sin(...)) ) and the answer was always near to zero... till my tenth grade I would remember sine as the function that returned zero if you'd press it lot times .... then came trigonometry :)Log in to reply
@Abhinav Raichur Well then I would suggest you to proceed along those lines further, because the button I used to press repeatedly on my calculator for my other observation that I mentioned has something to do with Trigonometry. Go ahead with it. – Soumava Pal · 9 months, 2 weeks ago
Log in to reply
– Abhinav Raichur · 9 months, 2 weeks ago
Well there is already a theorem in ergodic theory for that .. and I also convinced that fact myself by drawing graphsLog in to reply
– Soumava Pal · 9 months, 2 weeks ago
I too convinced myself by drawing graphs. I don't know what ergodic theory is, but I have seen a proof for the sin(sin(sin.... (x))))..)) and that of cos(cos(cos(.....(x)))...)) having the property that they both converge on repeated composition. However my function differs a little from these two in the fact that it uses multiple trigonometric functions and it's convergence value is also the value given by a trigonometric function.Log in to reply
– Abhinav Raichur · 9 months, 2 weeks ago
Interesting ... looking forward for that note ... bye :)Log in to reply
– Soumava Pal · 9 months, 2 weeks ago
Thanks, bye. :)Log in to reply