# How can I solve a constrained optimization problem with a random number of decision variables?

Here is my problem. Let $$A_t$$ be a random variable with Poisson-Binomial distribution with set of success-probabilities $$\{q_1^{(t)},\ldots,\,q_n^{(t)}\}$$, with $$t\in\{1,\,2,\,3,\ldots\}$$, $$n\in\mathbb{Z}^+$$, and $$n$$ fixed, i.e. not a random variable.

Let $$c$$ be a fixed, positive real number.

Let $$\{p_1,\,p_2,\,p_3,\ldots\}$$ be a sequence of decision variables, with $$p_t>c$$, for all $$t$$.

Define $$\pi_t(p_t)=A_t\cdot(p_t-c)$$, for all $$t\in\{1,\,2,\,3,\ldots\}$$. I would like to obtain the values of the decision variables $$\{p_1,\,p_2,\,p_3,\ldots\}$$ that maximizes the expected value of

$$\Pi_T(p_1,\,p_2,\,p_3,\ldots,\,p_T)=\sum_{t=1}^{T}\pi_t(p_t),$$

subject to $$p_t>c$$, for all $$t\in\{1,\,2,\,3,\ldots\}$$, where $$T$$ is a discrete random variable such that

$$\displaystyle\mathbb{P}(T=1)=\prod_{j=1}^{n}(1-q_j^{(1)})$$,

$$\displaystyle\mathbb{P}(T=2)=\left(1-\prod_{j=1}^{n}(1-q_j^{(1)})\right)\cdot\prod_{j=1}^{n}(1-q_j^{(2)})$$,

$$\qquad\qquad\vdots$$

$$\displaystyle\mathbb{P}(T=k)=\prod_{j=1}^{n}(1-q_j^{(k)})\cdot\prod_{w=1}^{k-1}\left(1-\prod_{j=1}^{n}(1-q_j^{(w)})\right)$$, for all $$k\in\{2,\,3,\,4,\ldots\}$$,

whereas $$\mathbb{P}(T=k)=0$$, for all $$k\notin\{1,\,2,\,3,\ldots\}$$.

Following the Law of Iterated Expectation,

$$\displaystyle\mathbb{E}\left(\Pi_T(p_1,\,p_2,\,p_3,\ldots,\,p_T)\right)=\mathbb{P}(T=1)\cdot\sum_{u=1}^{1}\mathbb{E}(\pi_u(p_u))+\mathbb{P}(T=2)\cdot\sum_{u=1}^{2}\mathbb{E}(\pi_u(p_u))+\cdots+\mathbb{P}(T=t)\cdot\sum_{u=1}^{t}\mathbb{E}(\pi_u(p_u))+\cdots,$$

where $$\mathbb{E}(\pi_u(p_u))=(p_u-c)\cdot(q_1^{(u)}+\cdots+q_n^{(u)})$$, for all $$u$$.

However, I could not solve the optimization problem from that point.

I would appreciate any help/approach to solve this optimization problem, please. I can program your suggested approach in R-software.

Thanks a lot.

• So, do you have an explicit (programmable) formula, that incorporates the required expected value, for the objective function you want to maximize? I think you do. if so, then throw it in a numerical optimizer, including all constraints - perhaps \$c \le p_t \le 1 ? you donlt need the gradient, but it's better to be able to evaluate it. Either derive the formula for the gradient, or use automatic differentiation to numerically evaluate the gradient. Perhaps use a bound-constrained trust reion or line search BFGS? If no gradient supplied, then finite-difference BGGS – Mark L. Stone Nov 9 '18 at 4:32
• Or use BARON global optimizer, which computes the gradient itself and finds globally optimal solution if if has enough time (and memory.) What values of T in the problems you want to solve?. At best, BFGS can only guarantee local optimum, not global optimum, because your objective function appears to not be concave. – Mark L. Stone Nov 9 '18 at 4:33
• Thanks a lot for your comments, @MarkL.Stone I was busy and I did not have time to read them. I will have a try with BARON global optimizer. Have a happy Thanksgiving day. – Student1981 Nov 22 '18 at 10:09