1,546 views
2 votes
2 votes

For S ∈ (0 + 1) * let d(s) denote the decimal value of s (e.g. d(101) = 5). Let L = {s ∈ (0 + 1)* d(s)mod5 = 2 and d(s)mod7 != 4}. Which one of the following statements is true?

A

L is recursively enumerable, but not recursive

B

L is recursive, but not context-free

C

L is context-free, but not regular

D

L is regular

2 Answers

6 votes
6 votes
We can have a finite automata for    d(S) mod 5   and d(S)mod 7 != 4

Now, intersection of regular language is regular.

 

Hence, option D
0 votes
0 votes
Let L1 = {s ∈ (0 + 1)* | d(s) mod5 = 2}, we can construct the DFA for this which will have 5 states (remainders 0,1,2,3,4)
L2 = {s ∈ (0 + 1)* | d(s) mod7 = 4}, we can construct the DFA for this which will have 7 states (remainders 0,1,2,3,4,5,6)
Since L1 and L2 have DFAs, hence they are regular. So the resulting Language.
L = L1 ∩ L2 (compliment) must be regular (by closure properties, INTERSECTION of two regular languages is a regular language).

Related questions

29 votes
29 votes
1 answer
1
Ishrat Jahan asked Oct 31, 2014
7,946 views
Which of the following statements about regular languages is NOT true ?Every language has a regular supersetEvery language has a regular subsetEvery subset of a regular l...
0 votes
0 votes
0 answers
3
go_editor asked Mar 27, 2020
417 views
The $\text{LAPB}$ frame structure and the frame structure of $\text{SDLC}$ are :OppositeIdenticalReversedNon-identical
0 votes
0 votes
1 answer
4
go_editor asked Mar 27, 2020
710 views
The program used to determine the round – trip delay between a workstation and a destination adress is :TracertTraceroutePingPop