# Sum operator precedence

I'm trying to read some simple equations and in order to interpret them in the right way I need to know $$\sum$$ and $$\prod$$ operator range/precedence.

$$\sum p(s, a) +\gamma$$

is equal to $$\sum(p(s,a) + \gamma)$$ or $$\sum(p(s,a)) + \gamma$$.

The same question is for product operator.

Also, for UCB1 formula

$$A_t = \underset{a\in\mathcal{A}}{\operatorname{argmax}} Q_t(a) + \sqrt{\frac{2\log t}{N_t(a)}}$$

should I treat it like this

$$A_t = \underset{a\in\mathcal{A}}{\operatorname{argmax}}\Bigl( Q_t(a) + \sqrt{\frac{2\log t}{N_t(a)}} \Bigr)$$

or like this?

$$A_t = \underset{a\in\mathcal{A}}{\operatorname{argmax}}\Bigl( Q_t(a) \Bigr) + \sqrt{\frac{2\log t}{N_t(a)}}$$

Could you please clarify those for me?

• For $A_t$ it is the first option since the root term depends on $a$ which is iterated by $\text{argmax}$. In other words $a$ cannot appear outside $\text{argmax}$ like it does in the second option. For the sum I think it depends on the context.
– user519413
Mar 22, 2019 at 12:50

The $$\sum$$ operator and $$+$$ have the same precedence level, so \begin{align*} \sum p(s, a) +\gamma &=\left(\sum p(s,a)\right)+\gamma \end{align*} contrary to
\begin{align*} \sum p(s, a) \cdot\gamma &=\sum \left(p(s,a)\cdot\gamma\right) \end{align*}
The $$\max$$ operator binds stronger than the $$+$$ operator, so \begin{align*} \underset{a\in\mathcal{A}}{\operatorname{argmax}} Q_t(a) + \sqrt{\frac{2\log t}{N_t(a)}} &=\left(\underset{a\in\mathcal{A}}{\operatorname{argmax}} Q_t(a)\right) + \sqrt{\frac{2\log t}{N_t(a)}} \end{align*}