So, Gauss supposedly did this as a child.

there's some hypothesis that this story's apocryphal, but whatever.

Let's, for, for our purposes, let's assume he did it when he was a kid.

So, the story goes, is that his teacher asked

him to add up the numbers between 1 and 100.

And he went down and sat at his desk, and just came back with the answer.

And the teacher said, that's not possible, how did you do that?

And then he went and really did it and got the same answer.

Any rate

I think the story's probably apocryphal, but here

it's really a neat way to show it.

Is we could write x is the sum of the digits from

1 to n, 1 plus 2 plus 3 and, in that way.

Or we could write it as n, plus n minus 1, plus n minus 2.

It's the same exact thing all the way down to 1.

So, if you add the two together, you get 2x equals, and in this case, notice

1 plus n is n plus 1, 2 plus n minus 1 is n plus 1,

3 plus n minus 2 is n plus 1, and so on.

And so this, so 2x is n times n plus 1, which is exactly what's happening here as

the number n plus 1 added up n times, so it's n times n plus 1, so then x has

to be n times n plus 1 over 2.

Okay, so, let's let W be the sum of the ranks for the first treatment.

And then, you know, if,

if a treatment has more numbers in it

then it's, under the null hypothesis it's going to have

a higher sum just by virtue of having more numbers, so we need to know NA and NB.

the number in each sample and it turns out that the expected value of the sum

of the ranks under the null hypothesis from

the first group works out to be this guy.

Na times nA plus nB plus 1 divided by 2

and so one with a standard error given by this guy.

And then we could create a test statistic which is our

W, our sum of our ranks in our first

group minus it's expected value divided by its standard error.

Turns out to be normal 01, of course you

can calculate the exact distribution as we described before.