Player (36)
Joined: 9/11/2004
Posts: 2631
I was looking into continued fractions, and I found this OEIS wiki page on the subject. It lists the basic continued fraction [0, 1, 2, 3, 4, 5]... as I_1(2)/I_0(2) where I_n is the modified Bessel Function of the 1st kind. This is the last place I expected to see the Bessel function crop up. Any insight on why this is? I have been unable to find a proof.
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
How would you calculate evenly-spaced points on an x2 parabola?
Player (36)
Joined: 9/11/2004
Posts: 2631
This one is actually pretty easy. The arc length of a curve from x in range [a,b] is given by Integral from a to b of sqrt(1 + (dy/dx)^2) dx In the case of the parabola the antiderivative of this actually does have a closed form: integral sqrt(1 + ((dx^2)/(dx))^2) dx = 1/4 (2 sqrt(4 x^2 + 1) x + sinh^(-1)(2 x)) + constant However, this function does not seem to be invertible. So, you would need to approximate it to model it and calculate the evenly spaced points.
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
It's actually for a hobby project of mine. I'm trying to move along an x2 curve at constant speed (or, more precisely, I need points along the curve that are at equal distances from each other measured by the curve's length), but for the life of me I can't figure out a function for this. I suppose the only way is to approximate by recursively subdividing and measuring distances along straight lines. That's a bit surprising. One wouldn't think of x2 to be that complicated.
Editor, Expert player (2080)
Joined: 6/15/2005
Posts: 3284
OmnipotentEntity wrote:
I was looking into continued fractions, and I found this OEIS wiki page on the subject. It lists the basic continued fraction [0, 1, 2, 3, 4, 5]... as I_1(2)/I_0(2) where I_n is the modified Bessel Function of the 1st kind. This is the last place I expected to see the Bessel function crop up. Any insight on why this is? I have been unable to find a proof.
This page should explain why. Unfortunately it is somewhat complicated and I can't really say any more on the topic.
Warp wrote:
I suppose the only way is to approximate by recursively subdividing and measuring distances along straight lines. That's a bit surprising. One wouldn't think of x2 to be that complicated.
Arclength is complicated in most cases. I don't think there is a way to express inverse of arclength of x2 in elementary functions. Would giving a Taylor series instead be acceptable?
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
An approximation would be enough for the purpose. (Although in this particular case the approximation probably needs to be accurate to a quite numerous amount of decimal places. At least 10-12 decimals. Not that it's absolutely critical, but would be good.)
Player (36)
Joined: 9/11/2004
Posts: 2631
More important is on what domain you want it to converge on. A Taylor series will only be accurate around a point, and will get less and less accurate around other points. Further, I think that there might be a radius of convergence with this particular function (because the coefficients seem to be increasing with each iteration). Meaning it doesn't matter how many terms you use, you won't get good estimates outside of a certain interval. The Taylor series around x=0 is x-(2 x^3)/3+(26 x^5)/15-(1972 x^7)/315+O[x]^9, which is only accurate in the domain -0.5 < x < 0.5
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
I only need the values in the range x=[-1, 1] (which of course means that y is in the range [0, 1]). Since the curve is symmetric, the range x=[0, 1] would be enough, of course, but since the polynomial is also symmetric I think it doesn't make much of a difference.
Player (36)
Joined: 9/11/2004
Posts: 2631
If you need to perform a walk in the range [-1, 1] on the original f(x) = x^2 function, then unfortunately you'll need to find a piecewise estimate to this function. For clarity, the arclength from 0 to 1 along the parabola is approx 1.47894285754... Meaning you need convergence on the domain [0, 1.47894285754...] for the inverse function in order to go from arclength traveled to x coordinate. The radius of convergence of the Taylor series is almost certainly smaller than this value, so piecewise is the only way.
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Editor, Expert player (2080)
Joined: 6/15/2005
Posts: 3284
If you only need a few points (as in, ~10 to 1000 or so, not billions) on the curve y=x2 that are equally spaced by arclength, you can just use Newton's Method. In this case: xi+1 = xi - (f(xi)-C)/f'(xi), where f(x) = (1/2)*x*sqrt(4x2 + 1) + (1/4)*sinh-1(2x), f'(x) = sqrt(4x2 + 1), and C ranges from 0 to 1.48 (or whatever) with step-size 0.01 (or whatever). The initial value x0 can be anything reasonably close, e.g. x0=sqrt(C). Five or six iterations of Newton's Method should be enough to converge to 15 decimal places. Edit: For example, if you let C range from 0.1 to 1.5 with step-size 0.1, the values of the coordinates would be:
C=0.1: (0.099350065839962, 0.009870435582405)
C=0.2: (0.195152616534278, 0.038084543740175)
C=0.3: (0.285211741156551, 0.081345737293551)
C=0.4: (0.368852487493289, 0.136052157529987)
C=0.5: (0.446333885517591, 0.199213937361230)
C=0.6: (0.518289499949421, 0.268624005757821)
C=0.7: (0.585422381047103, 0.342719364230860)
C=0.8: (0.648381539258784, 0.420398620451590)
C=0.9: (0.707726446643927, 0.500876723279239)
C=1.0: (0.763926663317091, 0.583583946926784)
C=1.1: (0.817372952208352, 0.668098543001797)
C=1.2: (0.868390542005625, 0.754102133444823)
C=1.3: (0.917251279891076, 0.841349910461818)
C=1.4: (0.964183813251466, 0.929650425736138)
C=1.5: (1.009381811139016, 1.018851640658280)
Mitjitsu
He/Him
Banned User
Joined: 4/24/2006
Posts: 2997
Have a fun puzzle for you people to try. I'm not too interested if you get the right answer, but more how you arrived at it. Personally, I think I lucked into the right answer when I did it earlier but here goes. There is seven items, each with a fictional value attached to it. You must determine the weights; put them all on a scale and get them to balance. You don't know the weights of any item are but you know that... B is twice as heavy as A C is twice as heavy as B Y is as heavy as B + X Z is as heavy as A + B + X X + Y is as heavy as B + Z D is as heavy as A + Z
Active player (500)
Joined: 11/19/2007
Posts: 128
An easy one that I can actually do =) Call the weights a,b,c,d,x,y,z. The information is just a system of linear equations in these variables. Since there is one more variable than equations (7 vs 6), at least one variable must be free to vary (in fact only one, since the equations are independent). So you can solve for everything in terms of a, e.g. b = 2a, c = 2b = 4a etc. Putting a=1 at the end you get a=1, b=2, c=4, d=7, x=3, y=5, z=6. The sum of these values is 1+2+3+4+5+6+7 = 28, so each side of the scale needs to sum to 14. There are several ways of doing this, e.g. 7+6+1 = 2+3+4+5, which corresponds to weighing A D Z against B C X Y.
Player (80)
Joined: 8/5/2007
Posts: 865
I also did this problem but waited to see if anyone else wanted to chime in first. Like NxCy, I recognized that this is a (slightly underdetermined) system of simultaneous equations. I chose to use the substitution method. I've pasted my work below; dashed lines indicate a substitution has taken place while blank lines separate equations that already have an isolated variable: B=2A C=2B Y=B+X Z=A+B+X X+Y=B+Z D=A+Z --- C=4A Y=2A+X Z=3A+X X+Y=2A+Z D=A+Z --- Z=A+Y 2Y=4A+Z --- Y=5A Z=6A D=7A C=4A X=3A B=2A So I agree with NxCy.
Mitjitsu
He/Him
Banned User
Joined: 4/24/2006
Posts: 2997
I knew the solution was likely to be something similar to Bobo's. My method was largely based on guesswork and logical deduction. For a start I knew the values were going to be in some form of linear progression. After all, how are you supposed to make the equation balance out when you don't actually know any of the values? I knew A had to be the lightest so I assigned a value of 1 to it. That meant B had to be 2 and C had to be 4. Then I knew D had to be the heaviest so I assigned a value of 7 to it, which meant Z would have to be 6. Using that I could figure out X was 3, Y was 5. Meaning that A+B+C+D = X+Y+Z Not a particularly scientific method, as it was largely based on bold assumptions. I don't think it would have worked too well on a more complex example.
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
FractalFusion wrote:
f(x) = (1/2)*x*sqrt(4x2 + 1) + (1/4)*sinh-1(2x), f'(x) = sqrt(4x2 + 1)
The second expression is the derivative of the first one? That seems surprising.
JorWat25
He/Him
Player (18)
Joined: 1/15/2015
Posts: 79
Location: United Kingdom
Warp wrote:
FractalFusion wrote:
f(x) = (1/2)*x*sqrt(4x2 + 1) + (1/4)*sinh-1(2x), f'(x) = sqrt(4x2 + 1)
The second expression is the derivative of the first one? That seems surprising.
It does seem odd, but it's true.
Player (36)
Joined: 9/11/2004
Posts: 2631
Warp wrote:
FractalFusion wrote:
f(x) = (1/2)*x*sqrt(4x2 + 1) + (1/4)*sinh-1(2x), f'(x) = sqrt(4x2 + 1)
The second expression is the derivative of the first one? That seems surprising.
My very first post was taking the anti-derivative of sqrt(4x2 + 1) and getting (1/2)*x*sqrt(4x2 + 1) + (1/4)*sinh-1(2x). Just remarking that it didn't seem surprising to you then. ;)
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
Is the same true for any possible replacement for sqrt(4x2 + 1), or does it have to be precisely that?
Player (36)
Joined: 9/11/2004
Posts: 2631
I'm not sure what you're asking.
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Editor, Expert player (2080)
Joined: 6/15/2005
Posts: 3284
Warp wrote:
Is the same true for any possible replacement for sqrt(4x2 + 1), or does it have to be precisely that?
If you're asking whether the antiderivative of sqrt(a+bx2) is similar, the answer is yes. By integration of parts (int means integral/antiderivative): int(sqrt(a+bx2)) = x*sqrt(a+bx2) - int(bx^2/sqrt(a+bx2) = x*sqrt(a+bx2) - ( int(sqrt(a+bx2)) - int(a/sqrt(a+bx2)) ) So 2*int(sqrt(a+bx2)) = x*sqrt(a+bx2) + int(a/sqrt(a+bx2)) int(sqrt(a+bx2)) = (1/2)*x*sqrt(a+bx2) + (a/2)*int(1/sqrt(a+bx2)) So you just have to find the antiderivative of 1/sqrt(a+bx2) and that is: ● (1/sqrt(b))*sinh-1(sqrt(b/a)x) if a>0, b>0, ● (1/sqrt(-b))*sin-1(sqrt(-b/a)x) if a>0, b<0, ● (1/sqrt(b))*cosh-1(sqrt(-b/a)x) if a<0, b>0. (After this, add a constant C at the end.)
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
OmnipotentEntity wrote:
I'm not sure what you're asking.
The derivative of "(1/2)*x*sqrt(4x2 + 1) + (1/4)*sinh-1(2x)" is "sqrt(4x2 + 1)". The derivative is repeated exactly in the original function. Does that mean you could replace it with anything in the original function, and get it as the derivative of that function, or does it have to be precisely "sqrt(4x2 + 1)" for it to work like that? In other words is the derivative of "(1/2)*x*f(x) + (1/4)*sinh-1(2x)" "f(x)"?
Player (36)
Joined: 9/11/2004
Posts: 2631
Warp wrote:
In other words is the derivative of "(1/2)*x*f(x) + (1/4)*sinh-1(2x)" "f(x)"?
No, absolutely not.
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Editor, Expert player (2080)
Joined: 6/15/2005
Posts: 3284
OmnipotentEntity wrote:
Warp wrote:
In other words is the derivative of "(1/2)*x*f(x) + (1/4)*sinh-1(2x)" "f(x)"?
No, absolutely not.
I think Warp meant to ask "Do there exist any functions f(x), other than sqrt(4x2+1), such that the derivative of (1/2)*x*f(x) + (1/4)*sinh-1(2x) is f(x)?" The answer to that is yes. But it's not that impressive. The family of solutions to the differential equation ((1/2)*x*f(x) + (1/4)*sinh-1(2x))' = f(x) (■) is sqrt(4x2+1) + Cx, for all real numbers C. Note that (■) is a first-order linear differential equation. So you can rewrite it as: f'(x) - (1/x)*f(x) = -(1/x)*(1/sqrt(4x2+1)). Multiplying both sides by 1/x (the factor to apply reverse product rule to the left-hand side): ((1/x)*f(x))' = -(1/x2)*(1/sqrt(4x2+1)), (1/x)*f(x) = int(-(1/x2)*(1/sqrt(4x2+1))) = sqrt(4x2+1)/x + C, where the integral can be solved with, for example, x=(1/2)*tan(u). So f(x) = sqrt(4x2+1) + Cx. Note: Because (■) is a linear differential equation and we already know that sqrt(4x2+1) is a solution, we can just solve the homogeneous system ((1/2)*x*h(x))' = h(x) (solution family is Cx). Then every solution to (■) is a solution to the homogeneous system (Cx) plus the particular solution sqrt(4x2+1).
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
James Grime of Numberphile fame presented this problem in one of his videos: Prove that when you multiply a pair of twin primes you get a number that has remainder 8 after division by 9. With one exception.
Editor, Skilled player (1348)
Joined: 12/28/2013
Posts: 396
Location: Rio de Janeiro, Brasil
Except for 3, primes aren't multiples of 3. So if a pair of primes is twin, their congruence modulo 9 must be: 2 and 4; 5 and 7 or 8 and 1. 2*4 = 8 5*7 = 35 = 3*9 + 8 8*1 = 8. The exception is 3 and 5, because 3 is the only prime that is a multiple of 3.
My YouTube channel: https://www.youtube.com/channel/UCVoUfT49xN9TU-gDMHv57sw Projects: SMW 96 exit. SDW any%, with Amaraticando. SMA2 SMW small only Kaizo Mario World 3