Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mehr zeug von mika h23 #14

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Mehr zeug von mika h23 #14

wants to merge 3 commits into from

Conversation

motrellin
Copy link
Member

No description provided.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fehler gefunden und ausgebessert




\newpage
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sei $M = (Q, \Sigma, \delta, q_0, F)$ ein nichtdeterministischer endlicher Automat (NEA), sei $v \in \Sigma^$ und sei $L = { w \in \Sigma^ \mid w \in L(M) \text{ und } w \text{ enthält } v }$. Wir konstruieren einen NEA $M' = (Q', \Sigma, \delta', q_0', F')$, für den $L(M') = L$ gilt, wie folgt:

\begin{itemize}
	\item $Q' = Q \times \{0, 1, \ldots, k\}$, wobei $k$ die Länge von $v$ ist.
	\item $\delta'$ ist definiert durch:
	\begin{align*}
		\delta'((q, i), \sigma) &= \begin{cases}
			\{ (q', 0) \mid q' \in \delta(q, \sigma) \} & \text{falls } \sigma \neq v_{i+1}\text{ und } i < k\\
			\{ (q', i) \mid q' \in \delta(q, \sigma) \} & \text{falls } i = k \\
			\{ (q', i),(q', i+1) \mid q' \in \delta(q, \sigma) \} & \text{falls } \sigma = v_{i+1} \text{ und } i = 0 \\
			\{ (q', i+1) \mid q' \in \delta(q, \sigma) \} & \text{falls } \sigma = v_{i+1} \text{ und } 0 < i < k
		\end{cases}
	\end{align*}
	\item $q_0' = (q_0, 0)$
	\item $F' = \{ (q, k) \mid q \in F \}$
\end{itemize}

\textbf{Erklärung:}\\
Die Zustände von $M'$ sind Paare $(q, i)$, wobei $q$ ein Zustand von $M$ ist und $i$ die Position im Wort $v$ darstellt. Wenn der Automat ein Zeichen $\sigma$ liest, das nicht das nächste erwartete Zeichen von $v$ ist, wird $i$ zurückgesetzt. Wenn $\sigma$ das nächste erwartete Zeichen von $v$ ist, wird $i$ inkrementiert. Im Fall $i=0$ wird nichtdeterministisch geraten, ob das erste Zeichen von $v$ gelesen wird oder nicht ($\delta'((q, i), \sigma)=\{(q', 0),(q', 1)\}$). Sobald $i$ die Länge von $v$ erreicht hat (d.h. $i = k$), bleibt der Automat im Zustand $k$ und simuliert weiterhin $M$.

Der Startzustand von $M'$ ist $(q_0, 0)$, und die akzeptierenden Zustände sind die Paare $(q, k)$, wobei $q$ ein akzeptierender Zustand von $M$ ist. Dies stellt sicher, dass das Wort $v$ in $w$ enthalten ist und dass $w$ von $M$ akzeptiert wird.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Irgendwie hab ich wieder nicht gecheckt, wie ich es selber ausbessere...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants