HW4 for Course "Theory of Computation"