# Generating sequences with specific characteristics

We are all familiar with pseudo-random sequences generated by various methods (BBS, Mersenne Twister, LCG, Von Neumann's middle square, RC4) and also the 'pseudo-random' sequence of powers of a primitive root of a finite field. Additionally there are other sequences that have some element of unpredictability (orbits of Collatz sequence)

A lot of these have provably long periods (2**19937 - 1 for MT, p-1 in the case of the primitive root) and some of them have pretty short periods (middle square). These sequences also have associated with them various statistical distributions, which are mostly uniform in the intervals they select from (I have no idea what any distribution characteristics are for Collatz).

What unites most of these sequences is they are generated by iterative operations on a persistent state, i.e., a recursive procedure. They are also, mostly, 'clocked-over' with modular arithmetic.

My question concerns tighter restrictions on generated sequences. What if we are given an absolute statistical distribution (say, single symbol frequencies, and/or symbol bigram frequencies, ... and/or symbol n-gram frequencies -- or some other characteristic) that the output must follow, is there any iterative or recursive procedure that can generate this (that does not use something like a belief propagation graph), what work is there on generating sequences with specific distributions?

Also, what work is there on generating a sequence with a period of exactly, t? So say I want a sequence with a period of exactly 1137. Where can I generate such a sequence?

Also, forgive me for not knowing the answer to this (it is probably obvious) but what work is there on combining (somehow: say, swapping the states each iteration, or connecting them in a loop -- both of which may be equivalent, I don't know) a sequence of period s, with a sequence of period, t, to generate a sequence of period q? How do we calculate q? Can we ever produce something so simple as q = s + t? I'm sure there must be some 'convolution'/'composition' rule for such sequences that is well-known which I do not know.

I apologize for the general nature of the question. But the answers I will accept are equally general. Merely a first exploration, dipping the toe into the water...and seeing what is caught.

Google searches for 'generating sequence with specific (distribution OR period)' (searched each separately) did not produce results.

-