Question: 1. $(156)(234)= (16)(15)(24)(23)$ Even
2. $(17254)(1423)(154632)= (12)(13)(16)(14)(15)(13)(12)(14)(14)(15)(12)(17)$ Even

How is parity determined? Is it simply even when the # of transpositions is even and odd when the # of transpositions is odd?

I'm able to compute transpositions when the permutations are disjoint but otherwise run into problems. Any insight on this?

Answer: 
**Moving** average of `n` points: use [`conv`](http://www.mathworks.es/es/help/matlab/ref/conv.html):

```
data = [1 2 4 6 8 11 5];
n = 3;
result = conv(data, repmat(1/n, [1 n]), 'valid');

```

**Cumulative** average from the beginning to current position: use [`cumsum`](http://www.mathworks.es/es/help/matlab/ref/cumsum.html):

```
result = cumsum(data)./(1:numel(data));

```
If `list` is an array of numbers of the form `[a,b,c,...,z]` then we can simply take

```
average = sum(list)/length(list)

```

If you prefer not to have numbers entered as an array, you can do this:

```
function y = average(varargin)

    list = cell2mat(varargin);
    y = sum(list)/length(list);

```