Help with generating a random matrix with row and column constraint



Hi All,


I would greatly appreciate if someone could help me with the following problem.

I am trying to generate a 300X5 matrix of uniformly distributed random numbers with the following constraints.
1)All the elements in the matrix should be one of the following numbers : 0,1,2,3,4,5.
2)The sum of all the elements in each column should be 100
3)The sum across the row should be <= 5
4)I want to generate all these numbers as independent of each other as possible.
I understand that at one stage these numbers will be depending on one another to meet the constaint but is it possible to simulate the data in such a way that these numbers can be independent to a large extent.

I am trying to write a code to generate the data set in Matlab, but am struck with the algorithm. I shall be very thankful if someone can suggest an algorithm that can be coded in Matlab.

Thankyou,

Best Regards,

Ruchika
.



Relevant Pages

  • Re: Interesting Programming Problem
    ... You are dealing with factorials here. ... I already outlined the algorithm. ... Not for the exact sum version. ... data set and then use subtraction to find your answer. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Approaches to solve constrained mixed-norm optmization problema
    ... What are the approaches available in MATLAB to solve a problem to find ... a vector of parameters r such that the sum ... and lambda1 and lambda2 are a set of given weights. ... Proceed according to the following algorithm ...
    (comp.soft-sys.matlab)
  • Re: whats a STUPIDENT?
    ... I have seen only MATLAB and MathCad, ... I'd like to receice some advice about implementing an FM demodulator in a DSP proccessor. ... I'm a student of eletronics and I woul like implement a voice scrambler using the algorithm RSA on plataform DSP tms320c6711, I have watched that you done some algorithms to work in a DSP plataform, maybe you can help me with this,If dou you have any RSA algorithms for DSP, I'll be very gratefully. ... Do we have to start with a FD (frequency domain) weight vector that is all zeros. ...
    (comp.dsp)
  • Re: whats a STUPIDENT?
    ... I have seen only MATLAB and MathCad, ... mathematics forum discussing DSP on sine waves. ... using the algorithm RSA on plataform DSP tms320c6711, ... I am trying to implement the frequency domain LMS algo. ...
    (comp.dsp)
  • Re: Is there a polynomial algorithm for that problem?
    ... The sum over all n numbers is negative. ... Unfortunately that algorithm does not scale. ... An instance of 3-Partition consists of a list of 3m positive integers ... list can be partitioned into m lists of size 3, ...
    (sci.math)