[1]https://en.wikipedia.org/wiki/Linear-feedback_shift_register "In [2]computing, a linear-feedback shift register (LFSR) is a [3]shift register whose input bit is a [4]linear function of its previous state. The most commonly used linear function of single bits is [5]exclusive-or (XOR). Thus, an LFSR is most often a shift register whose input bit is driven by the XOR of some bits of the overall shift register value. The initial value of the LFSR is called the seed, and because the operation of the register is deterministic, the stream of values produced by the register is completely determined by its current (or previous) state. Likewise, because the register has a finite number of possible states, it must eventually enter a repeating cycle. However, an LFSR with a [6]well-chosen feedback function can produce a sequence of bits that appears random and has a [7]very long cycle. Applications of LFSRs include generating [8]pseudo-random numbers, [9]pseudo-noise sequences, fast digital counters, and [10]whitening sequences. Both hardware and software implementations of LFSRs are common. The mathematics of a [11]cyclic redundancy check, used to provide a quick check against transmission errors, are closely related to those of an LFSR." [end of quote] Jim Bell [12]× (BUTTON) (BUTTON) __________________________________________________________________ From: James A. Donald To: cypherpunks@lists.cpunks.org Sent: Sunday, September 11, 2016 6:09 PM Subject: Permutations to scalars and back again. I need to be able to do two of the following three tasks. Generate a permutation of eighteen ones and eighteen zeros with equal probability for each permutation. Or equivalently shuffle eighteen black cards and eighteen red cards. Sequentially generate all possible permutations with each permutation generated once and only once. Map between permutations and scalars, such that each permutation maps to unique number, and the set of numbers that represents valid permutations is dense. Could someone point me to the relevant literature, or literature for converting between different representations of a permutation? Since there are only two classes of items being shuffled, this class of permutations has a variety of special and convenient properties. References 1. https://en.wikipedia.org/wiki/Linear-feedback_shift_register 2. https://en.wikipedia.org/wiki/Computing 3. https://en.wikipedia.org/wiki/Shift_register 4. https://en.wikipedia.org/wiki/Linear#Boolean_functions 5. https://en.wikipedia.org/wiki/Exclusive-or 6. https://en.wikipedia.org/wiki/Primitive_polynomial_(field_theory) 7. https://en.wikipedia.org/wiki/Maximal_length_sequence 8. https://en.wikipedia.org/wiki/Pseudorandomness 9. https://en.wikipedia.org/wiki/Pseudorandom_noise 10. https://en.wikipedia.org/wiki/Whitening_sequences 11. https://en.wikipedia.org/wiki/Cyclic_redundancy_check 12. file:///var/lib/mailman/archives/private/cypherpunks/attachments/20160912/c2d32e4f/attachment-tmp.html