I have $N$ bank account and $B$ USD savings. For $i$ in $1, 2, 3, ..., N$, the balance of bank account $i$, denoted as $b_i$, is subject to the constraint of $l_i\leq b_i \leq u_i$. The 1-year interest rate of account $i$ is $r_i$.
Notes:
- $N$, $B$, $l_i$, $u_i$ and $r_i$ are known constants.
- The minimum incremental unit of $b_i$ is 1 cent.
- The balance can be either credit or debit, i.e., $b_i$ can be either negative or positive as long as it satisfies the constraint.
- $r_i$ is the interest rate for both borrowing and lending.
- $\sum_{i=1}^N b_i = B$.
- $\sum_{i=1}^N l_i <= B$.
- $\sum_{i=1}^N u_i >= B$.
Questions:
- How many possible ways are there to allocate my savings into the $N$ accounts? Or equivalently, how many different possible combinations of $b_i$ are there?
- Suppose the distribution of different possible combinations of $b_i$ is a uniform distribution. Define a random variable $R = \sum_{i=1}^N r_i\frac{b_i}{B}$. So $R$ is the 1-year return of my savings. What does the distribution of $R$ look like? What is the mean and variance of $R$?