Re: [R] generate random numbers subject to constraints

From: Ala' Jaouni <>
Date: Wed, 26 Mar 2008 12:27:44 -0700

I failed to mention that the X values have to be positive and between 0 and 1.


0.1812*X1 + 0.1871*X2 + 0.1847*X3 + 0.2745*X4 + 0.1304*X5 = 0.2

so one possible combination of X values can be: 0.319, 0.201, 0.084, 0.26, 0.136

another possible combination:
0.151, 0.253, 0.197, 0.256, 0.143

The numbers should be uniformly distributed.

I might have misused the word random but I only need a subset of all possible solutions.

-Ala' mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Wed 26 Mar 2008 - 23:00:52 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 26 Mar 2008 - 23:30:24 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive