Generate Exhaustive Permutations
バージョン 1.1.0.1 (5.14 KB) 作成者:
Michael Chan
Illustrates generation of exhaustive permutation of symbols given the symbolic bases.
Generate Exhaustive Permutations
--------------------------------------------------
[1] main executing reference usage: usage_generateExhaustivePermutation
The objective is to illustrate generation of exhaustive permutation of symbols given the symbolic bases.
The method of generation is a kronecker-akin approach. The indexRepresentedPermutations may be mapped to any symbols provided.
Sample output:
ssssGiven bases = 'AB';
lengthOf1PatternSeq = 3;
< symbols >
AAA
AAB
ABA
ABB
BAA
BAB
BBA
BBB
< indexRepresentedPermutations >
1 1 1
1 1 2
1 2 1
1 2 2
2 1 1
2 1 2
2 2 1
2 2 2
ssssGiven bases = '01';
lengthOf1PatternSeq = 4;
< symbols >
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
< indexRepresentedPermutations >
1 1 1 1
1 1 1 2
1 1 2 1
1 1 2 2
1 2 1 1
1 2 1 2
1 2 2 1
1 2 2 2
2 1 1 1
2 1 1 2
2 1 2 1
2 1 2 2
2 2 1 1
2 2 1 2
2 2 2 1
2 2 2 2
--------------------------------------------------
[2] main executing reference usage: usage_computePermutationSeqForSpecificIndex
Obtain a sequence of permutation by direct computation, instead of extracting from a pre-generated exhaustive sequence of prescribed order.
This accelerate the process and saves memory space.
Sample output:
The sequence is CGGGCAG.
The sequence indexed extracted from exhaustive list is CGGGCAG from index: 4044.
==========================================
The sequence is CCCTATC.
The sequence indexed extracted from exhaustive list is CCCTATC from index: 101.
==========================================
The sequence is CCTGGAC.
The sequence indexed extracted from exhaustive list is CCTGGAC from index: 505.
==========================================
The sequence is CCGGATA.
The sequence indexed extracted from exhaustive list is CCGGATA from index: 999.
==========================================
* Caveat : Illustrative Purposes
- may run out of memory when lengthOf1PatternSeq >= 10;
- note as well that lengthOf1PatternSeq has to be >= length(bases)
- uncomment variables for display, eg. indexRepresentedPermutations
If the demo has more elegant presentation, please do not hesitate to suggest and send feedback to author.
Thank you.
Regards,
Michael Chan JT
引用
Michael Chan (2026). Generate Exhaustive Permutations (https://jp.mathworks.com/matlabcentral/fileexchange/29383-generate-exhaustive-permutations), MATLAB Central File Exchange. に取得済み.
MATLAB リリースの互換性
作成:
R2010a
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linuxカテゴリ
Help Center および MATLAB Answers で Biological and Health Sciences についてさらに検索
タグ
謝辞
ヒントを与えたファイル: Motif Finding
