Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
Construct collection of sequences of 1's and 0's
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hi,
I have the vectors v1=[1 1 0 0], v2=[1 0 0 1], v3=[0 1 1 0], v4=[0 0 1 1]. For given N, I want to consider the set of all sequences v{i_1}v{i_2}...v{i_N}, where v{i}v{j} means just concatenation and each i_k goes from 1 to 4. Let's call each of these sequences S{i_1,i_2,...,i_N} (that is, S{i_1,i_2,...,i_N}=v{i_1}v{i_2}...v{i_N}).
I am trying to do several things:
First, enumerate all the sequences S{i_1,i_2,...,i_N} so that each one of them has associated a single integer n between 1 and 4^N.
Second, an efficient way of, given a integer, construct the correspondet sequence S{i_1(n),i_2(n),...,i_N(n)} (This map should be, of course, the inverse of the enumeration mentioned above)
I want to do this without having to store huge arrays in memory and then looking them up, and that's why this seems difficult to me. Any idea about how to proceed?
Respuestas (0)
La pregunta está cerrada.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!