Re: Maximization problems
- To: mathgroup at smc.vnet.net
- Subject: [mg96753] Re: Maximization problems
- From: dh <dh at metrohm.com>
- Date: Tue, 24 Feb 2009 05:43:54 -0500 (EST)
- References: <gnm1q5$hi8$1@smc.vnet.net>
Hi, from your input, mma assunmes a domain of Reals. But then it can not evaluate the integer function Binomial. If you specify an Integer domain, mma will duly return (after a long time): {60, {b -> 10, m -> 10, s -> 10, a -> 10, n -> 10, r -> 10}} hope this helps, Daniel replicatorzed at gmail.com wrote: > Dear Group, > > consider a toy function 'func' of 6 parameters, and a set of > constraints 'cons' for this function: > > In[45]:= func[b_, m_, s_, a_, n_, r_] := Total[{b, m, s, a, n, r}]; > cons[b_, m_, s_, a_, n_, r_] := > And[3 <= a <= 10, 1 <= n <= 10, 1 <= r <= n, 3 <= b <= 10, > 1 <= m <= b, 1 <= s <= m, Binomial[b, m] <= a^n]; > > In[47]:= NMaximize[{func[b, m, s, a, n, r], > And[cons[b, m, s, a, n, r]] > }, {b, m, s, a, n, r}] > > Out[47]= {60., {b -> 10., m -> 10., s -> 10., a -> 10., n -> 10., > r -> 10.}} > > In[48]:= Maximize[{func[b, m, s, a, n, r], > And[cons[b, m, s, a, n, r]] > }, {b, m, s, a, n, r}] > > Out[48]= Maximize[{a + b + m + n + r + s, > 3 <= a <= 10 && 1 <= n <= 10 && 1 <= r <= n && 3 <= b <= 10 && > 1 <= m <= b && 1 <= s <= m && Binomial[b, m] <= a^n}, {b, m, s, a, > n, r}] > > While NMaximize gives the correct answer, Maximize is returned > unevaluated. If I remove the last constraint from cons, then Maximize > succeeds as well. Now why is it, that the symbolic method can't > maximize the function? Any idea? > > Istvan Zachar > >