Tuesday, August 30, 2022

symbol alphabets string language

 

Explain the term :

Symbols:

Symbols are an entity or individual objects, which can be any letter, alphabet or any picture.

Example:

1, a, b, #

Alphabets:

Alphabets are a finite set of symbols. It is denoted by ∑.

Examples:∑ = {a, b} 

∑ = {A, B, C, D} 

 ∑ = {0, 1, ....., 5}   

 ∑ = {#, β, Δ}  

String:

It is a finite collection of symbols from the alphabet. The string is denoted by w.

Example 1:

If ∑ = {a, b}, various string that can be generated from ∑ are {ab, aa, aaa, bb, bbb, ba, aba.....}.

  • A string with zero occurrences of symbols is known as an empty string. It is represented by ε.
  • The number of symbols in a string w is called the length of a string. It is denoted by |w|.

Example 2:

w = 010

Number of Sting |w| = 3  

Language:

A language is a collection of appropriate string. A language which is formed over Σ can be Finite or Infinite.

Example: 1

L1 = {Set of string of length 2}

 

     = {aa, bb, ba, bb}          Finite Language

Example: 2

L2 = {Set of all strings starts with 'a'}

 

     = {a, aa, aaa, abb, abbb, ababb}         Infinite Language

No comments:

Post a Comment