Skip to main content
. 2018 Oct 12;20(10):781. doi: 10.3390/e20100781
Algorithm 1 ObservableState.
Require:Qij, n.
Step 1. For eachk[1,,(log2n+1)n] generate uniformly value ρ[0,1]
  1. Ifρ<|α|2thenqk=1elseqk=0 and obtain the binary string: [q1q2,q(log2n+1)n].

  2. For eachi[1,n] translate the binary substring [qi+1qi+2qi+(log2n+1)n] to the decimal value and obtain the string of the decimal number Sd=[d1d2dn].

Step 2. Replace each number di in this way that the Sd takes a permutation form.
For i=1 to n do:
  1. Find the set of smallest, not marked, elements in the string Sd=[d1d2dn].

  2. Replace the smallest element from the left side of the string - dk, by the value i and set the value i at the position k as marked.

Return string Sd which has a permutation form.