Write a program to implement the compression scheme described in the previous problem.
(a) Generate a random binary sequence with P(0) = 0.8, and compare your simulation results with the analytical results.
(b) Generate a binary first-order Markov sequence with P(0|0) = 0.9, and P(l|l) = 0.9. Encode it using your program. Discuss and comment on your results.