MathGroup Archive 2012

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

Search the Archive

Re: Maximisation question


I'm guessing that you meant 100 <= i < 0 rather than 100 <= f(i) < 0

f[n_] := PDF[BinomialDistribution[100, .1], n]

Maximize[{f[j], 0 < j <= 100}, j, Integers]

{0.131865, {j -> 10}}

Maximize[{f[j], 0 < j <= 100, Element[j, Integers]}, j]

{0.131865, {j -> 10}}

If f and cons are linear or polynomial, Maximize will always find a
global maximum.  In cases where Maximize only finds a local maxima,
you can use an exhaustive search.

data = Table[{n, f[n]}, {n, 0, 100}];

Select[data, #[[2]] == Max[data[[All, 2]]] &]

{{10, 0.131865}}


Bob Hanlon


On Fri, May 18, 2012 at 5:23 AM, J.Jack.J. <jack.j.jepper at googlemail.com> wrote:
> For any integer j, suppose we have a function f(j). Then how would I
> find the highest f(i) such that 100 <= f(i) <0 ?
> With thanks in advance.
>



  • Prev by Date: Re: problem with Manipulate
  • Next by Date: Re: Maximisation question
  • Previous by thread: Maximisation question
  • Next by thread: Re: Maximisation question