How do I obtain a random example of a sequence where distribution of values matches A and distrubtion of deltas matches B?

35 Views Asked by At

Suppose we have a sequence f[i]. For example, it's

4 5 6 5 6 4 5 6 7 8 9 10 11 10 11 11 12 11 10 9 7 6 4 5 4 5 4

It is rather long and not directly storable in memory, so intead we store just statistics of values and deltas:

vals: 4 5 6 5 6 4 5 6 7 8 9 10 11 10 11 11 12 11 10 9 7 6 4 5 4 5 4
2
3
4  ****
5  *****
6  ****
7  **
8  *
9  **
10 ***
11 ****
12 *
13

deltas: 1 1 -1 1 -2 1 1 1 1 1 1 1 -1 1 0 1 -1 -1 -1 -2 -1 -2 1 -1 1 -1
-3 
-2 ***
-1 ********
 0 *
+1 **************
+2 

How do I, having only histograms of values and deltas obtain a sample of random sequence with similar characteristics? Examples of such sequences are 11 10 11 10 8 7 5 4 5 4 5 6 7 8 9 10 11 10 11 or 6 4 5 5 4 5 6 7 8 9 10 11 10 11 9 7 8 9 10 11 - two humps in value distribution, mostly -2, -1 and +1 in delta distribution.

How is this problem formuated in proper mathematical terms?