1

I am trying to evaluate the following expression.

Minimize[
  {Abs[Log[10, 1 - 0.9] - (11 Log[10, 1 - 0.68^x] + 9 Log[10, 1 - 0.74^y])], 
   x >= 0, y >= 0, x <= 20, y <= 20}, 
  {x, y}, Integers]

I want the values of x and y that minimize the above function, but I get the following error:

The function value Indeterminate is not a number at {x,y} = {19.265, 0.0547502}

When I evaluate without the Integers specification, I get the answer

{1.55673*10^-10, {x -> 15.8488, y -> 4.97415}}

I need x and y to be integers in my formulation. Could someone please guide me in the correct direction?

I do not have a strong math background, so I would really appreciate the explanation in layman's terms.

m_goldberg
  • 107,779
  • 16
  • 103
  • 257
p1988
  • 23
  • 3
  • Try again but with exact values in place of the decimal values: i.e. replace 0.68 with (68/100) and so on. – march Oct 30 '15 at 05:54
  • It works! Thanks!! Any idea why this is a problem? – p1988 Oct 30 '15 at 06:06
  • Not exactly, other than that Mathematica has a lot of symbolic computing machinery built into it that it can sometimes use to solve problems symbolically, but when inexact numbers are used in the expressions, it defaults to numerical routines, which can be a little fiddly. – march Oct 30 '15 at 06:07
  • Well, I wish I had asked this question 5 days ago when I first encountered the problem :), thanks again! – p1988 Oct 30 '15 at 06:09

0 Answers0