explicit function to enumarate N bits words with M ones
- From: CAFxX <usenet0001@xxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 25 Jan 2008 21:41:02 GMT
Hi, I was wandering whenever it exists a known method to explicitely enumerate all the N bits words having 0 <= M <= N ones, i.e. something like
F(N, M, i)
where i < binomial(N, M) means the i-th word.
all the words does not have to be sorted, I just need to have them enumerated (e.g. F(N,M,i) does not have to be less than F(N,M,i+1)).
The problem arises because exhaustive (brute-force) search isn't feasible for large values of N (and not trivial values of M), and a recursive approach is rather slow as well.
My text books give me no insight on this... any ideas?
Thank you,
Carlo Alberto
.
- Follow-Ups:
- Re: explicit function to enumarate N bits words with M ones
- From: Mariano Suárez-Alvarez
- Re: explicit function to enumarate N bits words with M ones
- Prev by Date: Re: Solutions Manual Modern Control Systems
- Next by Date: Re: Fermat's Last Theorem - A Brief Proof
- Previous by thread: solving CAGR challenge
- Next by thread: Re: explicit function to enumarate N bits words with M ones
- Index(es):