Algorithm to find average position
- by Simran kaur
In the given diagram, I have the extreme left and right points, that is -2 and 4 in this case. So, obviously, I can calculate the width which is 6 in this case.
What we know:
The number of partitions:3 in this case
The partition number at at any point i.e which one is 1st,second or third partition
(numbered starting from left)
What I want:
The position of the purple line drawn which is positio of average of a particular
partition
So, basically I just want a generalized formula to calculate position of the average at any point.