Post Reply 
[VA] Short & Sweet Math Challenge #25 "San Valentin's Special: Weird Math"
02-28-2021, 02:18 AM (This post was last modified: 02-28-2021 11:09 PM by Valentin Albillo.)
Post: #40
RE: [VA] Short & Sweet Math Challenge #25 "San Valentin's Special: Weird Math...
      
Hi all,

These are my original solutions for both "Concoction the Third: Weird Integral" and "Concoction the Fourth: Weird Graph", once more with the same Sections and structure, including The Hall of Fame. For my previously posted solutions you can follow these links: "Concoction the First: Weird Limit" and "Concoction the Second: Weird Sum".

Note: My HP-71B code might use keywords from the JPC ROM, MATH ROM, HP-IL ROM and STRINGLX LEX file, executed on go71b, while RPN code is for the HP-42S, executed on a DM42.


My original solution for "Concoction the Third: Weird Integral"

[Image: TEST6-DISREGARD.jpg]

What's so weird about this integral?


The Sleuthing

As before, I'll describe a typical sleuthing procedure to try and answer the above question. First of all, let's compute the integral's value to full 12-digit accuracy using the HP-71B, right from the command line:

      >DESTROY ALL @ P=(1+SQR(5))/2 [ENDLINE]
      >INTEGRAL(1,P,0,GAMMA(LN(P^2-IVAR))/(GAMMA(LN(IVAR))+GAMMA(LN(P^2-IVAR)))) [ENDLINE]

            .309016994376


which is the correct 12-digit result within 1 ulp. In case you didn't recognize it, use my IDENTIFY subprogram (a must for everyone's HP-71B library !) which will identify it as 1/(2*φ) (or an equivalent expression). Now let's create a user-defined function for the f(x) under the integral sign, to experiment a little. This trivial program will do:

      1  DESTROY ALL @ P=(1+SQR(5))/2
      2  DEF FNF(X)=GAMMA(LN(X))
      3  DISP INTEGRAL(1,P,0,FNF(P^2-IVAR)/(FNF(IVAR)+FNF(P^2-IVAR)))

      >RUN
            .309016994376


Now I'll find the value of f(x) and f(φ2-x) at the endpoints of the integration interval:

      >SFLAG -1 @ FNF(1),FNF(P) @ FNF(P2-1),FNFP(P2-P) @ CFLAG -1

            9.99999999999E499      1.84069978531
            1.84069978531          9.99999999999E499


and we notice that f(1) ~ Inf, which will do no harm, and that the values at the interval's endpoints for f(x) and f(φ2 - x) are symmetric. Also, from now on we'll use the fact that φ2 = 1 + φ.

Experimenting a little, we might compute the integral for other intervals, to see if there's some invariance or anything recognizable, but to no avail. Now, what if we try other functions using the same arguments ? This edited version of the above code (94 bytes) will help us test this idea with assorted user-supplied f(x):

      1  DESTROY ALL @ @ P=(1+SQR(5))/2 @ INPUT "f(x)? ";F$
      2  DEF FNF(X)=VAL(F$)
      3  DISP INTEGRAL(1,P,0,FNF(P^2-IVAR)/(FNF(IVAR)+FNF(P^2-IVAR)))

      >RUN
            f(x)?   GAMMA(LN(X))       ->   .309016994376
            f(x)?   GAMMA(X)           ->   .309016994375
            f(x)?   SQR(LN(X))         ->   .309016994375
            f(x)?   SQR(X)             ->   .309016994375
            f(x)?   SIN(X)             ->   .309016994375
            f(x)?   X^X/COSH(2.021*X)  ->   .309016994375
            f(x)?   SIN(SINH(X)+LN(X)) ->   .309016994375
            f(x)?   X^3-6*X-2          ->   .309016994375
            f(x)?   X                  ->   .309016994375
            f(x)?   1                  ->   .309016994375


and it's pretty clear what's happening, so no more sleuthing's needed, let's just go for the results.


The Results

After all the sleuthing above, I can summarize the results as follows:
  • The numeric value of the integral is .309016994376 (correct to 12 digits within 1 ulp), identified as 1/(2*φ)   { or also (φ-1)/2 }
     
  • The value of this definite integral is independent of the function being integrated (as long as the same interval and arguments are used, f(x) is continuous and the integral's denominator isn't 0 inside the interval). This is weird !

The Comments

A key fact is to notice that φ2 equals 1 + φ, so the integral becomes:

[Image: ZZSSMC25C01.jpg]

and as we also saw above that the values at the endpoints for f(x) and f(φ2 - x) (i.e. f(1 + φ - x)) are symmetric, we perform the change of variable z = 1 + φ - x, dz = -dx, which after trivial algebraic manipulations turns the integral into the form:

[Image: ZZSSMC25C02.jpg]

and as z is a dummy integration variable, we formally substitute it for x, and the integral becomes now:

[Image: ZZSSMC25C03.jpg]

which allows for adding this integral to the original one and then we have:

[Image: ZZSSMC25C04.jpg]

[Image: ZZSSMC25C05.jpg]

and we get the same numerical value we computed earlier, now in symbolic form as (φ-1)/2 = 1/(2*φ) = .309016994375.

Note that this works for any f(x) (subject to the aforementioned limitations) because the expressions in the numerator and denominator in the sum above cancel out and you end up computing the integral of the constant function 1, regardless of the f(x) originally used.

Other intervals [a, b] and arguments (x + u, w - x) are possible as long as w - u = a + b. Here we had a = 1, b = φ, u = 0 and w = φ2 = 1 + φ.


The Hall of Fame

This time the experts which dared to deal with this Concoction the Third: Weird Integral are the following four people:
  • J-F Garnier posted RPN code for the HP-32S and said that he successfully computed the numeric value to at least 11 places and had (presumably) deduced what's weird about the integral and its symbolic value as well, though he didn't post any results to avoid spoiling the fun for others.
     
  • robve computed the integral using the HP Prime but alas, the result he posted is wrong. He also posted a BASIC program for the SHARP PC-1350 which produced the same wrong result. Anyway, thanks for trying ...
     
  • Werner posted RPN code for the HP-42S to be used with the built-in integration functionality but he didn't post any results, presumably to avoid spoiling the fun, as J-F did. In a subsequent message he explained his sleuthing and gave both the answer to the "What's weird" question as well as the correct symbolic value.
     
  • Nihotte(lma) posted an RPN program for the HP35s and correctly computed the integral's numeric value, which he also identified symbolically as well.




My original solution for "Concoction the Fourth: Weird Graph"

      "Consider the following polynomial in two real variables x, y:

          P(x, y) = 9 x8 + 9 y8 + 36 x2 y6 + 54 x4 y4 + 36 x6 y2 - 100 x6 - 4 y6 - 108 x2 y4 - 204 x4 y2 + 182 x4 - 10 y4 - 84 x2 y2 - 100 x2 - 4 y2 + 9

      Plot the graph of P(x, y) = 0.  What's so weird about the graph ?"



The Sleuthing

In this case, the first thing to do is, well, to plot the graph of P(x, y) = 0. As I stated in my OP, I won't post code or manual operations as I don't own any graphing calculators but I'll give the resultant graphic you should get, which comes out like this (Note: ignore the line segments and labels for now, they're explained in the Comments below):

[Image: ZZSSMC25D01.jpg]

And we can see that the graph is perfectly symmetrical respective of both X,Y axes and seems to consist of two intersecting circles (in red, the "crossed eyes") and two isolated points ("the pupils"), (-1, 0) and (1, 0), labeled as A1 and A3, respectively.

The graph in itself is funny-looking (thus weird) but is that all there's to it ? Let's explore the isolated points by looking at the intersections of P(x, y) = 0 with the X axis, i.e. by looking at the roots of P(x, 0) = 0, which we obtain by factorizing that polynomial:

      P(x, 0) = 9 x8 - 100 x6 + 182 x4 - 100 x2 + 9 = 0, which factorizes as (x + 3)(3 x + 1)(x + 1)2(x - 3)(3 x - 1)(x - 1)2 = 0,

and we see that the graph intersects the X axis at the points (-3,0), (-1/3, 0), (3, 0), (1/3, 0) and also (-1, 0), (1, 0) which both turn out to be double roots, so each of them is a double isolated point of the graph. Their isolation means that there are no other graph points in their vicinity, which makes them doubly weird, thus weirder.

Are we done ? Not yet. The "crossed eyes" part of the graph certainly seems to consist of two perfect circles at first sight but, is that so ? Are they true circles ?. The question can be answered by factorizing P(x, y) and checking whether there are two factors which can be identified as the respective circles' equations, e.g.:

      Q(x, y) = 3 x4 + 3 y4 + 6 x2 y2 - 6 x2 - 10y2 + 3    factorizes as   3 (x2 + y2 + 2√3/3 y - 1) (x2 + y2 - 2√3/3 y - 1),

and both 2nd-degree polynomial factors are equations of circles so the graph of Q(x, y) = 0 is the union of two true circles. Regrettably, our P(x, y) does not factorize that way so let's zoom in the first quadrant (the others are symmetrical) at suitably high magnification, and we get this view, where the graph of P(x, y) appears in red and a superimposed true circle appears in black:

[Image: ZZSSMC25D02.jpg]

As you can see, they don't exactly match, close but no cigar !   This means that the "crossed eyes" ara not true circles in fact, and that is most unexpected and thus weirdest. Enough sleuthing, time for the results.


The Results

Once the sleuthing is over, I can summarize the results as follows:
  • The graph consists of what seems to be two intersecting circles (the "crossed eyes", which is weird), and two double isolated points ("the pupils") at (-1, 0) and (1, 0), which is weirder.
     
  • Despite initial impressions, the "crossed eyes" aren't true circles after all but only very close approximations, which is weirdest.


The Comments

This polynomial P(x, y) is obtained as the extended locus of all points P such that the signed sum of the lengths of the three segments a, b, c from the three fixed points A1 = (-1, 0), A2 = (0, 0) and A3 = (1, 0) to the point P is equal to the length of segment s, here equal to 1 (see the first graph above). It is a generalization of the case for just a single point A1, where the locus would be a circle of radius 1.

For the case of three arbitrary, distinct fixed points A1, A2, A3, the resulting polynomial is always of degree 8, like here, except in degenerate cases. With our fixed points A1, A2 and A3, the "pupils" are double isolated points but for other fixed points and/or lengths of s the double isolated points (the "pupils") may actually widen to small ovals inside the bigger ovals ("crossed eyes").

Also, we saw that the "crossed eyes" ovals weren't actually perfect circles by zooming in, but we can check it numerically with ease. For instance, let's assume that the right oval is a circle (see the second graph above). Points D = (-1/3, 0) and E = (3, 0) belong to the oval so if we assume it's really a circle then it would have center (4/3, 0) and radius 5/3. So far, so good.

But now let's consider point F = (9/5, 8/5), which lies in the true circle (superimposed in black) because √((9/5 - 4/3)2 + (8/5)2) = 5/3, but it doesn't lie in the extended locus (in red) because the signed sum of the three segments from the fixed points to F is ~ 0.97, less than 1.00 (the length of segment s), which is close but not exact, a ~ 3 % error. Computing the differences for a suitable number of points on the true circle reveals that the maximum error is always below ~ 3.5 %, so though not exactly, the "crossed eyes" ovals are each very close to being a true circle.


The Hall of Fame

This time the experts which boldly addressed this Concoction the Fourth: Weird Graph are the following two people:
  • robve used the HP Prime to plot the graph and gave the correct center for the "circles" but the wrong diameter. He also gave the correct coordinates for the "pupils" and remarked that they were quite difficult to compute to single points.
     
  • C.Ret posted a very detailed account of his thorough sleuthing process, with graphs aplenty as well as algebraic disquisitions, getting right the double isolated points coordinates and characterization, and even tried to factorize the P(x,y) polynomial to no avail, stopping shy of recognizing that this meant the seemingly perfect circles actually weren't. A little zooming in would have settled the matter for good.



That's all for now, many thanks to those who contributed, I sure expect you enjoyed it. I'll post my original solutions for both "Concoction the Fifth: Weird Primes" and "Concoction the Sixth: Weird Year" in a few days. Stay tuned !  Smile
  • Note: For any comments not directly related to the math or code here but to ancillary matters such as this or that opinion on the rules or "Halls of Fame" or whatever, please PM me instead of posting them here. Let's keep this thread strictly mathematical and algorithmical in nature. Thanks.

Best regards.
V.

P.S.: Edited to include a "missing" expert in Concoction's Three's "Hall of Fame". Sorry for that !

  
All My Articles & other Materials here:  Valentin Albillo's HP Collection
 
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [VA] Short & Sweet Math Challenge #25 "San Valentin's Special: Weird Math... - Valentin Albillo - 02-28-2021 02:18 AM



User(s) browsing this thread: 1 Guest(s)