# a moving average relation that I can't find a counter-example to

Hi: I'm new to this list but I had a question that's not exactly related to dsp but maybe in a slight way and I didn't know where else to send it. So, here goes and my apologies if this is totally the wrong place to send it.

The following describes the background as far as number generation.

Suppose have a series of positive numbers coming in sequentially ( regularly spaced ) that are generated by some invisible machine or oracle. no distribution is assumed for these numbers ( except that they are positive ) and they are generated at t1, ... tn. they are labelled as $x_1, x_2, ... x_n, x_{n+1}$. at each time $t$, the moving average with window size $n$ of the log of the $x_i$ is calculated and is labelled $mavelogx_t$.

the parameters of are $n$ and $d$. $n$ is the length of the moving average calculated at each time $t$. $d$ is positive and will be explained below.

The following describes the game for a player who decides to play given the above ( assuming that atleast n numbers have been generated by now so a moving average can be calculated ). It doesn't cost anything to play this game.

The player of the game sees a new number at time $tstar$, $x_{tstar}$, and if $log(x_{tstar})$ is $d$ less than the current moving average, $mavelogx_{tstar}$, then $x_{tstar}$ is marked as the player's "initial" number. like 36.83 or whatever. the game works so the next time $log(x_t)$ crosses the moving average, $mavelogx_{t}$, from below at say $t = tstarstar$, then $x_{tstarstar}$ is marked as the player's ending number and the game ends.

The game rule is such that at $t = tstarstar$, the game ends and the player receives $winnum$ = $log(tstarstar) - log(tstar)$ ( winnum could be negative in which the player of course pays ). Of course it could happen that the player never get an initial number or that the player gets an initial number and never gets an ending number but let's make the assumption that the player plays and the game both starts and ends.

Now, I claim ( and think I proved ) the following two things. ( really one because it's an if and only if ) are true for the player playing the game.

A) if $(tstarstar - tstar)$ turns out to be less than $n$, then $winnum$ has to be positive. similarly if $(tstarstar - tstar)$ turns out to be greater than or equal to $n$, then $winnum$ has to be non-positive.

and conversely

B) if $winnum$ is positive, then $(tstarstar - tstar)$ has to be less than $n$. similarly, if $winnum$ is not positive , then $(tstarstar - tstar)$ has to be greater than or equal to $n$.

I could send the proof to anyone who is interested but my questions were :

A) does anyone have a counter-example to disprove what I'm saying in A) or B).

B) if A) and B) are true ( my proof is correct ), then is this a well known result in the literature ( any literature. doesn't have to be DSP ) ?

thanks a lot. Mark

• The above description of your game is very difficult to understand. I would try to clarify it with a more succinct explanation. For instance, I don't see how $t^{**}$ could ever be less than $t^*$ according to your description, so $log(t^{**}) - log(t^*)$ would always be nonnegative. Jul 12, 2013 at 14:10
• sorry jason. my mistake. it should read that $winnum = log(x_{tstarstar})−log(x_{tstar})$. thank you for pointing that out. Jul 12, 2013 at 14:59
• also, a different explanation of the same problem is in the article at arxiv.org/abs/1212.4890. it's very long but might be clearer. thanks again. Jul 12, 2013 at 15:05