1
$\begingroup$

I have been trying to get the ArgMin function to work so that I can find the value of $s$ that minimizes this function:

$$ f(s)=e^{-sa}\left(pe^s+(1-p)\right)^n\style{font-family:inherit;}{\text{, where }} 0<p<a<1 \style{font-family:inherit;}{\text{ and }} n\in\mathbb{N} $$

This is what I have tried:

ArgMin[{Exp[-s*a]*(p*Exp[s]+(1-p))^n,0<p<1,0<a<1,p<a,n>0,n \[Element] Integers},s]

But it just outputs exactly what I entered:

enter image description here

I am expecting this as the answer:

$$ \underset{s>0}{\operatorname{ArgMin}}\left[f(s)\right]=\text{Solve}\left[\left(\frac{d}{ds}f(s)\right)==0,s\right]\Longrightarrow e^s=\frac{a(1-p)}{np(1-a)} $$

$$ \Longrightarrow \underset{s>0}{\operatorname{ArgMin}}\left[f(s)\right]=\text{ln}\left[\frac{a(1-p)}{np(1-a)}\right] $$

I get the correct output "Log[3]", when I specify values:

f[p_,a_,n_]:=ArgMin[{Exp[-s*a]*(p*Exp[s]+(1-p))^n,0<p<1,0<a<1,p<a,n>0,s>0,n \[Element] Integers},s];
Print[f[1/2,3/4,1]]

This has me thinking that the symbolic answer that I want is there but how do I get it printed that way?

$\endgroup$
  • 2
    $\begingroup$ ArgMin only works for functions that give a numeric output. The documentation should be more precise about this. $\endgroup$ – Natas Aug 21 at 19:15
  • $\begingroup$ @Natas So does that mean I will have to make an ArgMin function from scratch that works with symbolic input? $\endgroup$ – Landon Aug 25 at 6:02
  • $\begingroup$ Yes, that would be the conclusion. Note however that the reason for this not being implemented is because it is difficult to find a solution that works for all possible input. You could always just take the derivative, set it to zero and check if it makes sense. Solve[D[Exp[-s*a]*(p*Exp[s] + (1 - p))^n, s] == 0, s](*{{s\[Rule]Log[(a (-1+p))/((a-n) p)]}}*) $\endgroup$ – Natas Aug 25 at 6:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.