0% found this document useful (0 votes)
37 views5 pages

Discrete UQ (Unit-4)

This document contains questions and answers related to languages and grammars. It has two sections - the first section contains multiple choice questions about languages and regular expressions. The second section asks to define concepts, find languages generated by grammars, and design finite state machines and grammars.

Uploaded by

wishesmona
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views5 pages

Discrete UQ (Unit-4)

This document contains questions and answers related to languages and grammars. It has two sections - the first section contains multiple choice questions about languages and regular expressions. The second section asks to define concepts, find languages generated by grammars, and design finite state machines and grammars.

Uploaded by

wishesmona
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

DEPARTMENT OF MATHEMATICS

Computer Science and Computer Applications Stream


Discrete Mathematics - University Questions
Unit-IV: Languages
Section-A: Choose the best answer

1. Which of the following is not correct? (November 2023/ June 2022)


A. |λ| = 0 B. {λ} ⊆ Σ C. λ ∈ / Σ D. |λ| =
6 φ
Ans: C. {λ} ⊆ Σ

2. Which of the following is not correct? (November 2023/ June 2022)


A. concatenation operation is commutative B. |L1 L2 | ≤ |L1 ||L2 |
C. concatenation operation is associative D. |L1 L2 | =
6 |L2 L1 |
Ans: A. concatenation operation is commutative
P
3. ....... is an identity element for concatenation operation on an alphabet (May 2023)
A. λ B. e C. φ D. 1
Ans: A. λ

4. Which of the following is not correct for the regular expression (May 2023)
A. φr = rφ = φ B. r + r = r C. φ + r = φ D. r∗ r∗ = r∗
Ans:

5. If Σ = {0, 1} and u = 01 then |un | = (December 2022)


A. n B. n2 C. n|u| D. n2 |u|
Ans: C. n|u|

6. The compliment of a language with respect to Σ∗ is defined as (December 2022)


A. L − Σ∗ B. Σ − L C. Σ∗ − λ D. Σ∗ − L
Ans: D. Σ∗ − L
7. The concateration operation on an alphabet Σ is (July 2021)
A. Associative B. commutative C. Associative but not commutative
D. Associative and commutative
Ans: C. Associative but not commutative

8. Which of the following is false? (July 2021)


A. |L1 L2 | = |L2 L1 | B. |L1 L2 | ≤ |L1 ||L2 | C. |L1 L2 | =
6 |L2 L1 |
D. |L1 × L2 | = |L2 × L1 |
Ans: C. |L1 L2 | = |L2 L1 |

9. For an alphabet Σ and languages L1 and L2 , (L∗1 ∪ L∗2 )∗ = ....... (December 2020)
A. L1 L2 B. L∗1 L∗2 C. (L∗1 L∗2 )∗ D. (L1 ∪ L2 )
Ans: C. (L∗1 L∗2 )∗

10. Let L1 = {a, b} and L2 = {a, c} be Languages over Σ = {a, b, c}. Then (L1 ∩ L2 )∗ = .........
(December 2020)
A. {b} B. {a} C. {an : n ≥ 0} D. {bn : n ≥ 0}
Ans: C. {an : n ≥ 0}

11. Which of the following is not true? (April 2019)


A. L+ ⊆ L∗ B. L∗ = {λ} ∪ L+ C. L+ = L∗ − {λ} D. Ln+1 = Ln L
Ans: C. L+ = L∗ − {λ}

12. L1 consists of all strings beginning with one or more a’s followed by one or more b’s. Then
the corresponding regular expression r over the alphabet Σ = {a, b} is (April 2019)
A. bb∗ abb∗ B. b∗ bab∗ b C. aa∗ bb∗ D. (a + b)∗
Ans: C. aa∗ bb∗

13. Which of the following is not true? (April 2018/ November 2018)
A. L+ ⊆ L∗ B. Ln+1 = Ln L C. L∗ = {λ} ∪ L+ D. L∗ ⊆ L+
Ans: D. L∗ ⊆ L+

14. Which of the following is not true, if r1 and r2 are two equivalent regular expressions (April
2018)
A. (r1 + r2 )∗ = r1∗ + r2∗ B. (r1 r2 )∗ r1 = r1 (r2 r1 )∗ C. (r1 r2 )∗ r1 = r1∗ (r2 r1 ) D. (r1∗ )∗ = r1∗
Ans: C. (r1 r2 )∗ r1 = r1∗ (r2 r1 )

Page 2
15. Let L1 = {a, b} and L2 = {b, c} be languages over Σ = {a, b, c} then (L2 −L∗1 )∗ is (November
2018)
A. {an : n ≥ 0} B. {bn : n ≥ 0} C. {cn : n ≥ 0} D. {a, b, c}∗
Ans: C. {cn : n ≥ 0}

16. Let Σ = {a, b, c, d}. Then |Σ3 |=..... (November 2017)


A. 4 B. 16 C. 32 D. 64
Ans: D. 64, i.e., 43 −→ no. of elements in Σ

17. Which one of the following is not true (November 2017)


A. |un | = n|u| B. |L1 L2 | = |L2 L1 | C. |uv| = |u| + |v|
D. L∗ ⊆ L∗ for all languages L
Ans: B. |L1 L2 | = |L2 L1 |

18. Let u = a2 bab2 and v = bab2 then |uλv|=...... (April 2017)


A. 6 B. 8 C. 10 D. 12
Ans: C. 10

19. Let V = bab2 then |v 2 | =? (November 2016)


A. 4 B. 6 C. 8 D. 10
Ans: C. 8

Section-B

1. Explain the different types of grammars. (November 2023/ June 2022).

2. Let L1 = {a, ab, a2 } and L2 = {b2 , aba} be two languages over the alphabet Σ{a, b}, then find
L1 L2 , L2 L1 , L22 , L21 . (November 2023/ June 2022/July 2021/December 2020/April
2019/November 2017)

3. If L = {ab, a2 } be a language over the alphabet Σ = {a, b}. Then find L0 , L2 , L3 (May
2023)

4. Explain the Backus-Naur form with example (May 2023)

5. If L = {ab, c} be a language over the alphabet Σ = {a, b}. Then find L0 , L2 , L3 (December
2022)

6. Explain the major features of FSM. (December 2022)

Page 3
7. Define regular language. Also describe the language L = {bm abn , m, n > 0} by regular
expression r over the alphabet Σ{a, b}. (April 2019).

8. Let L1 = {a, b} and L2 = {a2 , ab, b2 }. Find L1 L2 , L2 L1 and L1 L1 (April 2018/November


2016)

9. Explain regular expression with example.(April 2018)


(OR) List all the identities of regular expressions. (July 2021)

10. If L = {ab, c} over Σ = {a, b, c} find L0 , L3 , L−3 (November 2018)

11. Find the language L(G) generated by the grammar with V = {S, A}, Σ = {a, b, c} and
productions P = {S → aSb, aS → Aa, Aab → c} (November 2018/2017)

12. If L = {a2 , ba} find L0 , L2 and L3 . (December 2020/April 2017)

13. Let Σ = {0, 1}. Show that the following expressions are regular expressions over Σ (April
2017)
(i). 0∗ (0 + 1)
(ii). 00∗ (0 + 1)∗

14. Let Σ = {a, b} be an alphabet show that a∗ (a + b)∗ and aa∗ (a + b)∗ a are regular expression
over Σ. (November 2016)

Section-C

1. Design a finite state automaton M that accepts those strings from Σ = {a, b} which have
even number of 0 a0 . (November 2023/ December 2022/June 2022)

2. Consider the language L = {bn abn : n ≥ 0}. Find grammar G which generate L. (Novem-
ber 2023/ June 2022)

3. Find the phrase structure grammar that generate the language L = {an b2n : n ≥ 1} (May
2023)

4. Design a finite-state machine M where the input set is {0, 1, 2} and the output set contains
digits which are modulo 3 sum of the digits in the input sequence. (May 2023/ December
2020/ November 2018/ November 2016)

Page 4
5. Consider the language L = {an bn : n ≥ 1}. Find grammar G which generate L. (December
2022)

6. Define Deterministic finite-state automaton. Also draw a transition diagram of a finite state
automation M that accepts binary sequences that ends with the digits 011 over the set
Σ{0, 1}. (July 2021/April 2019/November 2017)

7. Find the context free grammar G which generates L = {an bm : n 6= m}. (July 2021/
December 2020/ April 2018/November 2018/2017)

8. Construct regular grammar to generate the language L = {al bm cn : l, m, n ≥ 1}. (April


2019)

9. Consider the context free grammar with productions S → bAS, S → b, A → aS find the
derivation tree of the word w = babbabb. (April 2018/2017)

10. Find the language L(G) generated by the grammar with V = {S, A, B}, Σ = {a, b} and
productions P = {S → aB, B → b, B → bA, A → aB} (November 2016)

zzzzz

You might also like