Which of the following is type 1 language or Type 1 grammar?
2025
Which of the following is type 1 language or Type 1 grammar?
- A.
Regular grammar
- B.
Context Free Grammar
- C.
Context Sensitive Grammar
- D.
Recursively Enumerable
Attempted by 54 students.
Show answer & explanation
Correct answer: C
In the Chomsky hierarchy, Type 1 grammars are context-sensitive grammars. These grammars have production rules of the form αAβ → αγβ, where A is a non-terminal, and α, β, γ are strings of terminals and non-terminals, with γ non-empty. The key feature is that the length of the right-hand side is not less than the left-hand side.
Option A refers to regular grammar, which is Type 3. These are the most restricted, with productions of the form A → a or A → aB. Since regular grammars are not context-sensitive, this option is incorrect.
Option B refers to context-free grammar, which is Type 2. These have productions of the form A → γ, where A is a non-terminal and γ is a string of terminals and non-terminals. Context-free grammars are not context-sensitive, so this option is incorrect.
Option C refers to context-sensitive grammar, which is Type 1. These grammars allow context-dependent rules and are more powerful than context-free grammars. This matches the definition of Type 1 grammar, so this option is correct.
Option D refers to recursively enumerable languages, which are generated by Type 0 grammars. These are the most general, with no restrictions on production rules. Since Type 0 is not Type 1, this option is incorrect.
हिन्दी उत्तर:
चोम्स्की पद्धति में, प्रकार 1 व्याकरण संदर्भ-संवेदी व्याकरण होते हैं। इनके उत्पादन नियम αAβ → αγβ के रूप के होते हैं, जहाँ A एक अनुवादनीय चर है, और α, β, γ टर्मिनल और अनुवादनीय चरों की स्ट्रिंग हैं, जहाँ γ गैर-खाली है। मुख्य विशेषता यह है कि दाईं ओर की स्ट्रिंग की लंबाई बाईं ओर की स्ट्रिंग की लंबाई से कम नहीं होती है।
विकल्प A नियमित व्याकरण को संदर्भित करता है, जो प्रकार 3 है। ये सबसे अधिक सीमित होते हैं, जिनके उत्पादन A → a या A → aB के रूप के होते हैं। चूँकि नियमित व्याकरण संदर्भ-संवेदी नहीं होते हैं, इसलिए यह विकल्प गलत है।
विकल्प B संदर्भ-मुक्त व्याकरण को संदर्भित करता है, जो प्रकार 2 है। इनके उत्पादन A → γ के रूप के होते हैं, जहाँ A एक अनुवादनीय चर है और γ टर्मिनल और अनुवादनीय चरों की स्ट्रिंग है। संदर्भ-मुक्त व्याकरण संदर्भ-संवेदी नहीं होते हैं, इसलिए यह विकल्प गलत है।
विकल्प C संदर्भ-संवेदी व्याकरण को संदर्भित करता है, जो प्रकार 1 है। ये व्याकरण संदर्भ-निर्भर नियमों की अनुमति देते हैं और संदर्भ-मुक्त व्याकरणों से अधिक शक्तिशाली होते हैं। यह प्रकार 1 व्याकरण की परिभाषा के साथ मेल खाता है, इसलिए यह विकल्प सही है।
विकल्प D पुनरावर्ती रूप से गिनी जा सकने वाली भाषाओं को संदर्भित करता है, जो प्रकार 0 व्याकरण द्वारा उत्पन्न होती हैं। ये सबसे सामान्य होते हैं, जिनके उत्पादन नियमों पर कोई प्रतिबंध नहीं होता है। चूँकि प्रकार 0 प्रकार 1 नहीं है, इसलिए यह विकल्प गलत है।