Given a set with a known cardinality, least upper and greatest lower bound; how can I calculate the maximum possible standard deviation for any set of values within the set.

As an example:

Given a set {1,50}, with mean of 25.5, the std. dev. for both members at 34.65.
This std. dev. is the possible for a set with a cardinality of **2**, greatest lower bound of **1**, and least upper bound of **50**.

Here are some examples I have calculated by hand:

F(**2**, **1**, **50**) = 34.65 (as above)

F(3, 1, 50) = 28.29

F(4, 1, 50) = 28.29

F(5, 1, 50) = 26.84

F(6, 1, 50) = 26.84

F(7, 1, 50) = 26.19

F(8, 1, 50) = 26.19