1

How do I represent the following sum of products using summation notation?

$$P = p_1 q_1 + p_2 (q_1+q_2) + p_3(q_1+q_2+q_3) + \dots $$

Here is my attempt: $P$ = $\sum_{i=1}^{n}{\{p_i\sum_{i=1}^{i}{q_i}\}}$

where $i = 1,2,...n$

Thanks

Note: what I am trying to capture in my equation is the sum of the product of a function 1 (p) with the cumulative sum of function 2(q) such that they both have the same number of elements

hkf
  • 113
  • 3
  • 1
    $\sum_{i=1}^{i}$ is confusing. The $i$ in the bottom is the summation variable, while the $i$ on top is an actual parameter. They should have different names: $\sum_{i=1}^{n}\left(p_i\sum_{j=1}^{i}q_j\right)$. –  Jul 25 '18 at 23:08
  • is there an alternate notation where introducing another parameter "j" can be avoided? – hkf Jul 25 '18 at 23:11
  • 2
    Determining the correctness of a proof or expression that reuses names to denote different things becomes very complicated very easily. That is a problem both for the writer and for the reader. You want to be understood and the correctness of your arguments to be easy to determine. That is why it should be avoided as much as possible, and some people opt to even prohibit it. –  Jul 25 '18 at 23:15
  • 1
    If you are a computer executing that formula and are given the value $i=3$ for the upper limit of the summation. Then to compute what to sum, you need to put $i=1$ as the first index and compute $q_1$. If you or someone reading interprets both $i$'s as the same storage unit (after all it is the same name), then the stopping condition for the summation would be $i>i$. Since this condition doesn't get satisfied, the summation never stops adding, while it was intended to have only $3$ terms. –  Jul 25 '18 at 23:28
  • ... or not run at all, if the stopping condition is checked before starting to add or if it is $i\leq i$. –  Jul 25 '18 at 23:34

1 Answers1

3

I would write it $$\sum_{i=1}^n\left(p_i\sum_{k=1}^i q_k\right)$$

which is the same as

$$\sum_{i=1}^n\left(\sum_{k=1}^i p_iq_k\right)$$

Or again (after inverting the two sum symbols)

$$\sum_{k=1}^n\left(\sum_{i=k}^n p_iq_k\right)$$

Note that you can not use the same summation index for two separate sums, it makes no sense. I chose the letter $k$ for the second sum, but you can use just any letter you would like (except $i$, $n$, and also $p$, $q$).

Suzet
  • 5,482
  • 12
  • 35
  • 2
    Why only letters? $\sum_{\clubsuit=1}^n p_{\clubsuit} \sum_{\diamondsuit=1}^\clubsuit q_{\diamondsuit}$ is a favorite of mine. – Clement C. Jul 25 '18 at 23:17
  • 1
    $\sum_{数=1}^n\left(p_数\sum_{学=1}^数 q_学\right)$ (just testing if this worked) – Suzet Jul 25 '18 at 23:20
  • @Suzet: Now you're just getting silly. Everyone knows that summation indices should use traditional characters. – Brian Tung Jul 25 '18 at 23:42
  • @BrianTung Oh right, silly me. Actually, I meant $\sum_{䨺=1}^n\left(p_䨺\sum_{龘=1}^䨺 q_龘\right)$ – Suzet Jul 26 '18 at 00:59
  • @Suzet: Hahaha. Even at maximum zoom that doesn't show clearly. (I know those famous characters, but still!) – Brian Tung Jul 26 '18 at 04:52