Sum operator precedence

1k Views Asked by At

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?

1

There are 1 best solutions below

0
On BEST ANSWER

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*}

Hint: You might find chapter 2: Sums in Concrete Mathematics by R.L. Graham, D.E. Knuth and O. Patashnik helpful. It provides a thorough introduction in the usage of sums.