linear prefix average
disjoint 2 different functions