Lets say I have a random number generator that spits out uniform numbers from 0 to 1Next, I have a shape defined by a series of vertices, like { [0, 0.4], [0.5, 0.2], [1, 0.4] }In those vertices, the first value determines the position and second the  distribution weight in that point (interpolated in between).Now I need a magic function to redistribute the uniform random numbers into a distribution that would statistically match the shape of the vertices provided. Essentially, if I were to run 10000 random numbers through the function, sort them into buckets like { [0 - 0.1], [0.1 - 0.2] ... } and count the buckets so that [x = x, y = count], it should produce a shape similar to if I were to use the original shape as [x, y].To illustrate ms paint at its finest. Anyways, the question - I'm looking for an algorithm to build that magic function. The shapes that I want to feed it would be based on real world statistics which often don't fit any of the neat looking distributions like gauss or normal, I've seen all kinds of wonky lines.
Redistributing a set of uniformly distributed numbers to an arbitrarily defined shape
algorithms;sets;statistics