Post Reply 
Learning How to Use the Prime G2 - Hallway Pole Problem - In Three Parts
09-02-2019, 11:32 PM (This post was last modified: 09-04-2019 02:49 AM by jlind.)
Post: #1
Learning How to Use the Prime G2 - Hallway Pole Problem - In Three Parts
Note:
There’s a limit to the number of images allowed in a posting. I’ve had to break this up into three parts to cope with that . . .
This is Part I of III

Just recently acquired the HP Prime G2. It's a different beast compared to the TI and other HP calculators I have, including a TI Nspire CX II CAS. Best way I've found to work through using a new calculator is to solve some non-trivial problems with it. Started with the "Hallway Pole Problem" which involves having to move a rigid pole horizontally around a right angle corner between two hallways of different widths. If they were the same width, the problem would be trivial with a trivial solution, and the astute would see it immediately. Presuming the hallways are long enough that the limiting factor is the length that can fit around the corner, the goal is to find the longest pole that can be moved though the corner. The pole is too heavy to lift to tilt it and must be pushed through. Those who have moved furniture in and out of homes and apartments - and sometimes inside a home to different rooms - will recognize the nature of this problem, especially with long and heavy couches. Big king size mattresses and box springs can also be a challenge.

Following shows a view of the problem as seen from above (aka the Plan View):

[Image: 48663191848_ae2ecc1ef5_b.jpg]

I posted this problem elsewhere and someone immediately asked what the height of the hallway is, even though the problem statement excluded being able to tilt the pole upward from floor to ceiling. Nevertheless, I responded the ceiling in both hallways is 8 feet above the floor, with ceiling and floor both level and parallel planes throughout the problem space. It should be noted that adding height and considering being able to tilt the pole upward allows a longer pole, but it's a trivial add-on, as one is now moving a right triangle of uniform height around the corner, the other leg of which is the hypotenuse of the first triangle shown in the Plan View. More on that later. ;-)

There are two equations that can define all the possible lengths of "C" in a single independent variable:
  • Using geometry and the Pythagorean Theorem for right triangles.
  • Using trigonometry and the angle, θ, as shown in the diagram.
To set up the first equation to define the length of "c" in terms of "x", we know that triangle a-b-c is similar to triangle x-10-c1, where 10 is a constant, the width of wider hallway in feet. From this we can readily deduce:
a = x + 5.
Since the larger and smaller triangles are similar, the ratios of their similar sides are equal:
b/a = 10/x, the most relevant ratio to setting up the equation.
b = 10*a/x
b = 10*(x+5)/x, by substitution
b = 10 + 50/x, simplifying the equation

From the Pythagorean Theorem:
c^2 = a^2 + b^2
c^2 = (x+5)^2 + (10 + 50/x)^2
c = ((x+5)^2 + (10 + 50/x)^2)^(1/2), c > 0

[Image: 48663543571_6798cb1693.jpg]

As these are similar triangles, the angle θ between sides "a" and "c" is the same as the angle between the larger hallway width 10 and c1. Likewise it's the same angle between the narrower hallway width 5 and c2. Thus, all the trigonometric relationships, Sine, Cosine, Tangent and Cotangent using the ratios of the sides are equal.

Cosθ = 10/c1
c1 = 10/Cosθ
Sinθ = 5/c2
c2 = 5/Sinθ
c = (5/Sinθ) + (10/Cosθ), 0 < θ < 90 degrees, or π/2 radians

I will use degrees for this problem, even though I'd normally use radians, as most can relate better visually to degrees.

[Image: 48663543551_6497616afd.jpg]

The general approach to finding the longest pole length is finding the shortest length of "c" that among all the possible right triangles formed by the two outer walls and the inner corner. To do that:
  1. Find the first derivative, df(x)/dx, or df(θ)/dθ
  2. Find the positive, primary roots, or zeros of the derivatives; i.e., x > 0, and 0<θ<90 degrees.
  3. Test for minima using the second derivative and solving for the critical point; local minima >0, local maxima < 0, and inflection point = 0. We're expecting a local minima within the defined domain in this problem.

In the "old days" of working these problems by hand using pencil, an engineering pad, slide rule and the CRC Handbook of Mathematical Tables, the latter using trigonometry was much, much simpler. It's how I worked problems like this when I was taking University Calculus as an undergrad (the HP 35 hadn't been released yet).

This problem can be worked in several ways with a CAS capable calculator.
  1. Do it like the old days, but use the calculator instead of a slide rule to crunch the numbers.
  2. Use a quick and dirty Min-Max calculator program to walk the equation looking for the minimum within a given tolerance, which will be the longest pole length that will fit.
  3. Use the calculator to perform the calculus:
    • Find the first and second derivatives.
    • Find the zero for the first derivative.
    • Test with the second derivative to ensure it's a local minima.
    • Plug the critical point value back into the original equation to find the longest length that will fit around the corner.

Method 1:
Differentiating the Pythagorean equation using the "chain rule":

c' = f'(x) = (1/2)*((x+5)^2 + (10 + 50/x)^2)^(-1/2) * 2(x+5) + 2*(10 + 50/x)*(-1)*(50/x^2)

Don't think I want to try to find the root to this one . . . let's try differentiating the trig equation. ;-)

c' = f'(θ) = (-5/(Sinθ)^2)*(Cosθ) + (10/(Cosθ)^2)*(Sinθ)

Much simpler! To find the zero, set c'=0:
(-5/(Sinθ)^2)*(Cosθ) + (10/(Cosθ)^2)*(Sinθ) = 0

Move the first half of this to the other side of the equal sign and start reducing:
(10/(Cosθ)^2)*(Sinθ) = (5/(Sinθ)^2)*(Cosθ)
2 * (Sinθ) = ((Cosθ)^3/(Sinθ)^2)
2 = ((Cosθ)/(Sinθ))^3
2 = (Cotθ)^3; (Note: Cos(x)/Sin(x) = Cot(x), a trig identity)
Cotθ = 2^(1/3)
θ = ArcCot(2^(1/3)), or
θ = ArcTan ((2)^(-1/3)), since many calculators have Tan and ArcTan, but not Cot or ArcCot.
θ = ArcTan ((0.5)^(1/3))
θ ~= 38.44 degrees
c ~= 5/Sin(38.44 degrees) + 10/Cos(38.44 degrees)
c ~= 20.81 feet

Having memorized the differentials of the common transcendentals, and some basic trig identities reduced this relatively quickly using the angle and trig functions. If I'd tried to use the first derivative of the Pythagorean equation I'd probably still be working on it, wanting to break the pencil in half. Screen capture showing the calculation with calculator set for RPN entry. I hit the enter key a couple times to put some of the intermediate numbers further up the stack so they wouldn't disappear. Shows the one entry that will be divided by 2 giving 0.5, followed by taking its cube root, and then the ATan of that in degrees. Last entry is the use of that angle in the original trig equation to get the max length. Note that it's not 45 degrees, which it would be if the hallways were the same width, with an Isosceles right triangle and the pole would be 2*(hallway width)*sqrt(2), a trivial solution the astute would immediately see.

[Image: 48665042418_86bfc2ba2a.jpg]

Method 2:
Now I use the HP Prime's Function application, its Plot capability, and the Extremum Function within the Plot. Entering the Function Symbolic View, the trig function is entered as a function of "X" which is convenient.

[Image: 48665491131_f648c8466b.jpg]

Next the Plot view is invoked by pressing the Plot button, and we have the cursor on a point along the curve. We're in the first "quadrant" of angle which > 0 and < 90 degrees. It's obvious there's a local minimum for the length of "c", which is what I'm seeking.

[Image: 48665816892_6b3bbc7c86.jpg]

The Plot view has a function for finding the nearest Extremum (local maximum or minimum); it's number 7 on the menu . . .

[Image: 48665716097_9fa3b0f73a.jpg]

It finds the minimum instantly and there's an option to highlight it as I've done with the yellow dashed lines.

[Image: 48665716687_890603a958.jpg]

As calculated above doing it by hand, the angle at which the shortest "c" occurs is about 38.44 degrees. This gives the same longest pole length of approximately 20.81 feet.

There's little doubt in my mind now why the calculator is banned on some tests because it has CAS capability, and why it has a "test mode" that can limit or block these capabilities. One wouldn't need to understand the underlying calculus concepts for finding critical points: maxima, minima and inflections. Plug and chug in a graph and Bob's your uncle, you've got the answer. Not what you'd want for someone who's supposed to be mastering calculus. For what it's worth, a similar solution method is used in the Math/Utilities Library Module for my TI-58, although it can take a while to churn away finding the critical point of interest (will also tell you if it's a local max or min - can't find inflections - and has an option to continue onward to the next one). Requires writing a short program for the function itself. Likewise, my TI-85 and TI-86 use the same or similar method, and also require writing a short program containing the function, so the calculator can loop through it as it chases down a critical point. The DM42 has a similar program in its FAT library (also requires writing a program for the equation).

To be Continued in Part II . . .

John

John

Pickett: N4-ES, N600
TI: 58, 30-III, 30x Pro MathPrint, 36x Solar, 85, 86, 89T, Voyage 200, Nspire CX II CAS
HP: 50g, Prime G2, DM42
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Learning How to Use the Prime G2 - Hallway Pole Problem - In Three Parts - jlind - 09-02-2019 11:32 PM



User(s) browsing this thread: