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.