0
$\begingroup$

I have 4 variables.

$A= l{nq\choose l} {n(1-q)\choose n(1-q)-np+l}$

$B=(np-l){nq\choose l} {n(1-q)\choose n(1-q)-np+l}$

$C=(nq-l){nq\choose l} {n(1-q)\choose n(1-q)-np+l}$

$D=(n(1-q)-np+l){nq\choose l} {n(1-q)\choose n(1-q)-np+l}$

$l$ goes from $0$ to $np$, $p$ and $q$ are probabilities. So for example, $p=0.2, q=0.6, n=15$, we have $np=3, nq=9,n(1-q)=6,n(1-p)=12$.Also $np<nq$. When $np,nq,n(1-p), n(1-q)$ are fractions they are rounded off to their nearest whole number.

How can we optimise $A,B,C,D$ with respect to $l$ such that they try to attain their maximum value?

$\endgroup$
  • 2
    $\begingroup$ Please show us what code you have tried. $\endgroup$ – flinty Jun 16 at 14:48
  • $\begingroup$ Is there some reason to believe they all simultaneously can be maximized? Or is the goal to find values for l that maximize any one of them? $\endgroup$ – Daniel Lichtblau Jun 16 at 15:10
  • $\begingroup$ We need to optimise ABCD. Doesnt mean they have to be all be maximised. They should try to be "maximum" if that makes any sense. $\endgroup$ – newgirl Jun 16 at 15:31
1
$\begingroup$
p = 0.2; q = 0.6; n = 15;
a = l*Binomial[n q, l] Binomial[n (1 - q), n (1 - q) - n p + l];
b = (n p - l) Binomial[n q, l] Binomial[n (1 - q), n (1 - q) - n p + l];
c = (n q - l) Binomial[n q, l] Binomial[n (1 - q), n (1 - q) - n p + l];
d = (n (1 - q) - n p + l) Binomial[n q, l] Binomial[n (1 - q), n (1 - q) - n p + l];

(* maximize for each individually *)
NMaximize[{a, 0 < l <= n*p}, l]
NMaximize[{b, 0 < l <= n*p}, l]
NMaximize[{c, 0 < l <= n*p}, l]
NMaximize[{d, 0 < l <= n*p}, l]

(* maximize the product abcd *)
NMaximize[{a*b*c*d, 0 < l <= n*p}, l]
(* maximize the sum a+b+c+d *)
NMaximize[{a + b + c + d, 0 < l <= n*p}, l]
(* maximize the minimum *)
NMaximize[{Min[a, b, c, d], 0 < l <= n*p}, l]
| improve this answer | |
$\endgroup$
  • $\begingroup$ I did something similar to this except that I took only the product and optimised it. I have two questions here though. Taking the sum and the product is that enough? Also, I wanted a general result. Not for a specific p, q and n. How do I do this? $\endgroup$ – newgirl Jun 16 at 15:07
  • $\begingroup$ You could maximize the minimum instead of the sum or product. A general result is not possible. $\endgroup$ – flinty Jun 16 at 15:18

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.