I am designing for work a testing environment which uses run-time randomly generated data to test our company's product.
The problem is as follows: I have an inequality of the sort of x(1+y(1+z(1+p+q))) <= MAX, when x,y,z,p,q,MAX are integers, MAX is given as a method parameter and the method needs to find x,y,z,p,q to suffice the inequality. The problem is that I need the solution to be in a uniform probability space, meaning that each solution of the x,y,z,p,q has the same probability to come up when providing the same MAX many times.
If possible, it would be great if you can think of a polynomial solution, if not possible O(n^2) will suffice as well. The algorithm needs to be run with high MAX values and big number of iterations on each test, so good complexity is vital.
Can you think of a way to produce uniform probability space for every type of linear equation?
I would appreciate any guidance on this matter, I am stuck on this algorithm for some time now.