Generating random numbers under very specific constraints
Start by generating as many identical tuples, n, as you need:
(A/n, B/n)
Now pick two tuples at random.  Make a random change to the a value of one, and a compensating change to the a value of the other, keeping everything within the given constraints.  Put the two tuples back.
Now pick another random pair.  This times twiddle with the b values.
Lather, rinse repeat.
I am faced with the following programming problem. I need to generate n (a, b) tuples for which the sum of all a's is a given A and sum of all b's is a given B and for each tuple the ratio of a / b is in the range (c_min, c_max). A / B is within the same range, too. I am also trying to make sure there is no bias in the result other than what is introduced by the constraints and the a / b values are more-or-less uniformly distributed in the given range.
Some clarifications and meta-constraints:

A, B, c_min, and c_max are given. 
The ratio A / B is in the (c_min, c_max) range. This has to be so if the problem is to have a solution given the other constraints.
a and b are >0 and non-integer.

I am trying to implement this in Python but ideas in any language (English included) are much appreciated.