MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Minimize

  • To: mathgroup at smc.vnet.net
  • Subject: [mg93574] Re: [mg93562] Minimize
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Sat, 15 Nov 2008 06:03:30 -0500 (EST)
  • Reply-to: hanlonr at cox.net

You can always apply brute force:

data = Flatten[Table[{Abs[3^d + 5^f - 2^7], {d, f}}, {d, -5, 5}, {f, -3, 3}], 
   1];

{#[[1]], Thread[{d, f} -> #[[2]]]} & /@ 
 Select[data, #[[1]] == Min[data[[All, 1]]] &]

{{0, {d -> 1, f -> 3}}}


Bob Hanlon

---- Artur <grafix at csl.pl> wrote: 

=============
Dear Mathematica Gurus,
What Mathematica procedure to use to minimize expotential finction e.g.
Minimize[Abs[3^d + 5^f - 2^7], {d, f}]
where we can push: d and f are both Integers

NMinimize[Abs[3^d + 5^f - 2^7], {d, f}]
Mathematica answer is:
{2.66454*10^-14, {d -> 2.03248, f -> 2.96773}}

good answer is:
{d,f}={1,3}

Best wishes
Artur


--

Bob Hanlon



  • Prev by Date: Re: Minimize
  • Next by Date: Re: right hand side
  • Previous by thread: Re: Minimize
  • Next by thread: Basic programming