in Theory of Computation recategorized by
10,287 views
29 votes
29 votes

In some programming language, an identifier is permitted to be a letter followed by any number of letters or digits. If $L$ and $D$ denote the sets of letters and digits respectively, which of the following expressions defines an identifier?

  1. $(L + D)^+$
  2. $(L.D)^*$
  3. $L(L + D)^*$
  4. $L(L.D)^*$
in Theory of Computation recategorized by
10.3k views

3 Comments

edited by
from [D] we can not generate letter followed by letters only or letter followed by digits.
–2
–2
1
1
a letter followed by( any number of( letters or digits)*).
0
0

8 Answers

38 votes
38 votes
Best answer

Correct Option: C

It has to be started by a letter followed by any number of letters (or) digits.

edited by

4 Comments

Letter followed by any number of letters OR digits

Letter followed by any number of letters AND digits.

How they are different ??
0
0

Letter followed by any number of letters AND digits.

this means letter should be followed by both letters and digits.

A3 and AB will be rejected in this case

0
0
@karthikeyan
 (L U D) or L+D defines elements either in L or in D or in both. In question they have asked "letters or digits", hence LUD.
0
0
9 votes
9 votes

It has to be started by a letter 

3 votes
3 votes
Question is of form- R.E. which starts with L

Hence answer is C
1 vote
1 vote
Simply

Option C. L(L+D)*
Answer:

Related questions