score:15

Accepted answer

I would calculate changes between two consecutive numbers first. That can be done with Enumerable.Zip of same list by skipping first item. Then you can get changes which are moving up or changes which are moving down and calculate their average:

var changes = list.Zip(list.Skip(1), (x,y) => y-x); // [ 2, 3, -6, -1, 4, -3 ]
var averageUp = changes.Where(x => x > 0).Average(); // 3
var averageDown = changes.Where(x => x < 0).Average(); // -3.33

Related Articles