- Trending Categories
- Data Structure
- Operating System
- MS Excel
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Explain the Star Height of Regular Expression and Regular Language
The star height of Regular expression (RE) is nothing but the depth of Kleene stars in the theory of computation (TOC).
- a+b the star height is 0
- (a+b)* the star height is 1
- (a*+b*)* the star height is 2 …….
Star height is used to indicate the structural complexity of regular languages and expressions.
The regular expressions may have different star height that depends on structural complexity or nesting.
The star height of a regular language is a unique number and that is equal to the least star height of any regular expression which represents that language.
The star height of regular expressions is a maximum nesting depth of Kleene stars that appearing in the expression
The star height h(α) of a regular expression α is defined by induction as −
h(Φ) = 0 -----------------1
h(α) =0 for each α€Σ --------------2
h(α ∪ β)= h(α β)= the maximum of h(α) and h(β)----------------3
if α=(((ab)*∪b*)* ∪ a*) then h(α)=2.
Given below is the solution to find a regular expression that represents the same language and having a star height as small as possible.
Let the regular expression is ((abc)*ab)* h(α)=h(((abc)*ab)*) =h((abc)*ab)+1 from eq4 =max(h(abc)*,h(a,b))+1 from eq3 =max(h(abc)+1, max(h(a),h(b)))+1 from eq3 and 4 =max(max(h(a),h(bc))+1, max(0,0))+1 =max(max(0,max(h(b),h(c)))+1,0)+1 =max(max(0,max(0,0))+1,0)+1 from eq2 =max(max(0,0)+1,0)+1 =max(0+1,0)+1 =max(1,0)+1 = 1+1 =2
Kickstart Your Career
Get certified by completing the courseGet Started