# Question:When GlobalOpimization is wrong , but Optimization is right!

## Question:When GlobalOpimization is wrong , but Optimization is right!

Maple 2019 , Global Optimization

first I define some constants (note I may change the constants later based on the context of the application)

p_l := 10^(-15);
epsilon := 1.09*10^(-10);
p_B := 1.09*10^(-8);

n_A := 10^7;
k_A := 0;
n_B := 10^8;
k_B := 0;

then I define a function l(x,y):

l := (x, y) -> x^k_A*(1 - x)^(n_A - k_A)*y^k_B*(1 - y)^(n_B - k_B)

Now I use both with(GlobalOptimization) and with(Optimization) to maximize l(x,y) give some constraints and I get:

GlobalSolve(l(x_1, y_1), x_1 = p_l .. epsilon, y_1 = p_B .. 1, maximize, initialpoint = [x_1 = 0, y_1 = 0]);
[-0., [x_1 = 1.09000000000000 10^(-10)   , y_1 = 0.633548870211381]]

Maximize(l(x_1, y_1), x_1 = p_l .. epsilon, y_1 = p_B .. 1, initialpoint = [x_1 = 0, y_1 = 0]);
[0.33621648834727435318,  [x_1 = 1.00000000000000 10^(-15)   , y_1 = 1.0900000000000000000 10^(-8)  ] ]

Clearly the second answer is right and the first is wrong... I am not sure why the ``global optimazation'' is doing worse than the normal and free ``optimazation''.. Am I using the GlobalSolve in a wrong way??

﻿