**Question:** Consider a communications system that transmits the digits 0 and 1. Each digit transmitted must pass through several stages, at each of which there is a probability p that the digit entered will be unchanged when it leaves. Letting Xn denote the digit entering the nth stage, then {X_{n}, n = 0, 1, . . .} is a two-state Markov chain having a transition probability matrix

p | 1 – p |

1 – p | p |

Note: The above is a matrix but the default formatting on this site puts lines at the bottom of each of the row

**Analytical Solution**

N/A

**Simulation Solution**

Since the above is simply a demonstration of how one can represent a Markov Chain, we will run a simple simulation with some sample probabilities and look at how the states of the system look like in the long run. Note how the bar charts show the same counts of for both the states for all the probabilities. This is due to the diagonal symmetry of the matrix.

**Code**

Table[Module[{matrix = {{p, 1 - p}, {1 - p, p}}, data, iterations = 10000, \[ScriptCapitalP]}, \[ScriptCapitalP] = DiscreteMarkovProcess[{0, 1}, matrix]; data = KeySort@Counts[ RandomFunction[\[ScriptCapitalP], {0, iterations}][[2, 1, 1]]]; BarChart[data, Frame -> True, ImageSize -> 262, AspectRatio -> 1, PlotRange -> {Automatic, {0, 7000}}, ChartLabels -> Placed[#@data & /@ {Values, Keys}, {Above, Bottom}], Epilog -> Text[Style["p = " <> ToString[p], 12], {1.5, 6750}]] ], {p, Range[0.1, 0.9, 0.1]}] // Labeled[Grid[Partition[#, 3]], Rotate[Style["Number of iterations per Markov Chain: 10000", 14, Red], 0], Top] &

End of the post

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.