Fawn Nguyen, a middle school math teacher, (@**fawnpnguyen** on Twitter) has a post on her website about a grading issue that leads to some interesting mathematics.

Fawn writes:

Put these numbers in order from least to greatest: 5, 7, 2, 3, 1, 4, 6, 8

The correct order is 1, 2, 3, 4, 5, 6, 7, 8 (you’re welcome) — for a possible score of 8 points. How many points would this response earn?1, 2, 4, 5, 3, 7, 8, 6

and she then discusses various methods for scoring different answers.

What metrics might we devise to measure the discrepancy between an answer and the correct answer, and assign a grade – perhaps a % – to any given answer?

I guess one question that comes to mind is how do we give a measure to the notion of just *how different* the arrangement 1, 2, 4, 5, 3, 7, 8, 6 is from the correct arrangement 1, 2, 3, 4, 5, 6, 7, 8 ?

Perhaps it helps to visualize these two different arrangements – the student answer versus the correct arrangement:

We can see directly from this plot that the total numerical size of the “error” – the sum of the absolute value of the difference between each place of the correct arrangement and the student arrangement – is 1+1+2+1+1+2 = 8.

If we think of this number as the *discrepancy* of the student arrangement, a discrepancy of 0 would indicate a correct arrangement.

How good, or bad, is a discrepancy of 8?

One way we might think about this is to note that any student arrangement will be a *permutation* of the numbers 1, 2, 3, 4, 5, 6, 7, 8.

There are 8! = 40320 permutations of the numbers 1 through 8.

What is the maximum possible discrepancy of a permutation of the numbers 1 through 8, and how does a discrepancy of 8 compare with that?

We can do a calculation in *Mathematica* as follows:

**A = Permutations[Range[8]];**

**B = Table[Abs[A[[i]] – Range[8]], {i, 1, Length[A]}]**

**B = Map[Total, B]**

**Max[B]**

with the result: 32

So the maximum possible discrepancy is 32 (and the minimum is 0).

One way we might score the student arrangement with discrepancy 8 is to give it a grade of (32-8)/32 = 3/4 = 75%, which would correspond to 6 points out of a possible 8 in Fawn’s points system.

What other arrangements might earn an identical score?

There are 327 permutations of the numbers 1 through 8 that have a discrepancy of 8: click here to see a list of the whole 327 permutations with discrepancy 8.

The possible values for the discrepancy of a permutation of the numbers 1 through 8 are just the even numbers from 0 through 32.

There are just 7 permutations wth discrepancy 2:

Using the grade assignment scheme above, each of these 7 arrangements would score (32-2)/32 = 15/16 which rounds to 94%, giving a score of 7.5 points out of 8.

There are 576 arrangements of the numbers 1 through 8 with discrepancy 32. An example is 5, 6, 8, 7, 2, 4, 1, 3. The scoring scheme would give this arrangement a score of (32-32)/32 = 0%.

An arrangement with discrepancy 10 would get a score of 69% (5.5 points out of 8), and one with discrepancy 9 would get a score of 72% (5.75 points out of 8).

There are 765 arrangements with discrepancy 10, and an example is {6, 2, 3, 4, 5, 1, 7, 8}. Compare the score of 69% for this arrangement with the simpler method of counting how many numbers are in the right place: 6/8 = 75%.

Does any of this make any sense? Is it of any use?

That depends, of course, on what the aim was of constructing a scoring method to assess student arrangements.

I think it would be a neat study to look at young children’s efforts to see what arrangements they actually made, and why, and how that matched with this method of scoring arrangements via the discrepancy.

BTW, it’s easy enough to automate this procedure for arrangements of numbers 1 through n, using a tool such as *Mathematica*, or the free computational language *Sage* (or *Python*).

Thanks to Fawn for a most interesting question!