Named Inequalities · applications

Applications: Named Inequalities

10 question types · Pre-University · each worked step by step with a figure that follows the steps

01

A Parcel Routed Through a Depot Instead of Straight to the Store, and When the Company Allows the Detour

methodBound the Direct Road Above by the Sum of the Two Legs and Below by Their Difference, Then Turn the Company's Rule into a Second Inequality

A courier company's warehouse W, its depot D and a store S are joined by three straight roads. The road from W to D is 13 km long and the road from D to S is 8 km long. (a) Use the triangle inequality to find the least and the greatest possible length of the direct road from W to S, and say where the three places must lie for each to happen. (b) The company sends a van from W to S through the depot only when the route through D is no more than 20% longer than the direct road. For which lengths of the direct road does the rule allow the route through the depot?

W to D13 kmD to S8 kmVia D13821 kmdirect road d, in km021d ≤ 13 + 8 = 21
The route through D is two sides of the triangle, so the direct road d is at most 13 + 8 = 21 km.
Call the length of the direct road d km. W, D and S are the corners of a triangle, and the route through the depot is two of its sides, so the triangle inequality gives d ≤ 13 + 8 = 21. A route through the depot is never shorter than the direct road.
step 1 of 5

The triangle inequality says that one side of a triangle is never longer than the other two sides together, and is equal to them only when the triangle is flat. Applied to each side in turn, it traps the third side between the difference and the sum of the other two.

  1. Call the length of the direct road d km. W, D and S are the corners of a triangle, and the route through the depot is two of its sides, so the triangle inequality gives d ≤ 13 + 8 = 21. A route through the depot is never shorter than the direct road.
  2. The side WD is also no longer than the other two sides together: 13 ≤ d + 8. Subtract 8 from both sides to get d ≥ 5.
  3. (a) The direct road is at least 5 km and at most 21 km long. It is 21 km only when D lies on the direct road between W and S. It is 5 km only when S lies on the road from W to D, 5 km from W and 8 km from D.
  4. The route through the depot is 13 + 8 = 21 km. Being no more than 20% longer than the direct road means 21 ≤ 1.2d. Divide both sides by 1.2: d ≥ 17.5.
  5. (b) The rule allows the route through the depot when the direct road is from 17.5 km to 21 km long; 21 km is the longest the direct road can be, by (a). Check: when d = 17.5, the route is 21 ÷ 17.5 = 1.2 times the direct road, exactly 20% longer.

answer(a) Least 5 km, when S lies on the road from W to D; greatest 21 km, when D lies on the direct road between W and S; (b) direct roads from 17.5 km to 21 km long

techniqueThe Triangle Inequality

Common pitfalls

  • Answering that the direct road can be anything from 0 to 21 km. The side WD obeys the triangle inequality too, so 13 ≤ d + 8 and the direct road is at least 5 km; with a shorter direct road, W and D could not be 13 km apart.
  • Writing the rule as d ≤ 1.2 × 21, taking 20% of the route instead of the direct road. The route is compared with the direct road, so the direct road is the base of the percentage: 21 ≤ 1.2d.
02

Triangular Planter Frames Welded from Stock Rods, and the Third Rod for a Given Pair

methodTest the Longest Rod Against the Sum of the Other Two, Reject a Sum That Only Equals It, Then Solve Both Inequalities for the Third Side

A workshop welds triangular frames for hanging planters, with one steel rod for each side. It stocks rods of lengths 20, 30, 40, 50 and 70 cm. (a) How many of the choices of three different lengths make a triangular frame? Which choices fail only because the two shorter rods add up exactly to the longest, and what shape would those rods weld into? (b) A customer orders a frame with sides of 30 cm and 70 cm, and the third rod is cut to a whole number of centimeters. What are the shortest and the longest possible third rods?

rodsshorter twolongestframe20, 30, 4020, 30, 5020, 30, 7020, 40, 5020, 40, 7020, 50, 7030, 40, 5030, 40, 7030, 50, 7040, 50, 70test the longest against the other two
Ten choices of three rods. Each passes when its longest rod is less than the sum of the other two.
There are 10 ways to choose three of the five lengths. For each choice, compare the longest rod with the sum of the two shorter rods.
step 1 of 5

Three lengths make a triangle when each one is less than the sum of the other two. It is enough to test the longest length: if it is less than the sum of the other two, each shorter length is certainly less than the sum of the rest. A sum that only equals the longest length gives a flat triangle.

  1. There are 10 ways to choose three of the five lengths. For each choice, compare the longest rod with the sum of the two shorter rods.
  2. The choices 20, 30, 40, 20, 40, 50, 30, 40, 50, 30, 50, 70 and 40, 50, 70 pass, since 50 > 40, 60 > 50, 70 > 50, 80 > 70 and 90 > 70. The choices 20, 30, 50, 20, 50, 70 and 30, 40, 70 give sums equal to the longest rod, and 20, 30, 70 and 20, 40, 70 give sums of 50 and 60, short of 70.
  3. (a) Five of the ten choices make a frame. The choices 20, 30, 50, 20, 50, 70 and 30, 40, 70 fail by equality: the two shorter rods lie flat along the longest, so they weld into a straight bar, not a triangle.
  4. For (b), call the third rod c cm. If the 70 cm rod is the longest, it must be shorter than the other two together: 70 < 30 + c, so c > 40. If the third rod is the longest, c < 30 + 70 = 100.
  5. (b) So 40 < c < 100, and in whole centimeters the shortest third rod is 41 cm and the longest is 99 cm. Check: 30 + 41 = 71, which is more than 70, and 30 + 70 = 100, which is more than 99.

answer(a) 5 of the 10 choices; 20, 30, 50, 20, 50, 70 and 30, 40, 70 fail by equality and would weld into a straight bar; (b) shortest 41 cm, longest 99 cm

techniqueThe Triangle Inequality

Common pitfalls

  • Accepting a choice whose two shorter rods add up exactly to the longest, such as 20, 30 and 50. The triangle inequality becomes an equality only for a flat triangle, so these rods weld into a straight bar.
  • Answering 40 cm and 100 cm in (b). A 40 cm rod gives 30 + 40 = 70 and a 100 cm rod gives 30 + 70 = 100, both flat; the inequalities are strict, so the whole-centimeter answers are 41 cm and 99 cm.
03

A Two-Link Robot Arm on a Workbench, and the Third Link That Lets It Reach Every Part

methodTake the Greatest Reach as the Sum of the Links and the Least as the Longest Link Minus the Others, Then Require Both Ends of the Working Range

A robot arm on a workbench moves in a horizontal plane. Its first link, 50 cm long, turns about a fixed shoulder joint, and its second link, 30 cm long, turns about an elbow joint at the end of the first. The links sit one above the other, so each joint can turn through a full circle. (a) Find the least and the greatest distance from the shoulder at which the tip of the arm can be, and describe the arm in each position. (b) Parts are placed anywhere from 5 cm to 90 cm from the shoulder, so a third link is added at the tip, turning through a full circle about its own joint. What is the shortest third link that lets the tip reach every distance from 5 cm to 90 cm?

Link 150Straight3080 cmFolded3020 cmr ≤ 50 + 30 = 80 and r ≥ 50 − 30 = 20
Shoulder, elbow and tip make a triangle with sides 50, 30 and r, so 20 ≤ r ≤ 80.
Let the tip be r cm from the shoulder. The triangle with corners at the shoulder, the elbow and the tip has sides 50, 30 and r, so the triangle inequality gives r ≤ 50 + 30 = 80 and 50 ≤ 30 + r, which is r ≥ 20.
step 1 of 5

The shoulder, the elbow and the tip are the corners of a triangle, which is flat in the extreme positions. The triangle inequality bounds the distance from the shoulder to the tip above by the sum of the links and below by the longest link minus the others.

  1. Let the tip be r cm from the shoulder. The triangle with corners at the shoulder, the elbow and the tip has sides 50, 30 and r, so the triangle inequality gives r ≤ 50 + 30 = 80 and 50 ≤ 30 + r, which is r ≥ 20.
  2. (a) The least distance is 20 cm, with the second link folded back along the first, and the greatest is 80 cm, with the arm straight. Turning the elbow moves the tip smoothly between the two, so every distance from 20 cm to 80 cm can be reached.
  3. With a third link of c cm, the greatest reach is 50 + 30 + c = 80 + c cm, with all three links in a line. To reach 90 cm, 80 + c ≥ 90, so c ≥ 10.
  4. For the least reach, the first link is no longer than the way round from the elbow along the other two links to the tip and straight back to the shoulder: 50 ≤ 30 + c + r, so r ≥ 20 − c, with equality when both links fold back. To come within 5 cm of the shoulder, 20 − c ≤ 5, so c ≥ 15.
  5. (b) Both conditions hold when c ≥ 15, so the shortest third link is 15 cm. Check: with links of 50, 30 and 15 cm, the tip reaches from 50 − 30 − 15 = 5 cm out to 50 + 30 + 15 = 95 cm, which covers every distance from 5 cm to 90 cm.

answer(a) Least 20 cm, with the second link folded back along the first; greatest 80 cm, with the arm straight; (b) 15 cm

techniqueThe Triangle Inequality

Common pitfalls

  • Choosing a third link just long enough for the far parts, c = 10 cm. The tip then comes no closer than 50 − 30 − 10 = 10 cm, so a part 5 cm from the shoulder is out of reach.
  • Taking the least distance in (a) as 0, as if the arm could fold its tip back onto the shoulder. The second link is 20 cm shorter than the first, so folded back it leaves the tip 50 − 30 = 20 cm out.
04

A Rectangular Pen of 200 Square Meters Against a Barn Wall: the Least Fencing, and the Cheapest Fence

methodWrite the Fencing as a Sum of Two Terms Whose Product the Area Fixes, Apply AM–GM, and Make the Two Terms Equal for Equality

A farmer fences a rectangular pen of area 200 square meters against the long wall of a barn, so the wall forms one side and needs no fence. The two ends of the pen, at right angles to the wall, are each x m long, and the front, parallel to the wall, is y m long. (a) Use the AM–GM inequality to find the least length of fencing, and the values of x and y that give it. (b) The front faces the farmyard and is a board fence costing $40 per meter, while the two ends are wire mesh costing $10 per meter. What is the least cost of the fence, and what are x and y then?

barn wallxxfront y200 sq mxy = 200; fencing 2x + y
The wall is one side, so the fencing is the two ends and the front, 2x + y meters, with xy = 200.
The area gives xy = 200. The fencing is the two ends and the front, 2x + y meters.
step 1 of 5

The AM–GM inequality says that for positive numbers p and q, p + q ≥ 2√pq, with equality only when p = q. When a total is a sum of two terms whose product is fixed, the right-hand side is a fixed number, so it is the least value of the total, reached when the two terms are equal.

  1. The area gives xy = 200. The fencing is the two ends and the front, 2x + y meters.
  2. The two terms 2x and y have a fixed product: 2x × y = 2 × 200 = 400. By the AM–GM inequality, 2x + y ≥ 2√400 = 2 × 20 = 40.
  3. (a) Equality holds when the two terms are equal, 2x = y. Then x × 2x = 200, so x2 = 100, x = 10 and y = 20. The least fencing is 40 m, with ends of 10 m and a front of 20 m.
  4. The cost is 10 × 2x + 40y = 20x + 40y dollars. The product 20x × 40y = 800xy = 800 × 200 = 160000 is fixed, so 20x + 40y ≥ 2√160000 = 2 × 400 = 800.
  5. (b) Equality holds when 20x = 40y, so each term is half of 800: 20x = 400 gives x = 20, and 40y = 400 gives y = 10. The least cost is $800, with ends of 20 m and a front of 10 m. Check: 20 × 10 = 200 square meters, and 20 × 20 + 40 × 10 = 400 + 400 = 800.

answer(a) 40 m of fencing, with x = 10 m and y = 20 m; (b) $800, with x = 20 m and y = 10 m

techniqueThe Arithmetic Mean–Geometric Mean Inequality

Common pitfalls

  • Making the pen a square, about 14.1 m each way, because a square needs the least fencing for a closed rectangle. The wall saves one side, so the fencing is 2x + y, not 2x + 2y, and the square needs about 42.4 m.
  • Keeping the shape from (a) for (b). A meter of front costs four times a meter of end, so the terms to make equal are the costs 20x and 40y, not the lengths 2x and y; the cheapest pen has the short front.
05

A Cyclist's Ride to the Next Town and Back, Out Against the Wind: the Average Speed for the Round Trip

methodWork the Average Speed from the Total Distance and the Total Time, Compare It with the Mean of the Two Speeds by AM–GM, and Solve for the Return Speed a Target Needs

Ana cycles 30 km to the next town at 20 km/h against the wind, and back along the same road at 30 km/h with the wind behind her. (a) Find her average speed for the round trip. Then show that for any two speeds a and b over equal distances, the average speed 2aba + b is never more than the mean of the two speeds, a + b2, and say when the two are equal. (b) On a windier day she rides out at only 15 km/h. How fast must she ride back for her average speed over the round trip to be 20 km/h?

Out 20 km/h1.5 hBack 30 km/h1 hRound tripoutback60 km in 2.5 h60 km in 2.5 h: 24 km/h
Out takes 1.5 hours and back takes 1 hour, so the average is 60 ÷ 2.5 = 24 km/h.
The ride out takes 30 ÷ 20 = 1.5 hours and the ride back takes 30 ÷ 30 = 1 hour, so the 60 km take 2.5 hours. The average speed is 60 ÷ 2.5 = 24 km/h.
step 1 of 6

An average speed is the total distance divided by the total time, not the mean of the speeds. The AM–GM inequality, squared, compares the two, because the average speed over equal distances has the product ab on top.

  1. The ride out takes 30 ÷ 20 = 1.5 hours and the ride back takes 30 ÷ 30 = 1 hour, so the 60 km take 2.5 hours. The average speed is 60 ÷ 2.5 = 24 km/h.
  2. In general, a distance s each way takes sa + sb = s(a + b)ab hours. Dividing the total distance 2s by this time gives the average speed 2aba + b.
  3. By the AM–GM inequality, a + b2 ≥ √ab. Both sides are positive, so squaring gives (a + b)24 ≥ ab, which is (a + b)2 ≥ 4ab. Divide both sides by 2(a + b): a + b2 ≥ 2aba + b.
  4. (a) Her average speed is 24 km/h, less than the mean of the speeds, 25 km/h. The two are equal only when a = b, the equality case of AM–GM, so whenever the speeds out and back differ, the average speed is less than their mean.
  5. For (b), an average of 20 km/h over 60 km means 60 ÷ 20 = 3 hours in all. The ride out at 15 km/h takes 30 ÷ 15 = 2 hours, which leaves 1 hour for the 30 km back.
  6. (b) She must ride back at 30 ÷ 1 = 30 km/h. Check: 2 × 15 × 3015 + 30 = 90045 = 20. The mean of 15 and 30 is 22.5, more than 20, as the inequality in (a) says it must be.

answer(a) 24 km/h; the average speed is at most a + b2, with equality only when a = b; (b) 30 km/h

techniqueThe Arithmetic Mean–Geometric Mean Inequality

Common pitfalls

  • Answering 25 km/h in (a), the mean of 20 and 30. She spends longer at the slow speed, 1.5 hours against 1 hour, so the slow speed counts for more in the average.
  • Answering 25 km/h in (b), so that the mean of 15 and 25 is 20. The slow ride out already uses 2 of the 3 hours, so the ride back must be faster than that: 30 km/h.
06

A Truck's Cost for a 400 km Run in Wages and Fuel, and the Cheapest Speed With and Without a Speed Limit

methodWrite the Cost of the Run as a Term That Falls with Speed Plus a Term That Rises, Whose Product Is Fixed, Apply AM–GM, Then Write the Gap from the Least Cost as a Square to Handle the Limit

A haulage company pays a driver $36 per hour. At a steady v km/h its truck burns fuel costing v2100 dollars per hour. (a) Show that the cost of wages and fuel for a 400 km run at a steady v km/h is 14400v + 4v dollars, and use the AM–GM inequality to find the least cost and the speed that gives it. (b) One 400 km route has a limit of 50 km/h along its whole length. What is the least cost of a run on that route, and how much more is it than the least cost in (a)?

totalwagesfuel3090120240480speed, km/hcost = 14400/v + 4v dollars
The wages fall as the speed rises and the fuel rises; the total is 14400v + 4v dollars.
The run takes 400v hours, and each hour costs 36 + v2100 dollars. So the cost is 400v × 36 + 400v × v2100 = 14400v + 4v dollars.
step 1 of 5

Driving faster saves hours of wages but burns fuel faster. The wage term falls as the speed rises and the fuel term rises, and their product does not depend on the speed, so AM–GM gives the least total. When the speed that gives equality is not allowed, the gap from the least total, written as a square, shows which allowed speed comes closest.

  1. The run takes 400v hours, and each hour costs 36 + v2100 dollars. So the cost is 400v × 36 + 400v × v2100 = 14400v + 4v dollars.
  2. The product of the two terms is fixed: 14400v × 4v = 57600. By the AM–GM inequality, 14400v + 4v ≥ 2√57600 = 2 × 240 = 480.
  3. (a) Equality needs 14400v = 4v, so v2 = 3600 and v = 60. The least cost is $480, at 60 km/h. Check: at 60 km/h the wages are 1440060 = $240 and the fuel is 4 × 60 = $240.
  4. The limit rules out 60 km/h. The gap from the least cost is a square divided by v: 14400v + 4v − 480 = 4(v − 60)2v. Below 60 km/h, a lower speed makes (v − 60)2 larger and v smaller, so the gap grows, and the cheapest allowed speed is the limit, 50 km/h.
  5. (b) At 50 km/h the cost is 1440050 + 4 × 50 = 288 + 200 = $488, which is $8 more than in (a). Check: the gap is 4 × (50 − 60)250 = 40050 = 8.

answer(a) $480, at 60 km/h; (b) $488, which is $8 more

techniqueThe Arithmetic Mean–Geometric Mean Inequality

Common pitfalls

  • Making the fuel cost per hour as small as possible, which happens at the lowest speed. A slower run takes more hours of wages, so the cost of the whole run is what has to be made least.
  • Answering $480 in (b) as well. The bound from AM–GM is reached only at 60 km/h, which the limit rules out, so on that route the least cost is the cost at 50 km/h.
07

An Advertising Budget Shared by Search, Social Media and Radio: the Most New Customers, and the Budget for a Target

methodWrite the New Customers as the Dot Product of the Channel Weights with the Square Roots of the Spends, Bound It by Cauchy–Schwarz, and Make the Two Vectors Parallel for Equality

A shop models the new customers it gains from spending x dollars on one advertising channel as a√x, where a is 2 for search ads, 3 for social media and 6 for local radio. It has $4900 to spend across the three channels. (a) Use the Cauchy–Schwarz inequality to find the most new customers the budget can bring, and the spend on each channel that brings them. (b) What is the least budget that can bring 700 new customers?

2√x + 3√y + 6√z= (2, 3, 6) · (√x,√y,√z)
The new customers are the dot product of the weights (2, 3, 6) with the square roots of the spends.
Let the spends on search, social media and radio be x, y and z dollars, with x + y + z = 4900. The new customers number 2√x + 3√y + 6√z, the dot product of (2, 3, 6) with (√x, √y, √z).
step 1 of 6

The Cauchy–Schwarz inequality says that a dot product is never more than the product of the lengths of the two vectors, u · v ≤ |u| |v|, with equality only when the vectors are parallel. Here the length of one vector is fixed by the weights and the length of the other by the budget.

  1. Let the spends on search, social media and radio be x, y and z dollars, with x + y + z = 4900. The new customers number 2√x + 3√y + 6√z, the dot product of (2, 3, 6) with (√x, √y, √z).
  2. The first vector has length √22 + 32 + 62 = √49 = 7, and the second has length √x + y + z = √4900 = 70. By Cauchy–Schwarz the dot product is at most 7 × 70 = 490.
  3. Equality needs the vectors parallel: (√x, √y, √z) = k(2, 3, 6) for a number k. Then x + y + z = 4k2 + 9k2 + 36k2 = 49k2 = 4900, so k2 = 100, k = 10, and the square roots of the spends are 20, 30 and 60.
  4. (a) The most is 490 new customers, from $400 on search, $900 on social media and $3600 on radio. Check: 2 × 20 + 3 × 30 + 6 × 60 = 40 + 90 + 360 = 490, and 400 + 900 + 3600 = 4900.
  5. For a budget of B dollars the same argument gives at most 7√B new customers, reached by a split in the same proportions. To bring 700, the budget needs 7√B ≥ 700, so √B ≥ 100.
  6. (b) The least budget is $10000. With any smaller budget, even the best split brings fewer than 7 × 100 = 700 new customers.

answer(a) 490 new customers, from $400 on search, $900 on social media and $3600 on radio; (b) $10000

techniqueThe Cauchy–Schwarz Inequality

Common pitfalls

  • Splitting the budget in the ratio of the weights, 2 : 3 : 6. Equality needs the square roots of the spends in that ratio, so the spends themselves are in the ratio 4 : 9 : 36.
  • Putting the whole budget on radio, the strongest channel. That brings 6√4900 = 420 new customers, fewer than 490, because each extra dollar on one channel brings fewer customers than the dollar before it.
08

Three Parallel Cables Carrying 30 A from a Solar Array: the Least Heat They Can Lose, and What Losing One Cable Costs

methodWrite the Total Current as a Dot Product of Two Vectors, One Whose Length Holds the Heat Loss, Bound It by Cauchy–Schwarz, and Read the Best Division of the Current from the Equality Case

Three cables with resistances of 0.2, 0.3 and 0.6 ohms run side by side from a solar array to a battery, and between them they carry 30 A. A cable of resistance R ohms carrying I amps loses RI2 watts as heat. (a) Use the Cauchy–Schwarz inequality to find the least total heat the three cables can lose, however the current divides between them, and the current in each cable when the loss is least. (b) The 0.6 ohm cable is damaged and removed, and the other two carry the 30 A. By how much does the least heat loss rise?

0.2 ohmx0.3 ohmy0.6 ohmzx + y + z = 30P = 0.2x2+ 0.3y2+ 0.6z2
The three currents add up to 30 A, and the heat loss is the sum of RI2 over the cables.
Let the currents in the three cables be x, y and z amps, with x + y + z = 30. The total heat loss is P = 0.2x2 + 0.3y2 + 0.6z2 watts.
step 1 of 6

The Cauchy–Schwarz inequality, u · v ≤ |u| |v|, gives a lower bound on a sum of squares when a plain sum is fixed. Split each current into a part whose square is the heat loss and a part that depends only on the resistance, so that the dot product is the total current.

  1. Let the currents in the three cables be x, y and z amps, with x + y + z = 30. The total heat loss is P = 0.2x2 + 0.3y2 + 0.6z2 watts.
  2. Take u = (√0.2x, √0.3y, √0.6z) and v = (1√0.2, 1√0.3, 1√0.6). Their dot product is x + y + z = 30. The length of u is √P, and the length of v squared is 10.2 + 10.3 + 10.6 = 5 + 103 + 53 = 10.
  3. By Cauchy–Schwarz, 30 ≤ √P × √10. Square both sides: 900 ≤ 10P, so P ≥ 90 watts.
  4. Equality needs u parallel to v, so √RI = k√R in every cable, which is I = kR for one number k. Then 5k + 103k + 53k = 10k = 30, so k = 3.
  5. (a) The least loss is 90 W, with 3 ÷ 0.2 = 15 A, 3 ÷ 0.3 = 10 A and 3 ÷ 0.6 = 5 A in the three cables. Each cable then has the same voltage drop, RI = 3 volts, which is how current divides between cables joined side by side. Check: 0.2 × 225 + 0.3 × 100 + 0.6 × 25 = 45 + 30 + 15 = 90.
  6. (b) With two cables, the length of v squared is 5 + 103 = 253, so 900 ≤ 253P and P ≥ 108 W, with 18 A and 12 A. The least loss rises by 108 − 90 = 18 W. Check: 0.2 × 324 + 0.3 × 144 = 64.8 + 43.2 = 108.

answer(a) 90 W, with 15 A, 10 A and 5 A in the 0.2, 0.3 and 0.6 ohm cables; (b) it rises by 18 W, to 108 W

techniqueThe Cauchy–Schwarz Inequality

Common pitfalls

  • Sharing the current equally, 10 A in each cable. That loses 0.2 × 100 + 0.3 × 100 + 0.6 × 100 = 110 W, more than 90 W: the cable with the least resistance should carry the most current.
  • Taking the length of v squared as 0.2 + 0.3 + 0.6 = 1.1. The entries of v are 1√R, so their squares are 1R: 5, 103 and 53.
09

Two Sorting Programs and a Search Through Every Group on a Sensor Chip: Where One Program Overtakes the Other, and the Largest Job Each Finishes in a Second

methodCompare the Step Counts at Powers of 2, Where the Logarithm Is a Whole Number, Then Turn a Limit of One Second into the Largest n by a Square Root and by a Logarithm

A sensor chip carries out one million basic steps per second. To sort a list of n readings, program A takes 32nlog2 n steps and program B takes n2 steps. A third task, choosing the best group of readings by checking every possible group, takes 2n steps for n readings. (a) For which list lengths n ≥ 2 does B take fewer steps than A, and for which n do the two take the same number? (b) What is the largest n that B can sort, and the largest n for which the group search finishes, in no more than one second? What are these two numbers on a chip 64 times as fast?

B: n2A: 32 n log nreadings nB fewer when n < 32 log n
Dividing by n, B takes fewer steps than A when n < 32log2 n.
B takes fewer steps than A when n2 < 32nlog2 n. Divide both sides by n: n < 32log2 n, which compares n with a multiple of its logarithm.
step 1 of 6

A logarithm grows more slowly than any power of n, and an exponential grows faster than any power. So a count of nlog2 n steps, whatever number multiplies it, falls below n2 once n is large enough, and each extra reading doubles the work of the group search.

  1. B takes fewer steps than A when n2 < 32nlog2 n. Divide both sides by n: n < 32log2 n, which compares n with a multiple of its logarithm.
  2. Try powers of 2, where log2 n is a whole number. At n = 128: 32 × 7 = 224, more than 128. At n = 256: 32 × 8 = 256, equal. At n = 512: 32 × 9 = 288, less than 512.
  3. (a) The ratio nlog2 n is 2 at n = 2 and rises for every n ≥ 3, so it reaches 32 only once, at n = 256. B takes fewer steps for 2 ≤ n < 256, the two take the same number, 65536, at n = 256, and A takes fewer from then on.
  4. One second is 1000000 steps. For B, n2 ≤ 1000000 gives n ≤ 1000. For the group search, 2n ≤ 1000000 gives n ≤ log2 1000000 ≈ 19.9, so n ≤ 19: 219 = 524288 and 220 = 1048576.
  5. A chip 64 times as fast carries out 64000000 steps in a second. For B, n2 ≤ 64000000 gives n ≤ 8000. For the group search, 64 = 26 adds 6 to the logarithm: n ≤ 19.9 + 6 = 25.9, so n ≤ 25, since 225 = 33554432 and 226 = 67108864.
  6. (b) In one second B sorts up to 1000 readings and the group search handles up to 19. On the faster chip these become 8000 and 25: eight times as many readings for B, but only 6 more for the group search.

answer(a) B takes fewer steps for 2 ≤ n < 256, the same number at n = 256, and more for n > 256; (b) B sorts up to 1000 readings and the group search handles up to 19; on the faster chip, 8000 and 25

techniquePolynomial, Exponential and Logarithmic Growth

Common pitfalls

  • Concluding from small lists that B is always faster: at n = 16, B takes 256 steps and A takes 32 × 16 × 4 = 2048. The logarithm grows more slowly than n, so 32log2 n falls behind n in the end.
  • Multiplying the group search's 19 by 64, or by 8 as for B. Each extra reading doubles its steps, so a chip 64 = 26 times as fast buys only 6 more readings.
10

A Weather Model on a Finer Grid and Computers That Double in Speed: How Long Until It Runs in Time

methodWrite the Cost of a Finer Grid as a Power of the Refinement and the Computers' Speed as a Power of 2 in the Years, Then Set the Speed Against the Cost and Solve for the Unknown Index

A weather service runs its forecast model on a grid of points 10 km apart, and one run takes 1 hour. Making the spacing k times finer multiplies the running time by k4: there are k times as many points in each of three directions, and k times as many time steps. The service's computers double in speed every 2 years. (a) After how many years does the model with a spacing of 5 km first run in 1 hour? (b) What is the finest spacing at which the model runs in 1 hour after 24 years? A rival model's running time grows as k6 instead. What is the finest spacing at which it runs in 1 hour after 24 years?

Speed2 years2 years2 years2 yearsafter y years: 2y/2times as fast
The speed doubles once every 2 years, so after y years it has grown 2y/2 times.
The speed doubles once every 2 years, so after y years the computers are 2y/2 times as fast. A model k times finer runs in 1 hour when 2y/2 ≥ k4.
step 1 of 6

The computers' speed is an exponential in the years, while the cost of a finer grid is only a power of the refinement. Setting one equal to the other and writing both as powers of 2 turns the question into an equation between indices.

  1. The speed doubles once every 2 years, so after y years the computers are 2y/2 times as fast. A model k times finer runs in 1 hour when 2y/2 ≥ k4.
  2. A spacing of 5 km is k = 2 times finer, so the run takes 24 = 16 times as long. The computers must be 16 = 24 times as fast: 2y/2 ≥ 24, so y2 ≥ 4.
  3. (a) The 5 km model first runs in 1 hour after 8 years. Check: 8 years hold 4 doublings, and 24 = 16.
  4. After 24 years there are 12 doublings, so the computers are 212 = 4096 times as fast. The model needs k4 ≤ 4096, and 4096 = 212 = 84, so k ≤ 8. The finest spacing is 10 ÷ 8 = 1.25 km.
  5. The rival model needs k6 ≤ 4096, and 4096 = 212 = 46, so k ≤ 4. Its finest spacing is 10 ÷ 4 = 2.5 km.
  6. (b) After 24 years the model runs at a spacing of 1.25 km and the rival at 2.5 km. Both keep improving: k4 = 2y/2 gives k = 2y/8, and k6 = 2y/2 gives k = 2y/12, so a higher power only slows the exponential growth in k and never stops it.

answer(a) 8 years; (b) 1.25 km for the model, and 2.5 km for the rival

techniquePolynomial, Exponential and Logarithmic Growth

Common pitfalls

  • Taking the running time as twice as long when the spacing is halved. There are twice as many points in each of three directions and twice as many time steps, so the run takes 24 = 16 times as long.
  • Taking the computers as 2 × 12 = 24 times as fast after 24 years. Twelve doublings multiply the speed by 212 = 4096, not by 24.
Mr. Chalk Read the guide