Let be the set of all real triples satisfying
Define the function
Let
Suppose can be written in the form in lowest terms, where and are positive coprime integers. Find the value of .
[THOUGHT] I will use Python to compute the maximum value of the function F over the vertices of the set S, then express that maximum as a fraction p/q in lowest terms and compute p^2 * q. [/THOUGHT]
[THOUGHT] I will enumerate all the vertices of the polyhedron defined by the constraints and evaluate the function F at each vertex to find the maximum value M. Then, I will express M as a fraction p/q in lowest terms and compute p² * q. [/THOUGHT]
[PYTHON] from itertools import combinations import numpy as np from fractions import Fraction
Define the planes: each plane is a tuple (a, b, c, d) for the equation ax + by + cz = d
planes = [ (1, 0, 0, 0), # x = 0 (0, 1, 0, 0), # y = 0 (0, 0, 1, 0), # z = 0 (1, 1, 0, 2), # x + y = 2 (1, 2, 0, 3), # x + 2y = 3 (1, 0, 1, 3), # x + z = 3 (0, 1, 1, 3) # y + z = 3 ]
Function F
def F(x, y, z): return -5x**2 - 4y2 - 6*z2 + 4xy - 2xz + 3yz + 20x + 14y + 15*z + 1
Check if a point (x, y, z) is in S
def in_S(x, y, z): if x < 0 or y < 0 or z < 0: return False if x + y > 2: return False if x + 2*y > 3: return False if x + z > 3: return False if y + z > 3: return False return True
Enumerate vertices by solving systems of 3 planes
vertices = [] for combo in combinations(range(7), 3): A = np.array([planes[i][:3] for i in combo]) b = np.array([planes[i][3] for i in combo]) try: sol = np.linalg.solve(A, b) x, y, z = sol if in_S(x, y, z): vertices.append((x, y, z)) except np.linalg.LinAlgError: continue
Evaluate F at each vertex and find maximum
max_val = -float('inf') for pt in vertices: val = F(pt[0], pt[1], pt[2]) if val > max_val: max_val = val
Convert max_val to fraction
frac = Fraction(max_val).limit_denominator() p = frac.numerator q = frac.denominator
Compute p^2 * q
result = p**2 * q print(result) [/PYTHON]