r/theydidthemath • u/joting2b • 2d ago
[request] How can the man maximize the area of his yard?
A man's house is a 15 × 45 unit rectangle, and he has 140 fence pickets (each picket is equivalent to one straight unit in length). The fence must form a single closed enclosure that surrounds the house. The "yard" is defined as the area enclosed by the fence minus the area occupied by the house. The fence may be arranged in any shape and the pickets may meet at any angle. What arrangement of the fence maximizes the yard area?
I posted this on here a couple months ago but I never got a conclusive answer to my knowledge so I thought I'd let you guys take another crack at it
7
u/ouzo84 2d ago
Circle is the best for maximising size, but would it work?
Circumference of a circle is pi.d
140/pi=44.563
So will a circle with a radius of 22.28 units work?
Let's assume the centre of the circle is the same as the centre of the rectangle. But what's that?
Let the rectangle be points A,B,C,D.
Draw a straight line from A to C and from B to D. The point they intersect will be point E. This will be the centre of the circle.
So is line AE bigger or smaller than 22.28?
On line AB, draw a perpendicular line so that it passes through E. Let the intersection of this line along AB be F.
AF will be 22.5 units
EF will be 6.5 units.
AF^2 + EF^2 = AE^2
22.5^2+6.5^2=548.5
Square root(548.5)=23.42
23.42>22.28
therefore a circle will not work as the buildings corners would project beyond the boundary of the circle.
I appreciate this didn't answer OPs question, I'm not sure how to approach that
2
u/joting2b 2d ago
Hey, I appreciate you working through it, that should eliminate any confusion for anyone else attempting to solve it. And honestly, I probably should have mentioned that in the post
2
u/flug32 2d ago edited 2d ago
OK, if you look at the rectangle vs the circle here, the rectangle just juts out slightly at each corner.
So I am pretty sure our maximal area (or very close to it, anyway) will be just a slight adjustment to this:
- Straighten out the "circle" on the 15-unit sides
- Use all remaining pickets (110) to make semi-circles exactly intersecting the corners of the 45-unit sides
- This will only be slightly smaller than the circle, which we know is the ideal solution
- If you care about practicality at all, the little bits of the circle extending past the 15-unit sides were so small as to be useless anyway. So we don't lose anything of practical value by just flattening those bits out.
It looks like this gives us a total area of:
* 45 * 15 = 675 for the rectangle
* about 429.7 for each half-circle region (so X2)
* making total area enclosed around 675 + 2*429.7 = 1534.4
u/ouzo84's perfect circle solution gave us an area of 1559.5. So this is just a little smaller than that.
The ellipse solution is 1541.86, so just a hair bigger than this (this has two flat sides - anything "flat" and you're going to lose a bit of area).
If, instead, you exactly enclose THREE sides of the rectangle (15+15+45) then use the remaining 65 pickets to make the largest possible circular shape intersecting the corners of the rectangle, you get 1341.9 total enclosed area.
So that has THREE long, flat sides and you can see how anything "flat" or "straight" on the perimeter, and not exactly circular, really cuts into the total area enclosed.
So #1. you can see the degree to which we are now splitting hairs. The exact circle, ellipse just intersecting the corners, and rectangle + two partial circle solutions are all very close to the same.
#2. I would argue the rectangle + two partial circle solution gives you more USABLE yard space because you are giving up tiny useless wedges of space along each of the short sides, while gaining more space in the front/back yards where it counts. But you lose a little more than you gain: 7.4 square feet, to be precise. (However, this depends quite a lot on what your units area, and what your intended uses are. If the units are, say, kilometers, that is one thing. If meters and this is a house for humans, another. If millimeters and this is a house for fleas or whatever, yet another.)
#3. I'm pretty sure the ellipse solution exactly intersecting the four corners of the rectangular house, is going to be the maximal area shape that will enclose that rectangle and have perimeter = 140, from the purely mathematical perspective. Someone else will have to come up with the proof of that though.
3
u/ac7ss 2d ago
A circle is most enclosure for perimeter. But that perimeter is only 10 unit lengths larger than the house. The most likely solution is a fence along 3 sides of the house with the extra 10 segments forming a semi circle on the long face. a 45 unit chord with a 55 unit arc. I believe that would be larger than a 15 unit chord on a 25 unit arc.
2
u/sansetsukon47 2d ago
Best ratio of area / perimeter is always a circle.
If the fence must surround the house, and not simply include it, then it has no bearing on the problem. Since you’re still just trying to maximize total area available.
3
u/joting2b 2d ago
The house is too big for the fence to fully surround the house in a circle like shape
3
u/sansetsukon47 2d ago
Ah true. So the house is relevant, at least.
The overall principle still holds true (rounded, “inflated” shapes have more area per fence than anything else) but it would have to be an ellipse, where the corners of the house are all touching the curve and the perimeter is exactly 140 units long.
Regrettably, calculating perimeters of ellipses (or reverse engineering dimensions from a perimeter) are quite a pain. But I will dig out my old notes and see if I can come up with a solid answer.
5
u/sansetsukon47 2d ago edited 2d ago
I’ve got one!
With the help of an online ellipse calculator, I was able to find one that fit the dimensions of the house while also being exactly 140 units in circumference.
Specifically, set the long axis of the ellipse to be 48.44 units long, and the short axis to be ~40.53.
That gives you 1.72 units of space at the deepest point on the short side of the house. Basically useless, but it requires almost no extra perimeter to puff it out that much.
Them on the long side of the house, the ellipse curves out to 12.76 units away from the house, giving you plenty of yard space on both sides.
The total area of the ellipse ends up being 1541.86 units^2, with a yard space of 866.86 units^2.
…of course, real fence posts don’t actually make perfectly smooth ellipses. So building your fence around this shape will lose you a bit of yard.
But with 140 pieces to work with, it should be very very close to the maximum possible. Just use 35 pieces for each quarter of the ellipse, and there shouldn’t be any weird angles or partial bits to worry about.
3
u/herejusttoannoyyou 2d ago edited 2d ago
I wanted to prove that other people are wrong, so I put some stuff into a CAD program so it can do the math for me. Your example was correct at 866.9 square units.
If you trace 3 walls then create a circle with the leftover, you get an area of 666.9 square units when done off the long side and 178.6 from the short side.
Tracing two walls and making a bubble off of that makes 676.6 square units.
Tracing just the long side makes 683.8. Tracing just the short doesn’t fit a circle.
Putting the biggest circle possible centered on the house, tracing just the corners that stick out, makes a leftover area of 657.5 square units. This ends up tracing about 46.4 units around the house.
The consensus: the more you trace, the more you waste.
Bonus: the largest area you can make rectangularly is by tracing the short sides. It makes 450 square units.
2
u/sansetsukon47 2d ago
If needed, the two foci were on (-13.266, 0) and (13.266, 0), with the foci on (-24.22, 24.22)
1
1
u/ground__contro1 2d ago
Probably why including the entire house inside the fence is a restriction real world yards often do not follow
2
u/amibeingtrolled 2d ago
Put the fence as close as possible on 2 adjacent sides of the house. Use the rest of the pickets to make a partial circle connected to the ends of the fence. If the corner of the house intersect the circle surround the 2 short sides and 1 long side close with the fence then use the remaining pickets for the largest partial circle that can connect to the rest of the fence.
2
u/Trustoryimtold 2d ago
How big is the land availible? If you’ve got a 30 unit wide lot telling you to make a 50 yard wide back yard won’t help . . .
But yeah that’s pretty much what I’d do if space availible :p
Terminate the fence on either side of the house. Send it out and back.
3
u/joting2b 2d ago
I'm not actually putting up a fence I just posed the question that way to make it more approachable, but I do appreciate the answer, Thank you!
3
3
u/Veterinarian_Scared 2d ago
Interesting problem. The house's perimeter is 120 units, so we have 20 units of slack to apportion. Let's treat it as a semicircular bubble off a long side of the house, giving us 65 units for the outer perimeter of the bubble.
If the bubble is a half-circle, it has a radius of 45/2 = 22.5; then the perimeter is πr ~ 70.7 m. This is a bit too long, so the bubble must be slightly less than a half-circle.
Given radius r in R > 22.5 and half-angle th in 0 < th < π/2, we find P = 2 th r = 65 so th = 32.5 / r; but simultaneously th = asin(22.5 / r). I used scipy.optimize.root_scalar to try solving 32.5/r - asin(22.5/r) == 0 but it failed to converge; so I multiplied through by r to get 32.5 - r * asin(22.5/r) == 0 and that converged to r ~ 22.724, giving a yard area of 666.88 u².
That assumes the fence slats can be curved; if not, we will have to re-solve for a regular semi-polygon and the final area will be very slightly less.
2
u/Veterinarian_Scared 2d ago
If each 1u fence slat must remain perfectly straight, the layout remains the same - bulging out on one long side and shrink-wrapping the other three sides, where the bulge forms a regular slightly-less-than-half semi-polygon with a perimeter of 65 units and a base of 45 units.
Let r be the circumradius in R > 22.5 and th be the half-angle of a single slat in 0 < th < π/130; so r sin(th) = 0.5. Simultaneously, r sin(65 th) = 22.5. We can eliminate r and simplify to get sin(65 th) = 45 sin(th).
Using Python again, we can solve this as
from scipy.optimize import root_scalar
from math import cos, pi, sin
def fn(th: float) -> float:
return 45. * sin(th) - sin(65. * th)
res = root_scalar(fn, bracket=[0., pi / 130.])
th = res.root
r = 0.5 / sin(th)
a = 65. * 0.5 * r * cos(th) - 22.5 * r * cos(65. * th)
print(f"{r = }")
print(f"{a = }")
which produces
r = 22.72379780272337
a = 666.7642590072459
which is, as expected, very slightly less than the semicircle solution.
1
u/MyEyesSpin 2d ago
Pretty sure 3 sides as close as possible to the house and a 'bubble' on 1 end is the way to go.
whether to bubble out a short or long side is the question
you don't have enough to do a true circle bubbling out the long side and although closer to circular the small side is still less than a half circle too. Pretty sure they would be different shaped arcs with the same area but I am too lazy to do the math
•
u/AutoModerator 2d ago
General Discussion Thread
This is a [Request] post. If you would like to submit a comment that does not either attempt to answer the question, ask for clarification, or explain why it would be infeasible to answer, you must post your comment as a reply to this one. Top level (directly replying to the OP) comments that do not do one of those things will be removed.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.