Given a uniform random number generator that works in O(1), generating a random floating point number on the interval [0..1), how could I generate a random integer on a range [a..b] where a and b are integers, and I expect the average value generated over a large number of iterations to be c, where c is a floating point number on the interval (a..b)?
I've looked over similar questions already on StackOverflow, such as this, this, and this, but they seem to each have a different focus than what I am after.
Edit: my apologies for stating what is evidently an unclear question. I want a function that takes three parameters, a, b, and c and generates a random number between and n such they the expected average if it were repeatedly being called with the same values would be c. For example, if a and b were 0 and 10, and a value of 2.5 was given for c, then the function would tend to produce smaller numbers (ie a skewed but otherwise normal distribution with an average of 2.5 over a large number of calls), while if c were 5, the distribution of values it produces would be more uniform. The solution must also be self contained and not depend on the availability of any other functions than the uniform random number generator. Choice of programming language is largely immaterial, any imperative c-like pseudo code would be fine. Note further that there should be no loops, and that it should complete in O(1) time