Info
此问题已关闭。 请重新打开它进行编辑或回答。
Construct collection of sequences of 1's and 0's
2 次查看(过去 30 天)
显示 更早的评论
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?
回答(0 个)
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!