Header Ads

  • Highlights

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

    What do you understand by Derivation?


    Derivation is the process of passing or verifying a string by generating a language from the given grammar which is also known as production rules, the non-terminals(variables) are replaced by the corresponding strings of the right-hand side (RHS) of the production.

    But if there is more than one non-terminal(variable) were present in any grammar, then which of the ones will be replaced must be determined. Depending on this selection, the derivation is divided into two parts:     

    Leftmost derivation

    Leftmost derivation: In this type of derivation, we replace only the leftmost non-terminal(variable) by some production rule at each step of the generating process of the language from the grammar.

    ·         The process of deriving a string by expanding the leftmost non-terminal at each step is called as leftmost derivation.

    ·         The geometrical representation of leftmost derivation is called as a leftmost derivation tree.

    Rightmost derivation

    Rightmost derivation: In this type of derivation, we replace only the rightmost non-terminal(variable) by some production rule at each step of the generating process of the language from the grammar.

    ·         The process of deriving a string by expanding the rightmost non-terminal at each step is called as rightmost derivation.

    ·         The geometrical representation of the rightmost derivation is called a rightmost derivation tree.

    Example

    Construct the string abbbb from the grammar given below by using LMD and RMD.


    Solution :


     


    (Note: Keep your mobile horizontally for better reading)

     Also, Study about: 

    Also Read, some interview tips



    No comments

    Post Bottom Ad

    Powered by Blogger.