I know that there is a way to "redistribute the frequencies of a variable" as stated here:
Slide number 14 and 15 about redistribution
and here:
Dorian Pyle book chapter 7 section 2 paragraph 3 (7.2.3):
The easiest way to adjust distribution density is simply to displace the high-density points into the low-density areas until all points are at the mean density for the variable. Such a process ends up with a rectangular distribution.
Illustrating this passage are figures like these:
In both the references the problem is clear and solved but does not provide sufficient information for writing an algorithm and in particular does not say how to calculate the displacement (the way to move the frequencies on the left or right of the center of the distribution).
Please can you help me to understand it ??