Bit-reversal permutation
来源:互联网 发布:淘宝叶罗丽娃娃24元 编辑:程序博客网 时间:2024/06/06 23:59
转自维基百科:
In applied mathematics, a bit-reversal permutation is a permutation of a sequence of n items, where n = 2k is a power of two. It is defined by indexing the elements of the sequence by the numbers from 0 to n − 1 and then reversing the binary representations of each of these numbers (padded so that each of these binary numbers has length exactly k). Each item is then mapped to the new position given by this reversed value. The bit reversal permutation is an involution, so repeating the same permutation twice returns to the original ordering on the items.
Consider the sequence of eight letters abcdefgh. Their indexes are the binary numbers 000, 001, 010, 011, 100, 101, 110, and 111, which when reversed become 000, 100, 010, 110, 001, 101, 011, and 111. Thus, the letter a in position 000 is mapped to the same position (000), the letter b in position 001 is mapped to the fifth position (the one numbered 100), etc., giving the new sequence aecgbfdh. Repeating the same permutation on this new sequence returns to the starting sequence.
Writing the index numbers in decimal (but, as above, starting with position 0 rather than the more conventional start of 1 for a permutation), the bit-reversal permutations of size 2n, for n = 0, 1, 2, 3, ... are
0
0 1
0 2 1 3
0 4 2 6 1 5 3 7
0 8 4 12 2 10 6 14 1 9 5 13 3 11 7 15
(sequence A030109 in OEIS)
Each permutation in this sequence can be generated by concatenating two sequences of numbers: the previous permutation, doubled, and the same sequence with each value increased by one. Thus, for example doubling the length-4 permutation 0 2 1 3 gives 0 4 2 6, adding one gives 1 5 3 7, and concatenating these two sequences gives the length-8 permutation 0 4 2 6 1 5 3 7.
- Bit-reversal permutation
- Bit Reversal and Permutation
- 1977:Bit-reversal Permutation
- COJ1977-Bit-reversal Permutation
- CSU1977: Bit-reversal Permutation
- 1977: Bit-reversal Permutation(递归)
- CSU1977-Bit-reversal Permutation-模拟
- CSU 1977: Bit-reversal Permutation
- EPI 5.3 BIT REVERSAL
- Word Reversal
- ZOJ_1151_Word Reversal
- Word Reversal
- Word Reversal
- Word Reversal
- Word Reversal
- Word Reversal
- Happy Reversal
- HUST1339-Reversal
- 几种降维思想方法总结
- Myelicpse整合Activiti插件
- svm入门之四线性分类器求解与问题描述
- 数组的初始化与memset的注意事项
- 10天学通MongoDB---资料链接-----阿冬专栏
- Bit-reversal permutation
- 华为机试——约瑟夫环变种
- matlab中./与/有什么区别
- VLAN帧格式
- CentOS6.5安装
- 【转】减少.NET应用程序内存占用的一则实践
- 黑马程序员--正则表达式
- python 格式规范工具 autopep8 Tool to convert Python code to be PEP8 compliant
- svm入门之五、六线性分类器问题描述与求解