Header Ads

  • Highlights

    👩🏻‍💻 Hello Readers 🧑🏻‍💻!!! Would you like to Explore more ? Hit on ⓘ(Ads)... ✨🌹

    Understand about Regular Language

    In this article we will study concept of Regular Language.

    Regular Language

    A language is said to be regular if it is accepted by finite automata or have regular expression. In other words we can say if particular language is accepted by machine then the language is said to be regular. A regular language described by regular grammar.

    The concept of regular language is easy to understand by the pictorial representation mentioned below. Pictorial representation defines how regular expression, Regular grammar or finite automata defines the regular language.

    Regular Language in TOC

    language is a set of strings which are made up of characters from a specified alphabet, or set of symbols. Regular languages are a subset of the set of all strings. Which are used in parsing and designing programming languages.

    These are useful for helping to recognize patterns in data and group certain computational problems together. Regular languages plays important role in computability theory. It can model computational problems which require a very small amount of memory. For example, a finite automaton can generate a regular language to describe if a light switch is on or off, but it cannot keep track of how many times the light was switched on or off.

    The machine above can know what state it is currently in, on or off, but it doesn't know what the history of flips was to get it to where it is (i.e. it doesn't know how many times the switch has been flipped on or off).

    Finite automata generate or model regular languages. This means that regular languages can be described by a simple state machine diagram. A finite state machine, M, describes a given language, LM is said to accept a string w if the machine starts in a start state, undergoes some series of state transitions, and ends up in an accepting state. We say that the machine M recognizes the language L if M accepts all strings w that are in L. A language is a regular language if there is a finite automaton that recognizes it. (It will be discuss in detail in some other article).

    Operations on Regular Languages

    A regular language can be represented by a string of symbols and operations.

    Concatenation

    Concatenation is an operation that combines two symbols, sets, or languages. There are two main ways to write a concatenation.  XY and XY both mean “X concatenated with Y.” Languages can also be concatenated: L1​∘L2​ means strings from  L1​ are written first, and then strings from L2 come after.

    Formally, concatenation is defined as follows:  AB={xyx A and y B}.

    Union

    Union is an operation where a finite state machine can make one choice or another at any step (this can also be thought of as an “or” operation). For example, there could be a finite state machine that can choose between concatenating XX with YY or concatenating XX with ZZ. Or is written with a vertical bar, and the expression from the previous sentence looks like this: (XYXZ).

    Formally, union is described as follows: AB={xxA or xB}. Note, here the vertical bar means “such that.”

    Kleene Star

    The Kleene star is an operation denoted by an asterisk * that basically represents repeated self-concatenation. For example, if a language LL represents all strings of the form X*, then this language includes XXXXXXXXXXXXXXXXXXXX, etc. The Kleene star can repeat the symbol it operates on any number of times.

    The regular language XYZ represents strings of the form “X concatenated with Y or Z repeated any number of times.”

    Formally, the Kleene star is defined as follows: A={x1x2​...xk​ ∣ k≥0 and each xi​∈A}. The Kleene star is a unary operation since it operates only on one thing instead of two (unlike union and concatenation, which are binary operations).

    Because k can be 0,  x can be repeated 0 times. This means that the empty string is always a member of A.

    The Empty String

    Another important symbol is ϵ which represents the empty string.

    Language Notation

    Languages are often written as follows: L=(some pattern)∣∣​(some condition), where the vertical bar means "such that." The pattern often resembles something like this 0n1n, where the exponent actually represents a unary operation — the 0 would be repeated n times. For example,  0414 is written out as 0000111100001111.

    Also, Study about: 

    Also Read, some interview tips

    No comments

    Post Bottom Ad

    Powered by Blogger.