The Museum of HP Calculators

HP Forum Archive 21

 Math Challenge I could not solveMessage #1 Posted by Meindert Kuipers on 3 Jan 2013, 3:20 p.m. Some time ago a colleague gave me a math challenge that he could not solve, and according to him others had huge problems getting it solved. I tried, and could not really come to a satisfying solution, so I am calling the forum's help. Due to lack of regular exercise own math shape is really bad ... I would like to end up with a formula or part of a program (for HP41 or WP43s preferably) to find a solution. The problem is the following: A farmer has a perfectly circular piece of land with a give radius R. He wants to sell half of it to his neighbour, by putting a pole on the edge of the piece of land, and, using a wire of a certain length L tied to the pole, marks off a part of the farmers land. The pole is the center of a new circle segment. The result is a lens-shaped piece of land wich has half the area of this lens-shaped part is half of the original piece of land. The big question: how long is the rope L depending on the original radius R. Looking forward to your responses .... Meindert

 Re: Math Challenge I could not solveMessage #2 Posted by Walter B on 3 Jan 2013, 3:58 p.m.,in response to message #1 by Meindert Kuipers Quote: The result is a lens-shaped piece of land wich has half the area ((of this lens-shaped part is half)) of the original piece of land. Suggest deleting the words between the (added) double parentheses. d:-)

 Re: Math Challenge I could not solveMessage #3 Posted by Steve Hunt on 3 Jan 2013, 4:08 p.m.,in response to message #1 by Meindert Kuipers I'm no maths expert, but this may help: http://mathworld.wolfram.com/Circle-CircleIntersection.html Equation 14 gives the expression for the lens area. It simplifies when you place the centre of the second circle on the perimeter of the first circle by setting d=R. Hope that helps, Steve

 Re: Math Challenge I could not solveMessage #4 Posted by Neil Hamilton (Ottawa) on 4 Jan 2013, 7:44 a.m.,in response to message #3 by Steve Hunt This would be link below for those of you who, like me, primarily use a handheld device to read this site and cannot easily cut and paste: All the best...

 Re: Math Challenge I could not solveMessage #5 Posted by Kiyoshi Akima on 3 Jan 2013, 4:32 p.m.,in response to message #1 by Meindert Kuipers I get L = about 1.37R . Yes, I could give ten digits as calculated by my 15C, but first I want to know whether I'm in the right ballpark. Incidentally, it didn't require a calculator until the final step to numerically evaluate an expression involving roots. Edited: If I'm in a ballpark, it's the wrong one. Edited: 3 Jan 2013, 9:33 p.m.

 Re: Math Challenge I could not solveMessage #6 Posted by Dieter on 3 Jan 2013, 4:37 p.m.,in response to message #1 by Meindert Kuipers Simple answer: The Goat Problem. Dieter

 Re: Math Challenge I could not solveMessage #7 Posted by Thomas Klemm on 3 Jan 2013, 7:39 p.m.,in response to message #1 by Meindert Kuipers You could use the HP-42S and combine the solver with the numeric integration. I'm cutting the lens-shaped piece vertically into two circular segments that are integrated. Then I use the solver to make sure that the area is half of the circle with radius 1. Using the following definitions I end up with this equation: $d=\cos2x$ $r=2\sin x$ $2(\int_{d}^{1}\sqrt{1-t^2}dt+\int_{1-d}^{r}\sqrt{r^2-t^2}dt)=\frac{\pi}{2}$ Now I define the two functions f(t) and g(t): $f(t)=\sqrt{1-t^2}$ ```00 { 16-Byte Prgm } 01 LBL "f(t)" 02 MVAR "t" 03 RCL "t" 04 ACOS 05 SIN 06 END ``` $g(t)=\sqrt{r^2-t^2}$ ```00 { 24-Byte Prgm } 01 LBL "g(t)" 02 MVAR "r" 03 MVAR "t" 04 RCL "r" 05 X^2 06 RCL "t" 07 X^2 08 - 09 SQRT 10 END ``` With this program the equation is calculated: ```00 { 94-Byte Prgm } 01 LBL "GOAT" 02 MVAR "x" 03 RCL "x" 04 2 05 * 06 COS 07 STO "LLIM" 08 1 09 STO "ULIM" 10 PRGMINT "f(t)" 11 INTEG "t" 12 STO "F" 13 1 14 RCL - "LLIM" 15 STO "LLIM" 16 RCL "x" 17 SIN 18 2 19 * 20 STO "r" 21 STO "ULIM" 22 PGMINT "g(t)" 23 INTEG "t" 24 RCL + "F" 25 2 26 * 27 PI 28 2 29 / 30 - 31 END ``` Solve this equation for the variable x and you end up with x = 0.617948. Use r = 2 sin(x) and you will get r = 1.158728. This result is in accordance with the aforementioned page of the Goat Problem. Kind regards Thomas Edited: 3 Jan 2013, 7:44 p.m.

 Re: Math Challenge I could not solveMessage #8 Posted by Luiz C. Vieira (Brazil) on 3 Jan 2013, 9:31 p.m.,in response to message #7 by Thomas Klemm First of all, congratulations! It is a very clever reduction/synthesis. Just for the records: after running the program, how long did it take to find the answer? Did you use a regular HP42S or an emulator? Thanks! Luiz (Brazil)

 Re: Math Challenge I could not solveMessage #9 Posted by Thomas Klemm on 3 Jan 2013, 9:47 p.m.,in response to message #8 by Luiz C. Vieira (Brazil) I used Free42 on an iPhone and the answer comes almost immediately. As for the HP-15C I used ClassicRPN on the iPhone as well. It took about 37 seconds, but I have no idea how this relates to the original calculator. In both cases the result is correct to 6 decimal places. And then I tried to use WolframAlpha but ran out of time ... Cheers Thomas

 Re: Math Challenge I could not solveMessage #10 Posted by PGILLET on 7 Jan 2013, 2:28 a.m.,in response to message #7 by Thomas Klemm That's how I saw the problem: In the lens-shaped piece you can see an isosceles triangle with sides (1,1,r) and angles (a,a,pi-2*a). Divided in two right-angled triangles, it leads to 1*cos(pi-2*a)=d and r*cos(a)=1-d => d=1-r*r/2. The grazed surface can then be expressed as S=2*(integ(sqrt(1-x*x),x,1-r*r/2,1)+integ(sqrt(r*r-x*x),x,r*r/2,r)). But we know that integ(sqrt(r*r-x*x),x)=x/2*sqrt(r*r-x*x)+r*r/2*arcsin(x/r). So developing and simplifying S naturally leads to S=arccos(1-r*r/2)+r*r*arccos(r/2)-r/2*sqrt(4-r*r). (It's just another way to the same formula as in the http://mathworld.wolfram.com/GoatProblem.html web site). Solving S=pi/2 on r also :) leads to r=1.15872847...

 Re: Math Challenge I could not solveMessage #11 Posted by Thomas Klemm on 3 Jan 2013, 9:31 p.m.,in response to message #1 by Meindert Kuipers For those who prefer to use the HP-15C: ```001 - 42,21,11 LBL A 020 - 20 x 002 - 44 0 STO 0 021 - 43 26 PI 003 - 2 2 022 - 2 2 004 - 20 x 023 - 10 / 005 - 24 COS 024 - 30 - 006 - 44 2 STO 2 025 - 43 32 RTN 007 - 1 1 026 - 42,21, 0 LBL 0 008 - 42,20, 0 INTEGRATE 0 027 - 43 24 ACOS 009 - 44 3 STO 3 028 - 23 SIN 010 - 1 1 029 - 43 32 RTN 011 - 45,30, 2 RCL- 2 030 - 42,21, 1 LBL 1 012 - 45 0 RCL 0 031 - 45 1 RCL 1 013 - 23 SIN 032 - 43 11 x^2 014 - 2 2 033 - 34 x<>y 015 - 20 x 034 - 43 11 x^2 016 - 44 1 STO 1 035 - 30 - 017 - 42,20, 1 INTEGRATE 1 036 - 11 SQRT 018 - 45,40, 3 RCL+ 3 037 - 43 32 RTN 019 - 2 2 ``` LBL A: GOAT LBL 0: f(x) LBL 1: g(x) REG 0: x REG 1: r REG 2: d REG 3: F Solution: ```0 ENTER 1 SOLVE A running 0.617948 SIN 2 * 1.158728 ``` Cheers Thomas

 Re: Math Challenge I could not solveMessage #12 Posted by Paul Dale on 3 Jan 2013, 10:32 p.m.,in response to message #11 by Thomas Klemm This same program and procedure works on the 34S, although slowly (probably the solver again). It gives 1.158728473020422 and is incorrect by one in the 12th digit. The correct answer being 1.1587284730181215... I also suspect that calculating $f(t)=\sqrt{1-t^2}$ would be faster done directly instead of as SIN(COS-1(t)). - Pauli Edited: 3 Jan 2013, 10:33 p.m.

 Re: Math Challenge I could not solveMessage #13 Posted by Thomas Klemm on 3 Jan 2013, 11:33 p.m.,in response to message #12 by Paul Dale Or to avoid extinction when x is close to 1: $\sqrt{(1+t)(1-t)}$ On the Free42 you can set the variable "ACC" to 1e-20 and you will end up with 25 correct places. Though I wonder what we could do with these. Cheers Thomas Edited: 3 Jan 2013, 11:35 p.m.

 Re: Math Challenge I could not solveMessage #14 Posted by Paul Dale on 4 Jan 2013, 12:28 a.m.,in response to message #13 by Thomas Klemm Yes, that is a better way to calculate it -- wasn't really thinking about stability when I wrote my note. - Pauli

Re: Math Challenge I could not solve
Message #15 Posted by Thomas Klemm on 4 Jan 2013, 1:18 a.m.,
in response to message #14 by Paul Dale

As you may know the HP-34C (and all successors) uses a Romberg method with nodes that are spaced nonuniformly using a substitution:

$u=\frac{3}{2}v-\frac{1}{2}v^3$

Details can be found in this section of William M. Kahan's article:

## What Method Underlies the Integrate Key?

Quote:
Second, $I=\int_{y}^{x}f(u)du$ can be calculated efficiently when $f(u)=g(u)\sqrt{\left|x-u\right|}$ or $g(u)\sqrt{(x-u)(u-y))}$ where g(u) is everywhere a smooth function, without any of the expedients that would otherwise be required to cope with the infinite values taken by the derivative f'(u) at u = x or u = y. Such integrals are encountered often during calculations of areas enclosed by smooth closed curves. For example, the area of a circle of radius 1 is

$\int_{0}^{2}\sqrt{u(4-u)}du=3.14159\pm8.8\times10^{-6}$

which consumes only 60 seconds when evaluated in SCI 5 and only 110 seconds to get 3.141592654±1.4x10-9 in SCI 9.

So it appears HP's numeric integration is well suited for this challenge.

Kind regards
Thomas

Edited: 4 Jan 2013, 1:23 a.m.

 Re: Math Challenge I could not solveMessage #16 Posted by Dieter on 4 Jan 2013, 1:04 p.m.,in response to message #12 by Paul Dale Quote: This same program and procedure works on the 34S, although slowly (probably the solver again). It gives 1.158728473020422 and is incorrect by one in the 12th digit. Strange. I just tried the same on a (hardware) 34s and I finally got 1,158728473018121 - which is exact within 1 ULP. The calculator was set to ALL mode, of course. Dieter

 Re: Math Challenge I could not solveMessage #17 Posted by Walter B on 4 Jan 2013, 1:50 p.m.,in response to message #16 by Dieter Build number? Program listing? There must be reasons for the different results, so I'd appreciate getting these data from you and Pauli. d:-)

 Re: Math Challenge I could not solveMessage #18 Posted by Dieter on 4 Jan 2013, 1:56 p.m.,in response to message #17 by Walter B Version = 3.1 3325, and the program was the same as the 15C version posted in this thread. OK, I used LBL B, 55 and 66 instead. ;-) Dieter Edited: 4 Jan 2013, 1:57 p.m.

 Re: Math Challenge I could not solveMessage #19 Posted by Paul Dale on 4 Jan 2013, 5:54 p.m.,in response to message #18 by Dieter I was running 3.1 3225 -- 100 revisions older. I've been slack and not updated that one for ages. - Pauli

 Re: Math Challenge I could not solveMessage #20 Posted by Dieter on 4 Jan 2013, 6:52 p.m.,in response to message #19 by Paul Dale Now, that's even stranger. I still have an emulator with version 3.1 3225 here. Entered the same program, got the same (exact) result: 1,158728473018121. So something else must be different. Which display mode did you set? Dieter

 Re: Math Challenge I could not solveMessage #21 Posted by Paul Dale on 4 Jan 2013, 7:50 p.m.,in response to message #20 by Dieter Unknown anymore, I've been making changes to the display code this morning. It was probably ALL something. I was running in single precision. - Pauli

 Re: Math Challenge I could not solveMessage #22 Posted by Meindert Kuipers on 5 Jan 2013, 10:34 a.m.,in response to message #1 by Meindert Kuipers Thank you all for your responses! Meindert

 Re: Math Challenge I could not solveMessage #23 Posted by Thomas Klemm on 5 Jan 2013, 4:43 p.m.,in response to message #22 by Meindert Kuipers Let me thank you for the challenge. And Dieter for pointing out that this is the "Goat Problem". I'm always amazed by this forum. The last time I posted a challenge: zing and the answer was that this is "Kaprekar's constant". Never heard of that before. Kind regards Thomas

Go back to the main exhibit hall