BuK/IIm20/Vorlesung 6 Grüning
Aus ProgrammingWiki
Wiki-Quelltext dieser Seite.
<language>Python</language>
== Paar Liste Seite 18/19 ==
<code id="608c2edf0290c">
def check_solution(K, index_list):
x = ""
y = ""
for index in index_list:
index -= 1
x += K[index][0]
y += K[index][1]
print(x)
print(y)
return x == y
</code>
<run id="608c2edf0297a">
index_list = [2, 4, 3, 4, 4, 2, 1, 2, 4, 3, 4, 3, 4, 4, 3, 4, 4, 2, 1, 4, 4, 2, 1, 3, 4, 1, 1, 3, 4, 4, 4, 2, 1, 2, 1, 1, 1, 3, 4, 3, 4, 1, 2, 1, 4, 4, 2, 1, 4, 1, 1, 3, 4, 1, 1, 3, 1, 1, 3, 1, 2, 1, 4, 1, 1, 3]
K = [("001", "0"), ("01", "011"), ("01", "101"), ("10", "001")]
print(check_solution(K, index_list))
</run>
== Turing Maschine Seite 25 ==
Band, Zustand, Lese/Schreibekopfposition relativ zum Start
11, q0, 0
\$1, q1, 1
\$1\$, q1, 2
\$1\$\$, q2, 3
\$1\$1\$, q3, 4
\$1\$11, q4, 3
\$1\$11, q4, 3
\$1\$11, q4, 2
\$1\$11, q5, 1
\$1\$11, q5, 0
\$1\$11, q0, 1
Runde 2
\$\$\$11, q1, 2
\$\$\$11, q2, 3
\$\$\$11, q2, 4
\$\$\$11\$, q2, 5
\$\$\$111\$, q3, 6
\$\$\$1111, q4, 5
\$\$\$1111, q4, 4
\$\$\$1111, q4, 3
\$\$\$1111, q4, 2
\$\$\$1111, q5, 1
\$\$\$1111, q0, 2
\$\$\$1111, q6, 3