Problem: Hidden Markov Models
Cake Factory: You work at a cake factory that makes four flavors of cake, and cakes come out of the oven into a conveyor belt one at a time. In the oven control station, there are two levers, a Chocolate lever and a Caramel lever, so that there are four types of cake flavors: Plain, Chocolate, Caramel, and Chocolate+Caramel. Levers cannot be moved while a cake is being made. At the beginning of the day, the conveyor belt is turned on and the factory starts making cakes, with a 50% chance that the Chocolate lever is on at the beginning and a 50% chance that it is switched off. Similarly, there is a 50% chance that the Caramel lever is on and a 50% chance that it is off. The conveyor belt is started and the controller staff in the control room can switch the Chocolate and Caramel levers to the other position with a 30% chance. For example, if the Chocolate lever was on, it is switched to off, and vice versa. Assume that the switching of the levers is independent of each other and that you know with 100% accuracy what flavor each cake has.
i. Draw a Markov Model that best describes this cake production and write down the prior state distribution and the transition matrix.
ii. What is the probability that the machine will produce the sequence {Plain, Chocolate, Chocolate, Chocolate+Caramel} in this order?