#
# your solution is here
#


#
# your solution is here
#


# operator for the test
A = [
    [0.4,0.6,0],
    [0.2,0.1,0.7],
    [0.4,0.3,0.3]
]

# state for test
v = [0.1,0.3,0.6]

#
# your solution is here
#

# the initial state
initial = [0.5, 0, 0.5, 0]

# probabilistic operator for symbol a
A = [
    [0.5,  0, 0, 0],
    [0.25, 1, 0, 0],
    [0,    0, 1, 0],
    [0.25, 0, 0, 1]
]

# probabilistic operator for symbol b
B = [
    [1, 0, 0,    0],
    [0, 1, 0.25, 0],
    [0, 0, 0.5,  0],
    [0, 0, 0.25, 1]
]

#
# your solution is here
#