# NMinimize is wrong : why?

Consider the following code:

A = 575;
B = 291;
pMeBis[k_, delta_, nAvg_] :=
1/Binomial[A,
2]*(Binomial[A,
2]*(delta/Binomial[A, 2] + Pi^2/16*(B^k)/nAvg))^(2^k)
NMinimize[pMeBis[k, 0.9, 10^31], k \[Element] Integers]


It tells me: {0., {k -> 8}}

So the minimal value is for k=8.

However, I have:

In[24]:= pMeBis[8, 0.9, 10^31]

Out[24]= 1.17111*10^-17

In[25]:= pMeBis[10, 0.9, 10^31]

Out[25]= 2.02939*10^-31


Thus, Mathematica is wrong. Why is it so ?

The numerical portion of the NMinimize function likely gets confused with all the large powers of 10. Try the non-numeric version instead, making sure to use only integers or rational numbers, so it does not convert to numerics automatically:
Minimize[pMeBis[k, 9/10, 10^31], k ∈ Integers]//N

NMinimize finds the solution if you increase the WorkingPrecision
NMinimize[pMeBis[k, 0.9, 10^31], k \[Element]Integers,WorkingPrecision -> 50]