I am confused about the workings of the first- and every-visit MC.
My first question is, when we have multiple traces, do we average over traces or the total number of times we have visited that state?
So, in the example:
$$\tau_1 = \text{House} +3, \text{House} +2, \text{School} -4, \text{House} +4, \text{School} -3, \text{Holidays}$$ $$\tau_2 = \text{House} -2, \text{House} +3, \text{School} -3, \text{Holidays},$$
where we have states of either House, Holidays, or School, with the numerical values being the immediate rewards.
For every-visit MC to find the state value of HOUSE, with $\gamma$=1, my intuition would be to create a return list, R, that looks like the following
$$R_1=[3+2−4+4−3, 2−4+4−3, 4−3]= [2, −1, 1]$$ $$R_2=[−2+3−3, 3−3]=[−2, 0]$$
$$R_1+R_2=[2,−1, 1,−2, 0]$$
which, when averaged over 5 visits, is 0 and the correct answer, but I would like if you could confirm if the methodology is correct?
However, another approach would be to compute the average returns for each trace. Which is correct?