Let A, B, C be angles of a triangle. Find the maximum value of sin A * sin2 B * sin3 C without using calculus.
I started with a brute force program varying each of A and B between 1 and 180 degrees, then from those results, narrowed it down further.
The sum [A,B,C]
0.482909497589192 [45, 63, 72]
0.4829906831389317 [45.0, 63.4349, 71.5651]
---
def score(tri):
prod = 1
for index,angle in enumerate(tri):
power = index+1
prod *= (math.sin(angle*pi/180))**power
return prod
maxscore = 0
best_tri = []
for a in range(1,181):
for b in range(1,181):
c = 180-a-b
if c<1:
break
tri = [a,b,c]
sco = score(tri)
if sco > maxscore:
maxscore = sco
best_tri = tri
print(maxscore, best_tri)
maxscore = 0
best_tri = []
for a_index in range(-100,100):
a = 45 + a_index/100
for b_index in range(-10000,10000):
b = 63 + b_index/10000
c = 180-a-b
if c<1:
break
tri = [a,b,c]
sco = score(tri)
if sco > maxscore:
maxscore = sco
best_tri = tri
print(maxscore, best_tri)
|
Posted by Larry
on 2025-05-05 09:33:20 |