Skip to main content
added 317 characters in body
Source Link
yarchik
  • 19.8k
  • 2
  • 33
  • 75

Three observations:

  • Your random process is non-Markovian, i.e. depends on the previous steps

  • The number of states is finite, in your example there are only 90 of them.

  • In view of (i) and (ii) you have a random walk on a tree.

You can build the tree explicitly for small systems and study it. But you can also use a brute force approach based on your existing method.

  1. generate all states

    config = Table[genoutcomes[{red, green, blue}, 2, 6], {1000}] // DeleteDuplicates

  2. Verify that the length is as expected, (notice a rather large sampling ---1000):

    Length[config] (90)

  3. Generate any big number (let say 4) of samples

    RandomChoice[config,4]

Follow up

After OP clarifications it is evident that in such a method every transition between the neighbouring tree vertices is equiprobable. To deviate from this assumption the whole tree needs to be traversed keeping account of probabilities. Let us see what can be done here ... (continuation follows)

Three observations:

  • Your random process is non-Markovian, i.e. depends on the previous steps

  • The number of states is finite, in your example there are only 90 of them.

  • In view of (i) and (ii) you have a random walk on a tree.

You can build the tree explicitly for small systems and study it. But you can also use a brute force approach based on your existing method.

  1. generate all states

    config = Table[genoutcomes[{red, green, blue}, 2, 6], {1000}] // DeleteDuplicates

  2. Verify that the length is as expected, (notice a rather large sampling ---1000):

    Length[config] (90)

  3. Generate any big number (let say 4) of samples

    RandomChoice[config,4]

Three observations:

  • Your random process is non-Markovian, i.e. depends on the previous steps

  • The number of states is finite, in your example there are only 90 of them.

  • In view of (i) and (ii) you have a random walk on a tree.

You can build the tree explicitly for small systems and study it. But you can also use a brute force approach based on your existing method.

  1. generate all states

    config = Table[genoutcomes[{red, green, blue}, 2, 6], {1000}] // DeleteDuplicates

  2. Verify that the length is as expected, (notice a rather large sampling ---1000):

    Length[config] (90)

  3. Generate any big number (let say 4) of samples

    RandomChoice[config,4]

Follow up

After OP clarifications it is evident that in such a method every transition between the neighbouring tree vertices is equiprobable. To deviate from this assumption the whole tree needs to be traversed keeping account of probabilities. Let us see what can be done here ... (continuation follows)

Source Link
yarchik
  • 19.8k
  • 2
  • 33
  • 75

Three observations:

  • Your random process is non-Markovian, i.e. depends on the previous steps

  • The number of states is finite, in your example there are only 90 of them.

  • In view of (i) and (ii) you have a random walk on a tree.

You can build the tree explicitly for small systems and study it. But you can also use a brute force approach based on your existing method.

  1. generate all states

    config = Table[genoutcomes[{red, green, blue}, 2, 6], {1000}] // DeleteDuplicates

  2. Verify that the length is as expected, (notice a rather large sampling ---1000):

    Length[config] (90)

  3. Generate any big number (let say 4) of samples

    RandomChoice[config,4]