Here is the IMO 2006.
I will focus on problem 3
Normally, you are expected to mathematically solve this problem. However, this problem is instructive in illustrating how an ounce of computation can save a pound of mathematics.
The problem is to determine the least real number M, such that the inequality holds for all a,b, and c.
Notice that this is equivalent to finding the maximum M such that the opposite of the inequality could hold.
using JuMP
using NLopt
function main()
model = Model(optimizer_with_attributes(NLopt.Optimizer,"algorithm" => :GN_ISRES))
#set_attribute(model, "algorithm", :GN_AGS)
set_attribute(model, "xtol_abs", 1e-12)
set_attribute(model, "constrtol_abs", 1e-12)
set_attribute(model, "ftol_abs", 1e-12)
@variable(model,-1000000<=a<=1000000)
@variable(model,-1000000<=b<=1000000)
@variable(model,-1000000<=c<=1000000)
@variable(model,-1000000<=M<=1000000)
@NLobjective(model,Max,M)
@NLconstraint(model, (M*(a^2+b^2+c^2)^2 + 1e-8) <= abs(a*b*(a^2-b^2) + b*c*(b^2-c^2) + c*a*(c^2-a^2)))
#set_optimizer_attribute(model, "constr_viol_tol", 1e-18)
#set_optimizer_attribute(model, "acceptable_tol", 1e-18)
JuMP.optimize!(model)
println(solution_summary(model))
println(value(M))
end
main()
The solution given is about 0.397747, which is pretty close to the actual solution 9sqrt(2)/32.