this is my first post on Math-Exchange. I'm a programmer, and I work with object-oriented algorithms, but when things gets too "algebraic" I get stuck. So I thought I'd ask over here.
I need to create an algorithm that would parse an array of numbers and calculate the 'High', 'Mid' and 'Low' ranges from two constants: $L$ = lowest number in the given array; and $H$ = highest number.
Suppose I have an array of numbers, with 1 being the lowest; and 6 being the highest:
I need to calculate:
"High range": 5 to 6
"Mid range" : 3 to 4
"Low range" : 1 to 2
Basically it's a plain old Arithmetic Median Average, but with 2 medians, instead of one.
So far when I parse through each number to determine its group, I only came up the "Star Rating" formula
assigned_group = ((target_number / max_value) / 3)
but this only works if the lowest number is 1, and I need it to be dynamic.
Thank you in advance.