1. Function expression needed

Hi.
I have a task to make a computer program that tests and grades pupils in one school on the following way:
There are 5 grades: 1,2,3,4 and 5;
All the pupils in a class are examined, and they get a score (maximum is 100);
Let's say that MIN is minimal score a pupil got, and MAX is maximum score a pupil got in that class (of 100 possible);
Let's say that DIFF is whole range between MAX and MIN;
Let's say that RANG=(MAX-MIN)/5;
Let's say that X is mean of all scores in a class;
Let's say, taht:
For grade 3, pupil must have score between X-0.5*RANG and X+0.5*RANG;
For grade 4, pupil must have score between X+0.5*RANG and X+1.5*RANG;
For grade 5, pupil must have score over X+1.5*RANG;
Similar,
For grade 2, pupil must have score between X-1.5*RANG and X-0.5*RANG;
For grade 1, pupil must have score below X-1.5*RANG.

I already made the computer program, but for my presentation I need to present the method and the algorithm, so I need a function expression (formula) - of X and RANG - that describes the method.
Any help?

2. Re: Function expression needed

Originally Posted by sasam1400
Hi.
I have a task to make a computer program that tests and grades pupils in one school on the following way:
There are 5 grades: 1,2,3,4 and 5;
All the pupils in a class are examined, and they get a score (maximum is 100);
Let's say that MIN is minimal score a pupil got, and MAX is maximum score a pupil got in that class (of 100 possible);
Let's say that DIFF is whole range between MAX and MIN;
Let's say that RANG=(MAX-MIN)/5;
Let's say that X is mean of all scores in a class;
Let's say, taht:
For grade 3, pupil must have score between X-0.5*RANG and X+0.5*RANG;
For grade 4, pupil must have score between X+0.5*RANG and X+1.5*RANG;
For grade 5, pupil must have score over X+1.5*RANG;
Similar,
For grade 2, pupil must have score between X-1.5*RANG and X-0.5*RANG;
For grade 1, pupil must have score below X-1.5*RANG.

I already made the computer program, but for my presentation I need to present the method and the algorithm, so I need a function expression (formula) - of X and RANG - that describes the method.
Any help?
This is only a suggestion and you have to modify the term of the function and especially the domain.

MAX = 95
MIN = 35
MEAN = X = 55
RANG = 12

The distribution of the score-points is described by:

$P(n) = (X + \frac12 \cdot RANG)+RANG \cdot \lfloor{n-3}\rfloor$

The function $f(x)=\lfloor x \rfloor$ is called the floor function. Google for it.

I've attached the graph of the function. The red line represents the mean value. As you can see you have to do some additional work.

3. Re: Function expression needed

Thank you for the effort, but i need it reversed.
You see, let's have your assumptions, max=95; min=35, mean=55; rang=12.
Which grade gets a student who scores, let's say, 51?
I need function (equation) that calculates something like:
In this case the grade would be 3, but i need an expression that would be applicable for all possible scores between min and max, and where result would be grade (1 to 5).

4. Re: Function expression needed

Originally Posted by sasam1400
Thank you for the effort, but i need it reversed.
You see, let's have your assumptions, max=95; min=35, mean=55; rang=12.
Which grade gets a student who scores, let's say, 51?
I need function (equation) that calculates something like:
In this case the grade would be 3, but i need an expression that would be applicable for all possible scores between min and max, and where result would be grade (1 to 5).
Let s denote the individual score of a student. Then the grade he gets is calculated by:

$G(s)=\left\lfloor \dfrac{s-MEAN}{RANG}\right\rfloor+3$

Example:

s = 73 then

$G(73)= \left\lfloor \dfrac{73-55}{12}\right\rfloor+3 = \left\lfloor \dfrac{18}{12}\right\rfloor+3 =1+3=4$

(Much to my surprise it seems to work ...)

5. Re: Function expression needed

It doesn't work on border-scores, like 60 and 61... (grade fo score 60 is 3, ad for 61 should be 4)
However, i noticed that it works if instead of FLOOR i use ROUND (i think as a computer thinks)...
How would you write the same expression with ROUND?
(there's another issue, but i'll come out with it later)