Automata Theory and Formal Languages: Alphabets, Strings, and Languages

Alphabets

  • An alphabet is defined as any non-empty finite set of symbols.

  • The individual elements within an alphabet are referred to as symbols of that alphabet.

  • Notation: The symbol Σ\Sigma (sigma) is used to denote an alphabet. Alternatively, upper case letters may be used.

  • Example 1:

    • Σ1={0,1}\Sigma_1 = \{0, 1\}

    • Σ2={a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}\Sigma_2 = \{a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z\}

    • Σ3={0,1,2,3,4,5,6,7,9,8,9}\Sigma_3 = \{0, 1, 2, 3, 4, 5, 6, 7, 9, 8, 9\}

Strings

  • A string (denoted by ww) over an alphabet is a finite sequence of symbols chosen from that specific alphabet.

  • Syntax: Symbols within a string ww are written sequentially without the use of commas to separate them.

  • Example 2:

    • Over alphabet Σ1={0,1}\Sigma_1 = \{0, 1\}, possible strings ww include {0,1,00,01,10,11,000,001,… }\{0, 1, 00, 01, 10, 11, 000, 001, \dots\}. Specific examples include 001001, 001001001001, and 1000011010000110.

    • Over alphabet Σ2={a,b}\Sigma_2 = \{a, b\}, possible strings ww include {a,b,aa,ab,ba,bb,aaa,bbaa,… }\{a, b, aa, ab, ba, bb, aaa, bbaa, \dots\}. Specific examples include abab, bbaabbaa, aaaabbbabbaaaabbbabb, and babababbababab.

Core Symbols and Glossary

  • Σ\Sigma (sigma): Alphabet

  • {}\{ \}: Set notation

  • WW: String

  • ∣A∣|A|: Cardinality (the size or number of elements)

  • λ\lambda (lembda): Empty string

  • ϕ\phi (phi): Prefix

  • χ\chi (chi): Suffix

  • wkw^k: kk copies of the string ww

  • LL: Language

  • L∗L^*: Kleene Closure of LL

  • Union: Combining sets

String Attributes and Operations

  • Length of a String: The length of string ww, denoted by ∣w∣|w|, is the total count of symbols composing that string.

    • Example 3: If w=abcdw = abcd, then ∣w∣=4|w| = 4.

  • Empty String: A string with a length of 0 is called an empty or null string. It is denoted by the symbol λ\lambda (lembda). Therefore, ∣λ∣=0| \lambda | = 0.

  • Substring: A string zz is considered a substring of ww if the sequence of symbols in zz appears consecutively within ww.

    • Example 4: If w=bananaw = banana and z=anaz = ana, zz is a substring of ww because the symbols in "ana" are found consecutively in the word "banana."

  • Concatenation: The concatenation of string xx (length mm) and string yy (length nn) is the sequence formed by appending string yy directly to the end of string xx.

    • Formal representation: If x=x1x2x3…xmx = x_1x_2x_3 \dots x_m and y=y1y2y3…yny = y_1y_2y_3 \dots y_n, then the concatenation is the sequence x1x2x3…xmy1y2y3…ynx_1x_2x_3 \dots x_m y_1y_2y_3 \dots y_n.

    • Example 5: If x=lapx = lap and y=topy = top, the concatenation is xy=laptopxy = laptop.

  • Prefixes and Suffixes: In the context where string w=ϕχw = \phi \chi:

    • ϕ\phi (phi) is the prefix of ww.

    • χ\chi (chi) is the suffix of ww.

    • Proper Prefix: ϕ\phi is a proper prefix if χ≠λ\chi \neq \lambda.

    • Proper Suffix: χ\chi is a proper suffix if ϕ≠λ\phi \neq \lambda.

    • Contextual Example: In the word laptoplaptop, xx (laplap) is a proper prefix and yy (toptop) is a proper suffix.

  • String Repetition (wkw^k): This notation signifies the repetition of string ww for a total of kk copies.

    • Example 6: If w=abw = ab:

      • w0=λw^0 = \lambda

      • w1=abw^1 = ab

      • w2=ababw^2 = abab

      • w3=abababw^3 = ababab

Languages and Formal Notation

  • Language (L): A language is a set containing all possible strings derived from a given alphabet Σ\Sigma that satisfy a specific criterion or condition.

  • Example 7: A language defined as the set of strings of 00's and 11's where no two 11's appear consecutively.

    • L={λ,0,1,00,01,10,000,001,010,100,101,0000,0001,0010,0100,0101,1000,1001,1010,… }L = \{ \lambda, 0, 1, 00, 01, 10, 000, 001, 010, 100, 101, 0000, 0001, 0010, 0100, 0101, 1000, 1001, 1010, \dots \}

  • Defining Languages: There are multiple methodologies for defining a language:

    • L(M)L(M): Notation for a language defined by a specific machine MM.

    • L(G)L(G): Notation for a language defined by a grammar GG.

    • M(L)M(L): Notation for a machine designed to accept a specific language LL.

    • G(L)G(L): Notation for a grammar that recognizes a specific language LL.

  • Language Characteristics/Notation: Describes characteristics of a language using rules and symbols.

  • Example 8: Given Σ={x,y}\Sigma = \{x, y\}

    • If L1={x,xx,xxx,xxxx,… }L_1 = \{x, xx, xxx, xxxx, \dots \}, the notation is L1={xk∣k≥1}L_1 = \{x^k | k \geq 1 \}. This is read as "kk copies of xx such that kk is greater than or equal to 1."

    • If L2={λ,xy,xyxy,xyxyxy,… }L_2 = \{ \lambda, xy, xyxy, xyxyxy, \dots \}, the notation is L2={(xy)k∣k≥0}L_2 = \{(xy)^k | k \geq 0 \}. This is read as "kk copies of xyxy such that kk is greater than or equal to 0."

Operations on Languages

  • Given specific language sets L={A,B,C,D}L = \{A, B, C, D\} and D={1,2,3}D = \{1, 2, 3\}, the following operations apply:

  • Union (L∪DL \cup D): This operation combines all elements from both sets.

    • L∪D={A,B,C,D,1,2,3}L \cup D = \{A, B, C, D, 1, 2, 3\}.

  • Concatenation (L⋅DL \cdot D or LDLD): This involves concatenating every individual element in the first set with every individual element in the second set.

    • L⋅D={A1,A2,A3,B1,B2,B3,C1,C2,C3,D1,D2,D3}L \cdot D = \{A1, A2, A3, B1, B2, B3, C1, C2, C3, D1, D2, D3\}.

  • Kleene Closure (L∗L^*): This set includes every possible string that can be formed from language LL, inclusive of the empty string (λ\lambda).

  • Positive Closure (L+L^+): This includes the set of all strings consisting of one or more symbols, specifically excluding the empty string.

    • Formula: L+=L∗−λL^+ = L^* - \lambda.