Technopedia Center
PMB University Brochure
Faculty of Engineering and Computer Science
S1 Informatics S1 Information Systems S1 Information Technology S1 Computer Engineering S1 Electrical Engineering S1 Civil Engineering

faculty of Economics and Business
S1 Management S1 Accountancy

Faculty of Letters and Educational Sciences
S1 English literature S1 English language education S1 Mathematics education S1 Sports Education
teknopedia

teknopedia

teknopedia

teknopedia

teknopedia
  • Registerasi
  • Brosur UTI
  • Kip Scholarship Information
  • Performance
  1. Weltenzyklopädie
  2. Wort (theoretische Informatik) – Wikipedia
Wort (theoretische Informatik) – Wikipedia
aus Wikipedia, der freien Enzyklopädie

In der theoretischen Informatik ist ein Wort eine endliche Folge von Symbolen eines Alphabets. Im Gegensatz zur natürlichsprachlichen Bedeutung von Wörtern, die stets eine eigenständige Bedeutung haben, bezeichnet der Ausdruck Wort in der theoretischen Informatik lediglich eine Zeichenkette und nicht deren mögliche Bedeutung.

Wörter oder Worte[1] sind die Elemente einer formalen Sprache. Sie sind deshalb wichtig für mathematische Modellierungen, für die Theorie der Programmiersprachen, für die Berechenbarkeitstheorie und andere Gebiete der theoretischen Informatik.

Definition

[Bearbeiten | Quelltext bearbeiten]

Es sei Σ {\displaystyle \Sigma } {\displaystyle \Sigma } ein gegebenes Alphabet und n {\displaystyle n} {\displaystyle n} eine natürliche Zahl aus N 0 {\displaystyle \mathbb {N} _{0}} {\displaystyle \mathbb {N} _{0}}, der Menge der natürlichen Zahlen einschließlich der Null ( N 0 = { 0 , 1 , 2 , … } {\displaystyle \mathbb {N} _{0}=\{0,1,2,\ldots \}} {\displaystyle \mathbb {N} _{0}=\{0,1,2,\ldots \}}). Ein Wort w {\displaystyle w} {\displaystyle w} der Länge n {\displaystyle n} {\displaystyle n} ist eine endliche Folge ( x 1 , x 2 , x 3 , … , x n ) {\displaystyle (x_{1},x_{2},x_{3},\ldots ,x_{n})} {\displaystyle (x_{1},x_{2},x_{3},\ldots ,x_{n})} mit x i ∈ Σ {\displaystyle x_{i}\in \Sigma } {\displaystyle x_{i}\in \Sigma } für alle i ∈ { 1 , … , n } {\displaystyle i\in \{1,\ldots ,n\}} {\displaystyle i\in \{1,\ldots ,n\}}.

Die Länge n {\displaystyle n} {\displaystyle n} eines Wortes w {\displaystyle w} {\displaystyle w} wird als | w | {\displaystyle |w|} {\displaystyle |w|} notiert; die Zahl, wie oft das Zeichen x {\displaystyle x} {\displaystyle x} im Wort w {\displaystyle w} {\displaystyle w} vorkommt, mit | w | x {\displaystyle |w|_{x}} {\displaystyle |w|_{x}}.[2][3] Ein besonderes Wort ist das leere Wort, das aus keinem Symbol besteht (die Länge 0 besitzt) und meist mit dem griechischen Buchstaben ε {\displaystyle \varepsilon } {\displaystyle \varepsilon } (Epsilon) dargestellt wird (auch Λ {\displaystyle \Lambda } {\displaystyle \Lambda } findet man gelegentlich[4]). Die Menge aller Wörter, die man aus einem Alphabet Σ {\displaystyle \Sigma } {\displaystyle \Sigma } bilden kann, ist die Kleenesche und positive Hülle über diesem Alphabet. Diese ist die disjunkte Vereinigung

Σ ∗ := ⋃ n ∈ N ∪ { 0 } Σ n {\displaystyle \Sigma ^{*}:=\bigcup _{n\in \mathbb {N} \cup \{0\}}\Sigma ^{n}} {\displaystyle \Sigma ^{*}:=\bigcup _{n\in \mathbb {N} \cup \{0\}}\Sigma ^{n}}.

Die nichtleeren Wörter sind dann entsprechend die ‚positive Hülle’

Σ + := Σ ∗ ∖ { ε } = ⋃ n ∈ N Σ n {\displaystyle \Sigma ^{+}:=\Sigma ^{*}\setminus \{\varepsilon \}=\bigcup _{n\in \mathbb {N} }\Sigma ^{n}} {\displaystyle \Sigma ^{+}:=\Sigma ^{*}\setminus \{\varepsilon \}=\bigcup _{n\in \mathbb {N} }\Sigma ^{n}}.

Zur Angabe eines Wortes wird oft die vereinfachte Schreibweise w = x 1 x 2 x 3 … x n {\displaystyle w=x_{1}x_{2}x_{3}\ldots x_{n}} {\displaystyle w=x_{1}x_{2}x_{3}\ldots x_{n}} benutzt, was jedoch nur möglich ist, wenn das verwendete Alphabet eine eindeutige Zuordnung der benutzten Symbole zulässt. So kann diese Kurzschreibweise beim Alphabet Σ = { a , a a } {\displaystyle \Sigma =\{a,aa\}} {\displaystyle \Sigma =\{a,aa\}} nicht angewendet werden, da hier zum Beispiel aus der Schreibweise w = a a a {\displaystyle w=aaa} {\displaystyle w=aaa} nicht eindeutig hervorgeht, ob das Wort ( a , a a ) {\displaystyle (a,aa)} {\displaystyle (a,aa)}, ( a a , a ) {\displaystyle (aa,a)} {\displaystyle (aa,a)} oder ( a , a , a ) {\displaystyle (a,a,a)} {\displaystyle (a,a,a)} gemeint ist.

Wörter der Länge n {\displaystyle n} {\displaystyle n} können wie folgt aufgefasst werden:[5]

  • als endliche Folgen (Sequenz) – da Tupel als Folgen mit endlicher Länge n {\displaystyle n} {\displaystyle n} aufgefasst werden können
  • als Elemente des n {\displaystyle n} {\displaystyle n}-fachen kartesischen Produktes – da Tupel auch so aufgefasst werden können

Beispiele

[Bearbeiten | Quelltext bearbeiten]

Es sei Σ 1 {\displaystyle \Sigma _{1}} {\displaystyle \Sigma _{1}} das Alphabet der lateinischen Buchstaben und Σ 2 = { ♢ , ♡ , ♠ , ♣ } {\displaystyle \Sigma _{2}=\lbrace \diamondsuit ,\heartsuit ,\spadesuit ,\clubsuit \rbrace } {\displaystyle \Sigma _{2}=\lbrace \diamondsuit ,\heartsuit ,\spadesuit ,\clubsuit \rbrace }. Dann sind die Wörter w 1 = h a u s {\displaystyle w_{1}=haus} {\displaystyle w_{1}=haus} und w 2 = x y z z y {\displaystyle w_{2}=xyzzy} {\displaystyle w_{2}=xyzzy} Beispiele für Wörter über Σ 1 {\displaystyle \Sigma _{1}} {\displaystyle \Sigma _{1}} und w 3 = ♡ ♣ ♣ ♡ ♠ {\displaystyle w_{3}=\heartsuit \clubsuit \clubsuit \heartsuit \spadesuit } {\displaystyle w_{3}=\heartsuit \clubsuit \clubsuit \heartsuit \spadesuit } ist ein Wort über Σ 2 {\displaystyle \Sigma _{2}} {\displaystyle \Sigma _{2}}. Man erkennt, dass | w 1 | = 4 {\displaystyle |w_{1}|=4} {\displaystyle |w_{1}|=4} und | w 2 | = | w 3 | = 5 {\displaystyle |w_{2}|=|w_{3}|=5} {\displaystyle |w_{2}|=|w_{3}|=5} ist.

Operationen auf Wörtern

[Bearbeiten | Quelltext bearbeiten]

Konkatenation

[Bearbeiten | Quelltext bearbeiten]

Die Konkatenation oder Verkettung ist eine Verknüpfung zweier Wörter zu einem neuen Wort, das durch Aneinanderhängen der beiden Symbolfolgen entsteht. Die Konkatenation der beiden Wörter x {\displaystyle x} {\displaystyle x} und y {\displaystyle y} {\displaystyle y} über einem Alphabet Σ {\displaystyle \Sigma } {\displaystyle \Sigma } wird mit x y {\displaystyle xy} {\displaystyle xy} oder x ∘ y {\displaystyle x\circ y} {\displaystyle x\circ y} angegeben und ist definiert durch:

x y = x ∘ y := ( x 1 , x 2 , x 3 , … , x n , y 1 , y 2 , y 3 , … , y k ) {\displaystyle xy=x\circ y:=(x_{1},x_{2},x_{3},\ldots ,x_{n},y_{1},y_{2},y_{3},\ldots ,y_{k})} {\displaystyle xy=x\circ y:=(x_{1},x_{2},x_{3},\ldots ,x_{n},y_{1},y_{2},y_{3},\ldots ,y_{k})}

Dabei ist nach der Definition des Wortes x = ( x 1 , x 2 , x 3 , … , x n ) {\displaystyle x=(x_{1},x_{2},x_{3},\ldots ,x_{n})} {\displaystyle x=(x_{1},x_{2},x_{3},\ldots ,x_{n})} und y = ( y 1 , y 2 , y 3 , … , y k ) {\displaystyle y=(y_{1},y_{2},y_{3},\ldots ,y_{k})} {\displaystyle y=(y_{1},y_{2},y_{3},\ldots ,y_{k})} mit n , k ∈ N 0 {\displaystyle n,k\in \mathbb {N} _{0}} {\displaystyle n,k\in \mathbb {N} _{0}} und x i , y j ∈ Σ {\displaystyle x_{i},y_{j}\in \Sigma } {\displaystyle x_{i},y_{j}\in \Sigma } für alle i ∈ { 1 , … , n } {\displaystyle i\in \{1,\ldots ,n\}} {\displaystyle i\in \{1,\ldots ,n\}} und j ∈ { 1 , … , k } {\displaystyle j\in \{1,\ldots ,k\}} {\displaystyle j\in \{1,\ldots ,k\}}. Nach der obigen Definition ist x {\displaystyle x} {\displaystyle x} ein Präfix und y {\displaystyle y} {\displaystyle y} ein Suffix des durch die Konkatenation entstandenen Wortes x ∘ y {\displaystyle x\circ y} {\displaystyle x\circ y}. Die Länge eines konkatenierten Wortes entspricht dabei der Summe der Längen der einzelnen (Teil-)Wörter. So gilt für jedes Wort u {\displaystyle u} {\displaystyle u} und v {\displaystyle v} {\displaystyle v}:

| u ∘ v | = | u | + | v | {\displaystyle |u\circ v|=|u|+|v|} {\displaystyle |u\circ v|=|u|+|v|},

und für die absolute Häufigkeit eines Zeichens x {\displaystyle x} {\displaystyle x}:

| u ∘ v | x = | u | x + | v | x {\displaystyle |u\circ v|_{x}=|u|_{x}+|v|_{x}} {\displaystyle |u\circ v|_{x}=|u|_{x}+|v|_{x}}.

Das neutrale Element der Konkatenation ist das leere Wort, da für jedes beliebige Wort w {\displaystyle w} {\displaystyle w} gilt, dass:

w ∘ ε = ε ∘ w = w {\displaystyle w\circ \varepsilon =\varepsilon \circ w=w} {\displaystyle w\circ \varepsilon =\varepsilon \circ w=w}

Da außerdem die Konkatenation assoziativ ist, bildet das Tripel ( Σ ∗ , ∘ , ε ) {\displaystyle (\Sigma ^{*},\circ ,\varepsilon )} {\displaystyle (\Sigma ^{*},\circ ,\varepsilon )} aus der Menge aller Wörter über einem beliebigen Alphabet Σ {\displaystyle \Sigma } {\displaystyle \Sigma }, der Verknüpfung der Konkatenation und dem leeren Wort als neutralem Element ein Monoid. Die Assoziativität bedeutet, dass ohne weiteres Klammern weggelassen werden können:

( h a u s ∘ ♡ ♣ ♣ ♡ ♠ ) ∘ x y z z y = h a u s ∘ ( ♡ ♣ ♣ ♡ ♠ ∘ x y z z y ) = h a u s ♡ ♣ ♣ ♡ ♠ x y z z y {\displaystyle (haus\circ \heartsuit \clubsuit \clubsuit \heartsuit \spadesuit )\circ xyzzy=haus\circ (\heartsuit \clubsuit \clubsuit \heartsuit \spadesuit \circ xyzzy)=haus\heartsuit \clubsuit \clubsuit \heartsuit \spadesuit xyzzy} {\displaystyle (haus\circ \heartsuit \clubsuit \clubsuit \heartsuit \spadesuit )\circ xyzzy=haus\circ (\heartsuit \clubsuit \clubsuit \heartsuit \spadesuit \circ xyzzy)=haus\heartsuit \clubsuit \clubsuit \heartsuit \spadesuit xyzzy}

Demgegenüber ist die Konkatenation nicht kommutativ, d. h. nicht für alle Wörter u {\displaystyle u} {\displaystyle u} und v {\displaystyle v} {\displaystyle v} gilt, dass u ∘ v = v ∘ u {\displaystyle u\circ v=v\circ u} {\displaystyle u\circ v=v\circ u} ist. So ist zum Beispiel:

h a u s ∘ ♡ ♣ ♣ ♡ ♠ = h a u s ♡ ♣ ♣ ♡ ♠ ≠ ♡ ♣ ♣ ♡ ♠ h a u s = ♡ ♣ ♣ ♡ ♠ ∘ h a u s {\displaystyle haus\circ \heartsuit \clubsuit \clubsuit \heartsuit \spadesuit =haus\heartsuit \clubsuit \clubsuit \heartsuit \spadesuit \not =\heartsuit \clubsuit \clubsuit \heartsuit \spadesuit haus=\heartsuit \clubsuit \clubsuit \heartsuit \spadesuit \circ haus} {\displaystyle haus\circ \heartsuit \clubsuit \clubsuit \heartsuit \spadesuit =haus\heartsuit \clubsuit \clubsuit \heartsuit \spadesuit \not =\heartsuit \clubsuit \clubsuit \heartsuit \spadesuit haus=\heartsuit \clubsuit \clubsuit \heartsuit \spadesuit \circ haus}

Potenz

[Bearbeiten | Quelltext bearbeiten]

Die n {\displaystyle n} {\displaystyle n}-te Potenz w n {\displaystyle w^{n}} {\displaystyle w^{n}} eines Wortes w {\displaystyle w} {\displaystyle w} ist definiert als die ( n − 1 ) {\displaystyle (n-1)} {\displaystyle (n-1)}-fache Konkatenation dieses Wortes mit sich selbst. Die Definition der Potenz wird meist rekursiv angegeben:

w 0 := ε {\displaystyle w^{0}:=\varepsilon } {\displaystyle w^{0}:=\varepsilon }
w n + 1 := w n ∘ w {\displaystyle w^{n+1}:=w^{n}\circ w} {\displaystyle w^{n+1}:=w^{n}\circ w}   (für n ∈ N 0 {\displaystyle n\in \mathbb {N} _{0}} {\displaystyle n\in \mathbb {N} _{0}})

So sind zum Beispiel:

( x y z z y ) 0 = ε {\displaystyle (xyzzy)^{0}=\varepsilon } {\displaystyle (xyzzy)^{0}=\varepsilon }
( ♡ ♣ ♣ ♡ ♠ ) 1 = ( ♡ ♣ ♣ ♡ ♠ ) 0 ∘ ♡ ♣ ♣ ♡ ♠ = ε ∘ ♡ ♣ ♣ ♡ ♠ = ♡ ♣ ♣ ♡ ♠ {\displaystyle (\heartsuit \clubsuit \clubsuit \heartsuit \spadesuit )^{1}=(\heartsuit \clubsuit \clubsuit \heartsuit \spadesuit )^{0}\,\circ \,\heartsuit \clubsuit \clubsuit \heartsuit \spadesuit =\varepsilon \,\circ \,\heartsuit \clubsuit \clubsuit \heartsuit \spadesuit =\heartsuit \clubsuit \clubsuit \heartsuit \spadesuit } {\displaystyle (\heartsuit \clubsuit \clubsuit \heartsuit \spadesuit )^{1}=(\heartsuit \clubsuit \clubsuit \heartsuit \spadesuit )^{0}\,\circ \,\heartsuit \clubsuit \clubsuit \heartsuit \spadesuit =\varepsilon \,\circ \,\heartsuit \clubsuit \clubsuit \heartsuit \spadesuit =\heartsuit \clubsuit \clubsuit \heartsuit \spadesuit }
( h a u s ) 3 = ( h a u s ) 2 ∘ h a u s = ( ( h a u s ) 1 ∘ h a u s ) ∘ h a u s = ( ( ε ∘ h a u s ) ∘ h a u s ) ∘ h a u s = h a u s h a u s h a u s {\displaystyle (haus)^{3}=(haus)^{2}\,\circ \,haus=((haus)^{1}\,\circ \,haus)\,\circ \,haus=((\varepsilon \,\circ \,haus)\,\circ \,haus)\,\circ \,haus=haushaushaus} {\displaystyle (haus)^{3}=(haus)^{2}\,\circ \,haus=((haus)^{1}\,\circ \,haus)\,\circ \,haus=((\varepsilon \,\circ \,haus)\,\circ \,haus)\,\circ \,haus=haushaushaus}

Nach der Definition der Konkatenation ist die Länge der n {\displaystyle n} {\displaystyle n}-ten Potenz eines beliebigen Wortes w {\displaystyle w} {\displaystyle w} gleich dem Produkt aus n {\displaystyle n} {\displaystyle n} und der Länge von w {\displaystyle w} {\displaystyle w}:

| w n | = n ⋅ | w | {\displaystyle |w^{n}|=n\cdot |w|} {\displaystyle |w^{n}|=n\cdot |w|},

und für die absolute Häufigkeit eines jeden Zeichens x {\displaystyle x} {\displaystyle x}:

| w n | x = n ⋅ | w | x {\displaystyle |w^{n}|_{x}=n\cdot |w|_{x}} {\displaystyle |w^{n}|_{x}=n\cdot |w|_{x}}

Spiegelung

[Bearbeiten | Quelltext bearbeiten]

Die Spiegelung oder das Reverse w R {\displaystyle w^{R}} {\displaystyle w^{R}} eines Wortes w {\displaystyle w} {\displaystyle w} ergibt sich, wenn man w {\displaystyle w} {\displaystyle w} rückwärts schreibt.[6] Wenn also w = ( x 1 , x 2 , x 3 , … , x n ) {\displaystyle w=(x_{1},x_{2},x_{3},\ldots ,x_{n})} {\displaystyle w=(x_{1},x_{2},x_{3},\ldots ,x_{n})} ist, so ist w R {\displaystyle w^{R}} {\displaystyle w^{R}} die endliche Folge ( y 1 , y 2 , y 3 , … , y k ) {\displaystyle (y_{1},y_{2},y_{3},\ldots ,y_{k})} {\displaystyle (y_{1},y_{2},y_{3},\ldots ,y_{k})} mit k = n {\displaystyle k=n} {\displaystyle k=n} und y i = x n + 1 − i {\displaystyle y_{i}=x_{n+1-i}} {\displaystyle y_{i}=x_{n+1-i}} für alle i ∈ { 1 , … , k } {\displaystyle i\in \{1,\ldots ,k\}} {\displaystyle i\in \{1,\ldots ,k\}}. Die Länge eines Wortes ist also gleich der Länge seiner Spiegelung:

| w R | = | w | {\displaystyle |w^{R}|=|w|} {\displaystyle |w^{R}|=|w|}

So gilt zum Beispiel für die folgenden Wörter:

ε R = ε {\displaystyle \varepsilon ^{R}=\varepsilon } {\displaystyle \varepsilon ^{R}=\varepsilon }
( a b b ) R = b b a {\displaystyle (abb)^{R}=bba} {\displaystyle (abb)^{R}=bba}
( ♡ ♣ ♠ ♡ ) R = ♡ ♠ ♣ ♡ {\displaystyle (\heartsuit \clubsuit \spadesuit \heartsuit )^{R}=\heartsuit \spadesuit \clubsuit \heartsuit } {\displaystyle (\heartsuit \clubsuit \spadesuit \heartsuit )^{R}=\heartsuit \spadesuit \clubsuit \heartsuit }

Das Reverse eines Wortes lässt sich außerdem mit Hilfe der strukturellen Induktion über dem Aufbau des betreffenden Wortes definieren. Dazu definiert man im Induktionsanfang das Reverse des leeren Wortes als das leere Wort. Im Induktionsschritt definiert man das Reverse eines aus einem Teilwort und einem Symbol zusammengesetzten Wortes als die Konkatenation des Symbols mit dem Reversen des Teilwortes:

Induktionsanfang: w = ε ⇒ w R = ε R := ε {\displaystyle w=\varepsilon \Rightarrow w^{R}=\varepsilon ^{R}:=\varepsilon } {\displaystyle w=\varepsilon \Rightarrow w^{R}=\varepsilon ^{R}:=\varepsilon }

Induktionsschritt: ( w = v ∘ a ) ∧ ( v ∈ Σ ∗ , a ∈ Σ ) ⇒ w R = ( v ∘ a ) R := a ∘ ( v R ) {\displaystyle (w=v\circ a)\land (v\in \Sigma ^{*},a\in \Sigma )\Rightarrow w^{R}=(v\circ a)^{R}:=a\circ (v^{R})} {\displaystyle (w=v\circ a)\land (v\in \Sigma ^{*},a\in \Sigma )\Rightarrow w^{R}=(v\circ a)^{R}:=a\circ (v^{R})}

So lässt sich schrittweise das Reverse eines Wortes herleiten:

ε R = ε {\displaystyle \varepsilon ^{R}=\varepsilon } {\displaystyle \varepsilon ^{R}=\varepsilon }
( a b b ) R = b ∘ ( a b ) R = b ∘ b ∘ ( a ) R = b ∘ b ∘ a ∘ ( ε ) R = b ∘ b ∘ a ∘ ε = b b a {\displaystyle (abb)^{R}=b\circ (ab)^{R}=b\circ b\circ (a)^{R}=b\circ b\circ a\circ (\varepsilon )^{R}=b\circ b\circ a\circ \varepsilon =bba} {\displaystyle (abb)^{R}=b\circ (ab)^{R}=b\circ b\circ (a)^{R}=b\circ b\circ a\circ (\varepsilon )^{R}=b\circ b\circ a\circ \varepsilon =bba}
( ♡ ♣ ♠ ♡ ) R = ♡ ∘ ( ♡ ♣ ♠ ) R = ♡ ∘ ♠ ∘ ( ♡ ♣ ) R = ♡ ∘ ♠ ∘ ♣ ∘ ( ♡ ) R = ♡ ♠ ♣ ♡ {\displaystyle (\heartsuit \clubsuit \spadesuit \heartsuit )^{R}=\heartsuit \circ (\heartsuit \clubsuit \spadesuit )^{R}=\heartsuit \circ \spadesuit \circ (\heartsuit \clubsuit )^{R}=\heartsuit \circ \spadesuit \circ \clubsuit \circ (\heartsuit )^{R}=\heartsuit \spadesuit \clubsuit \heartsuit } {\displaystyle (\heartsuit \clubsuit \spadesuit \heartsuit )^{R}=\heartsuit \circ (\heartsuit \clubsuit \spadesuit )^{R}=\heartsuit \circ \spadesuit \circ (\heartsuit \clubsuit )^{R}=\heartsuit \circ \spadesuit \circ \clubsuit \circ (\heartsuit )^{R}=\heartsuit \spadesuit \clubsuit \heartsuit }

Ein Wort wie a b a a b a {\displaystyle abaaba} {\displaystyle abaaba}, das identisch mit seiner Spiegelung ist, wird Palindrom genannt. Mathematisch werden diese spiegelsymmetrischen Worte als die Fixpunkte der Spiegelung R angesehen.

Präfix, Infix und Suffix

[Bearbeiten | Quelltext bearbeiten]

Infix

[Bearbeiten | Quelltext bearbeiten]

Ein Infix ist eine Hinzufügung innerhalb eines Wortes. Jede endliche Teilfolge von aufeinander folgenden Symbolen eines Wortes w {\displaystyle w} {\displaystyle w} wird Infix, Teilwort oder Faktor des Wortes w {\displaystyle w} {\displaystyle w} genannt. Ein Infix eines gegebenen Wortes w = ( x 1 , x 2 , x 3 , … , x n ) {\displaystyle w=(x_{1},x_{2},x_{3},\ldots ,x_{n})} {\displaystyle w=(x_{1},x_{2},x_{3},\ldots ,x_{n})} ist demnach jedes Wort w ^ = ( y 1 , y 2 , y 3 , … , y k ) {\displaystyle {\hat {w}}=(y_{1},y_{2},y_{3},\ldots ,y_{k})} {\displaystyle {\hat {w}}=(y_{1},y_{2},y_{3},\ldots ,y_{k})}, für das es (mindestens) ein i ∈ N 0 {\displaystyle i\in \mathbb {N} _{0}} {\displaystyle i\in \mathbb {N} _{0}} gibt, für das gilt, dass zum einen k + i ≤ n {\displaystyle k+i\leq n} {\displaystyle k+i\leq n} und zum anderen x j + i = y j {\displaystyle x_{j+i}=y_{j}} {\displaystyle x_{j+i}=y_{j}} für jedes j ∈ { 1 , … , k } {\displaystyle j\in \{1,\ldots ,k\}} {\displaystyle j\in \{1,\ldots ,k\}} ist. Demnach ist ein Wort u {\displaystyle u} {\displaystyle u} genau dann Infix eines Wortes w {\displaystyle w} {\displaystyle w}, wenn gilt, dass es mindestens ein Wort p {\displaystyle p} {\displaystyle p} und ein Wort s {\displaystyle s} {\displaystyle s} aus der Kleeneschen Hülle über dem Alphabet von w {\displaystyle w} {\displaystyle w} gibt, so dass p ∘ u ∘ s = w {\displaystyle p\circ u\circ s=w} {\displaystyle p\circ u\circ s=w} ist:

u {\displaystyle u} {\displaystyle u} ist Infix von w : ⟺ ∃ p , s ∈ Σ ∗ : p ∘ u ∘ s = w {\displaystyle w:\;\Longleftrightarrow \exists p,s\in \Sigma ^{\ast }:\;p\circ u\circ s=w} {\displaystyle w:\;\Longleftrightarrow \exists p,s\in \Sigma ^{\ast }:\;p\circ u\circ s=w}

So ist das Wort w ^ = a b a {\displaystyle {\hat {w}}=aba} {\displaystyle {\hat {w}}=aba} mit w ^ ∈ { a , b } ∗ {\displaystyle {\hat {w}}\in \lbrace a,b\rbrace ^{*}} {\displaystyle {\hat {w}}\in \lbrace a,b\rbrace ^{*}} ein Infix der Wörter b a b a a b {\displaystyle babaab} {\displaystyle babaab}, a b a a b a b b {\displaystyle abaababb} {\displaystyle abaababb} und a b a {\displaystyle aba} {\displaystyle aba}, nicht aber der Wörter a b b a {\displaystyle abba} {\displaystyle abba}, b a b b a a b b a b {\displaystyle babbaabbab} {\displaystyle babbaabbab} beziehungsweise des leeren Wortes ε {\displaystyle \varepsilon } {\displaystyle \varepsilon }. In vielen Computersprachen ist für Infix die englische Bezeichnung substring gebräuchlich.

Speziell ist das leere Wort ein Infix jedes beliebigen Wortes, und jedes Wort ist ein Infix von sich selbst. Ein Infix eines beliebigen Wortes, das nicht identisch mit diesem ist, wird echtes Infix genannt.

Präfix

[Bearbeiten | Quelltext bearbeiten]

Ein Präfix ist eine Hinzufügung am Anfang eines Wortes. Ein Präfix eines Wortes w = ( x 1 , x 2 , x 3 , … , x n ) {\displaystyle w=(x_{1},x_{2},x_{3},\ldots ,x_{n})} {\displaystyle w=(x_{1},x_{2},x_{3},\ldots ,x_{n})} ist demnach jedes Infix w ^ = ( y 1 , y 2 , y 3 , … , y k ) {\displaystyle {\hat {w}}=(y_{1},y_{2},y_{3},\ldots ,y_{k})} {\displaystyle {\hat {w}}=(y_{1},y_{2},y_{3},\ldots ,y_{k})}, für das gilt, dass k ≤ n {\displaystyle k\leq n} {\displaystyle k\leq n} und x j = y j {\displaystyle x_{j}=y_{j}} {\displaystyle x_{j}=y_{j}} für jedes j ∈ { 1 , … , k } {\displaystyle j\in \{1,\ldots ,k\}} {\displaystyle j\in \{1,\ldots ,k\}} ist. Demnach ist u {\displaystyle u} {\displaystyle u} genau dann Präfix des Wortes w {\displaystyle w} {\displaystyle w}, wenn es mindestens ein s {\displaystyle s} {\displaystyle s} aus der Kleeneschen Hülle über dem Alphabet, aus dem w {\displaystyle w} {\displaystyle w} erzeugt wurde, gibt, so dass u ∘ s = w {\displaystyle u\circ s=w} {\displaystyle u\circ s=w} ist:

u {\displaystyle u} {\displaystyle u} ist Präfix von w : ⟺ ∃ s ∈ Σ ∗ : u ∘ s = w {\displaystyle w:\;\Longleftrightarrow \exists s\in \Sigma ^{\ast }:\;u\circ s=w} {\displaystyle w:\;\Longleftrightarrow \exists s\in \Sigma ^{\ast }:\;u\circ s=w}

Auch für Präfixe gilt, dass jedes Wort ein Präfix von sich selbst und das leere Wort ein Präfix jedes beliebigen Wortes ist. Ein Präfix eines Wortes, das nicht identisch mit ihm ist, wird echtes Präfix genannt.

Beispiel

[Bearbeiten | Quelltext bearbeiten]

Sei w = a b a a b b {\displaystyle w=abaabb} {\displaystyle w=abaabb}, so lauten die echten Präfixe für w {\displaystyle w} {\displaystyle w}:

  • ε {\displaystyle \varepsilon } {\displaystyle \varepsilon }
  • a {\displaystyle a} {\displaystyle a}
  • a b {\displaystyle ab} {\displaystyle ab}
  • a b a {\displaystyle aba} {\displaystyle aba}
  • a b a a {\displaystyle abaa} {\displaystyle abaa}
  • a b a a b {\displaystyle abaab} {\displaystyle abaab}.

Suffix

[Bearbeiten | Quelltext bearbeiten]

Ein Suffix, auch Postfix genannt, ist eine Hinzufügung am Ende eines Wortes. Ein Suffix eines Wortes w = ( x 1 , x 2 , x 3 , … , x n ) {\displaystyle w=(x_{1},x_{2},x_{3},\ldots ,x_{n})} {\displaystyle w=(x_{1},x_{2},x_{3},\ldots ,x_{n})} ist nach der Definition des Infixes jedes Teilwort w ^ = ( y 1 , y 2 , y 3 , … , y k ) {\displaystyle {\hat {w}}=(y_{1},y_{2},y_{3},\ldots ,y_{k})} {\displaystyle {\hat {w}}=(y_{1},y_{2},y_{3},\ldots ,y_{k})}, für das gilt, dass es ein i ∈ N 0 {\displaystyle i\in \mathbb {N} _{0}} {\displaystyle i\in \mathbb {N} _{0}} gibt, für das zum einen k + i = n {\displaystyle k+i=n} {\displaystyle k+i=n} und zum anderen x j + i = y j {\displaystyle x_{j+i}=y_{j}} {\displaystyle x_{j+i}=y_{j}} für jedes j ∈ { 1 , … , k } {\displaystyle j\in \{1,\ldots ,k\}} {\displaystyle j\in \{1,\ldots ,k\}} ist. Demnach ist ein Wort u {\displaystyle u} {\displaystyle u} genau dann Suffix eines Wortes w {\displaystyle w} {\displaystyle w} mit w ∈ Σ ∗ {\displaystyle w\in \Sigma ^{\ast }} {\displaystyle w\in \Sigma ^{\ast }}, wenn es mindestens ein p ∈ Σ ∗ {\displaystyle p\in \Sigma ^{\ast }} {\displaystyle p\in \Sigma ^{\ast }} gibt, so dass p ∘ u = w {\displaystyle p\circ u=w} {\displaystyle p\circ u=w} ist:

u {\displaystyle u} {\displaystyle u} ist Suffix von w : ⟺ ∃ p ∈ Σ ∗ : p ∘ u = w {\displaystyle w:\;\Longleftrightarrow \exists p\in \Sigma ^{\ast }:\;p\circ u=w} {\displaystyle w:\;\Longleftrightarrow \exists p\in \Sigma ^{\ast }:\;p\circ u=w}

Wie für Präfixe und Infixe gilt auch für Suffixe, dass das leere Wort ein Suffix jedes beliebigen Wortes und ein beliebiges Wort stets auch ein Suffix von sich selbst ist. Ein Suffix eines Wortes, das nicht identisch mit ihm ist, wird echtes Suffix genannt.

Beispiel

[Bearbeiten | Quelltext bearbeiten]

Sei w = a b a a b b {\displaystyle w=abaabb} {\displaystyle w=abaabb}, so lauten die echten Suffixe für w {\displaystyle w} {\displaystyle w}:

  • b a a b b {\displaystyle baabb} {\displaystyle baabb}
  • a a b b {\displaystyle aabb} {\displaystyle aabb}
  • a b b {\displaystyle abb} {\displaystyle abb}
  • b b {\displaystyle bb} {\displaystyle bb}
  • b {\displaystyle b} {\displaystyle b}
  • ε {\displaystyle \varepsilon } {\displaystyle \varepsilon }.

Literatur

[Bearbeiten | Quelltext bearbeiten]
  • John E. Hopcroft, Jeffry D. Ullman: Einführung in die Automatentheorie, formale Sprachen und Komplexitätstheorie. 3. korrigierte Auflage. Addison-Wesley, Bonn u. a. 1994, ISBN 3-89319-744-3 (Internationale Computer-Bibliothek). 
  • Katrin Erk, Lutz Priese: Theoretische Informatik. Eine umfassende Einführung. 2. erweiterte Auflage. Springer-Verlag, Berlin u. a. 2002, ISBN 3-540-42624-8, S. 27–28 (Springer-Lehrbuch). 
  • Gottfried Vossen, Kurt-Ulrich Witt: Grundkurs theoretische Informatik. Eine anwendungsbezogene Einführung - für Studierende in allen Informatik-Studiengängen. 4. verbesserte und erweiterte Auflage. Vieweg, Wiesbaden 2006, ISBN 3-8348-0153-4, S. 15 (eingeschränkte Vorschau in der Google-Buchsuche). 
  • M. Lothaire: Combinatorics on Words. Cambridge University Press, 1997, ISBN 0-511-56609-3, S. 1 ff., doi:10.1017/CBO9780511566097. 

Anmerkungen und Einzelnachweise

[Bearbeiten | Quelltext bearbeiten]
  1. ↑ Gebräuchlich sind beide Pluralformen, vgl. z. B. dtv-Atlas zur Mathematik, Bd. I, ISBN 3-423-03007-0, S. 245 versus Bauer, Goos: Informatik. Bd. I, ISBN 3-540-06332-3, S. 28.
  2. ↑ Klaus Reinhardt: Prioritätszählerautomaten und die Synchronisation von Halbspursprachen, Fakultät Informatik der Universität Stuttgart; Doktorarbeit 1994 (PDF; 509 KB)
  3. ↑ Dabei ist | w | = ∑ x ∈ Σ | w | x {\displaystyle |w|=\sum \limits _{x\in \Sigma }|w|_{x}} {\displaystyle |w|=\sum \limits _{x\in \Sigma }|w|_{x}}.
  4. ↑ Yuri L. Ershov, Eugenii A. Palyutin: Mathematical Logic. Translated from the Russian by Vladimir Shokurov. Revised from the 1979 Russian edition. Mir Publishers, Moskau 1984, S. 16 (mirtitles.org). 
  5. ↑ Definition von Tupel und seine Synonyme: Encyclopedia of Mathematics: Tuple
  6. ↑ Die Spiegelung eines Wortes der Länge n ist eine spezielle selbstinverse Permutation
    σ n = ( 1 2 ⋯ n n n − 1 ⋯ 1 ) {\displaystyle \sigma _{n}={\begin{pmatrix}1&2&\cdots &n\\n&n-1&\cdots &1\end{pmatrix}}} {\displaystyle \sigma _{n}={\begin{pmatrix}1&2&\cdots &n\\n&n-1&\cdots &1\end{pmatrix}}}.
    Die Spiegelung beliebig langer Wörter ist dann die Vereinigung R = ⋃ { σ n | n ∈ N } {\displaystyle {}^{R}=\bigcup \{\sigma _{n}|n\in \mathbb {N} \}} {\displaystyle {}^{R}=\bigcup \{\sigma _{n}|n\in \mathbb {N} \}}

Weblinks

[Bearbeiten | Quelltext bearbeiten]
  • Grundbegriffe der formalen Sprache – Abschnitt „Wort“
Abgerufen von „https://de.teknopedia.teknokrat.ac.id/w/index.php?title=Wort_(theoretische_Informatik)&oldid=257253552“
Kategorie:
  • Theorie formaler Sprachen

  • indonesia
  • Polski
  • العربية
  • Deutsch
  • English
  • Español
  • Français
  • Italiano
  • مصرى
  • Nederlands
  • 日本語
  • Português
  • Sinugboanong Binisaya
  • Svenska
  • Українська
  • Tiếng Việt
  • Winaray
  • 中文
  • Русский
Sunting pranala
Pusat Layanan

UNIVERSITAS TEKNOKRAT INDONESIA | ASEAN's Best Private University
Jl. ZA. Pagar Alam No.9 -11, Labuhan Ratu, Kec. Kedaton, Kota Bandar Lampung, Lampung 35132
Phone: (0721) 702022
Email: pmb@teknokrat.ac.id