<p>I have to generate  two random sets of matrices
Each containing   3 digit numbers   ranging from 2 - 10   </p>

<p>like that</p>

<p>matrix 1:  994,878,129,121</p>

<p>matrix 2:  272,794,378,212</p>

<p>the numbers in both matrices have to be  greater then 100 and  less then  999</p>

<p>BUT</p>

<p>the  mean for both matrices has to be in the ratio  of  1:2  or 2:3  what ever constraint the user inputs </p>

<p>my math skills are kind  of limited so any ideas how do i make this happen?</p>

In order to do this, you have to know how many numbers are in each list.  I'm assuming from your example that there are four numbers in each.
Fill the first list with four random numbers.
Calculate the mean of the first list.
Multiply the mean by 2 or by 3/2, whichever the user input.  This is the required mean of the second list.
Multiply by 4.  This is the required total of the second list.
Generate 3 random numbers.
Subtract the total of the three numbers in step 5 from the total in step 4.  This is the fourth number for the second list.
If the number in step 6 is not in the correct range, start over from step 5.
Note that the last number in the second list is not truly random, since it's based on the other values in the list.