Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3402524
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:08:55+00:00 2026-05-18T05:08:55+00:00

I am trying to do an exercise where I translate a grammar into Chomsky

  • 0

I am trying to do an exercise where I translate a grammar into Chomsky normal form. I understand how to do this in normal circumstances but this time the grammar I am working with is right recursive. (Technically the grammar is the answer to the previous question, so I might just have the wrong gamma.)

I think I can do this by using a fixed sequence of rules in place of ε rules but I want to make sure I’m not heading in the wrong direction. It’s easier to explain with an example:

For a grammar that produces n ‘a’s where n is greater than 0 and a multiple of three: (don’t worry, this is entirely different to the grammar my actual exercise)

S-> Aaaa
A-> Aaaa
A-> ε

Would the correct Translation be:

S0-> S
S-> A'B
A'-> AA'
A-> A'B
B-> B'C
A'-> a
B'-> a
C-> a
  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T05:08:56+00:00Added an answer on May 18, 2026 at 5:08 am

    Although your grammar is right-recursive, you can perform the Chomsky Normal Form transformation as you would any other (non-right recursive) grammar. Simply follow the algorithm outlined in your book, which probably consists of two steps: (1) replace all occurrences of terminals a by rules A -> a, where A does not occur in the rule set; (2) transform all rules A -> w, where len(w) > 2, by rules of length 2 containing fresh variables.

    For your A rule, then, construct a rule for deriving terminals, say K -> a, and replace all occurrences of the terminal a:

    A -> AKKK
    

    Then put the grammar into CNF

    A    -> AA'
    A'   -> KA''
    A''  -> KK
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I trying to complete this exercise; Write a Lisp function that takes as input
I am trying to do exercise 2.78 in SICP, but the functions put and
Trying to learn C++ and working through a simple exercise on arrays. Basically, I've
I'm trying to solve the last exercise of this JavaScript Closure Tutorial which takes
I'm trying to create a logger for a GWT application as an exercise to
I'm trying to learn scheme via SICP. Exercise 1.3 reads as follow: Define a
I'm brand new to MVC and, as a learning exercise, I'm trying to re-write
Trying to get my css / C# functions to look like this: body {
Trying to keep all the presentation stuff in the xhtml on this project and
Trying to make a MySQL-based application support MS SQL, I ran into the following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.