My understanding in this concept is for the current day temperature approximation, you basically takes the average of the last 1/(1-beta) terms.

When you are increasing beta close to 1 you are taking more number of last terms into account, that smoothens and gives more importance to previous terms and less importance to the current term.

and

Prof Ng said the value of the previous terms reduces to 1/3 after (1/1-beta) days. So, are we taking into account only the 1/(1-beta) terms for calculating the average or we are just saying that the values of the previous terms decreases to 1/3 after (1/1-beta) terms and take into account all the terms for calculating the average?

I have attached the implementation too.

Please correct me If I am wrong in my understanding or Implementation