

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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).
For example,
- 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
Example
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
h(α*)=h(α)+1----------------4
For example,
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
- Related Questions & Answers
- Explain the concept of Regular expression.
- Explain the relationship between Finite Automata and Regular Expression.
- Explain C# Quantifiers in regular expression
- Explain C# Substitution in regular expression
- Explain C# Grouping Constructs in regular expression
- Explain Python regular expression search vs match
- Explain JavaScript Regular Expression modifiers with examples
- Explain the Java regular expression construct "re?".
- Explain the different operations on Regular language in TOC.
- Explain the sub-expression "[...]" in Java Regular expressions
- Explain Regular Expression "A" Metacharacter in Java
- Explain Regular Expression "w" Metacharacter in Java
- Explain Regular Expression "s" Metacharacter in Java
- Counting the number of groups Java regular expression
- Regular Expression Metacharacter in Java