Stats Arcade Portal Forum FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read
 Zelaron Gaming Forum Look out man, 5-0!

 Look out man, 5-0!
 Posted 2020-07-18, 06:21 PM print(*[round((((5**0+5**.5)*.5)**O-((5**0+5**-.5)*.5)**O)*5**-.5) for O in range(0,50)]) Obviously you could do a lot worse in terms of obfuscation, but I like how that one-liner turned out anyway. What's your favorite obfuscated and/or confusing code? "Stephen Wolfram is the creator of Mathematica and is widely regarded as the most important innovator in scientific and technical computing today." - Stephen Wolfram
 Profile PM WWW Search
Chruser

Posted 2020-07-19, 06:55 PM in reply to Chruser's post "Look out man, 5-0!"
Chruser said: [Goto]
 print(*[round((((5**0+5**.5)*.5)**O-((5**0+5**-.5)*.5)**O)*5**-.5) for O in range(0,50)]) Obviously you could do a lot worse in terms of obfuscation, but I like how that one-liner turned out anyway. What's your favorite obfuscated and/or confusing code?
Not at all what I expected. Then I looked closer at your statement and discovered all the golden ratios. Always knew that the ratio of successive terms in the fibonacci sequence tended to the golden ratio, but didn't realize that you could actually generate fibonacci terms that way. Pretty cool.
 Profile PM WWW Search
Demosthenes

Posted 2020-07-20, 12:08 PM in reply to Demosthenes's post starting "Not at all what I expected. Then I..."
Demosthenes said: [Goto]
 Not at all what I expected. Then I looked closer at your statement and discovered all the golden ratios. Always knew that the ratio of successive terms in the fibonacci sequence tended to the golden ratio, but didn't realize that you could actually generate fibonacci terms that way. Pretty cool.

I'm glad you liked it! Yes, linear recurrence relations like $\reverse a_n = c_1 a_{n-1} + c_2 a_{n-2} + \dots + c_n a_{n-k}$ lend themselves well to explicit solutions by the transformation $\reverse a_n = r^n$, but to be fair, there aren't really that many examples of them of order $\reverse \ge 2$ that are interesting. Nonlinear ones, such as the logistic map $\reverse a_n = ra_n(1-a_n),$ become very interesting and intractable very quickly, though:

Personally, I think the weird connections between recurrence relations, differential equations, generating functions and derivatives are particularly fascinating. For example, the Legendre polynomials $\reverse P_n(x)$ (which have a very large number of applications in physics, probability theory, etc) can be defined in either of the following four ways:

1. In terms of a recurrence relation (with $\reverse P_0(x) = 1,\,P_1(x) = x$):

$\reverse (n+1) P_{n+1}(x) = (2n+1) x P_n(x) - n P_{n-1}(x)$

2. In terms of n-th derivatives:

$\reverse P_n(x) = \frac{1}{2^n n!} \frac{\mathrm{d}^n}{\mathrm{d}x^n} \left(x^2 -1\right)^n$

3. As coefficients of a series expansion (from electrostatics):

$\reverse \frac{1}{\sqrt{1-2xt+t^2}} = \sum_{n=0}^\infty P_n(x) t^n$

4. As polynomial solutions of an ordinary differential equation (which you get from solving Laplace's equation in spherical coordinates):

$\reverse (1-x^2)y''(x) - 2xy'(x) + n(n+1)y(x) = 0$

If you play around with various polynomial sequences for a while (particularly orthogonal sequences), it becomes "obvious" that there's some sort of space or operator that connects all of the above. In other words, it's a bit like there "has to be" some algorithm to convert a differential equation to a recurrence relation, or vice versa, but the general theory for that is very poorly understood.

Also, as a cool sidenote, you can use the zeros $\reverse x_1,\,x_2,\,\dots,\,x_n$ of the n-th Legendre polynomial $\reverse P_n(x)$ for numerical integration of many "nice" functions $\reverse f(x)$:

$\reverse \int_{-1}^{1} f(x)\,\mathrm{d}x \approx \sum_{k=1}^{n} \frac{2f(x_k)}{(1-x_k^2)(P'_n(x_k))^2}$

Gauss himself came up with that one, obviously...
"Stephen Wolfram is the creator of Mathematica and is widely regarded as the most important innovator in scientific and technical computing today." - Stephen Wolfram
 Profile PM WWW Search
Chruser

 Posted 2020-07-23, 04:52 PM in reply to Chruser's post starting "I'm glad you liked it! Yes, linear..." I guess I should have referred to one of my recent posts as well, on the topic of the golden ratio $\reverse \varphi$... $\reverse \int_{-1}^{1}\frac{1}{x}\sqrt{\frac{1+x}{1-x}}\ln\left(\frac{2x^2+2x+1}{2x^2-2x+1}\right)\,\mathrm{d}x = 4\pi\mathrm{arccot}\sqrt{\varphi}$ "Stephen Wolfram is the creator of Mathematica and is widely regarded as the most important innovator in scientific and technical computing today." - Stephen Wolfram
 Profile PM WWW Search
Chruser

 Posted 2020-08-26, 06:31 AM in reply to Chruser's post starting "I guess I should have referred to one..." Apparently I managed to find a new (?) series for the n-th Fibonacci number somehow, which looks surprisingly terrible: Presumably the summand can be simplified further, but I'm not seeing any obvious way of doing it. "Stephen Wolfram is the creator of Mathematica and is widely regarded as the most important innovator in scientific and technical computing today." - Stephen Wolfram
 Profile PM WWW Search
Chruser

 Bookmarks

 Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 Thread Tools Display Modes Linear Mode

 Posting Rules [Forum Rules] You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home The Zelaron Nexus     Forum News, Suggestions and Discussion         Test Forum             RSS News     The Lounge         World Record Thread     General Discussion         News and Events         Life Discussion         Opinion and Debate     Science and Art         Tech Help         Science and Technology News         Principia Mathematica     The Anime Corner Zelaron Gaming     General Gaming         Deus Ex: Human Revolution     DayZ     Diablo III         Diablo I & II             Diablo Cube             D2 PvP             D2 Marketplace     RPGMaker

 Similar Threads Thread Thread Starter Forum Replies Last Post Willkillforfood Opinion and Debate 40 2008-07-13 12:56 PM Raziel General Gaming 2 2004-06-07 03:02 AM

All times are GMT -6. The time now is 08:46 AM.
 -- Synthesis 2 (Original Blue) -- Synthesis 2 (Lava Ashes) -- Synthesis 2 (Liquid Violet) -- Ocean -- Zephios -- HUD Revision 'Synthesis 2' vBulletin 3.x styles and 'x79' derivative by WetWired the Unbound and Chruser Copyright ©2002-2008 zelaron.com