Character strings

This is a discussion on Character strings within the C++ Programming forums, part of the General Programming Boards category; Consider the language in the alphabet {a,b} defined by the grammar: Code: <S> = a<S>a | b<S>b | a | ...

  1. #1
    Registered User
    Join Date
    Jun 2004
    Posts
    40

    Character strings

    Consider the language in the alphabet {a,b} defined by the grammar:

    Code:
     
    <S> = a<S>a | b<S>b | a | b
    What are the 5 character strings in this language. Not sure what this means? Is it:
    aa
    bb
    a
    b
    what would the 5th one be?

  2. #2
    Registered User jlou's Avatar
    Join Date
    Jul 2003
    Posts
    1,088
    It means what are all of the strings in this alphabet that have five characters? You must think recursively since a string can be defined recursively. Figure out all of the different combinations of strings that have five characters and are valid for that grammar.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Reading strings input by the user...
    By Cmuppet in forum C Programming
    Replies: 13
    Last Post: 07-21-2004, 07:37 AM
  2. finding strings in strings
    By watshamacalit in forum C Programming
    Replies: 14
    Last Post: 01-11-2003, 01:08 AM
  3. character strings and reading in a file...
    By Unregistered in forum C Programming
    Replies: 14
    Last Post: 07-30-2002, 10:51 AM
  4. UNICODE and GET_STATE
    By Registered in forum C++ Programming
    Replies: 1
    Last Post: 07-15-2002, 04:23 PM
  5. Array of character strings
    By nima_ranjbar in forum C++ Programming
    Replies: 1
    Last Post: 02-08-2002, 09:37 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21