Theory of Computation & Compilers Previous Year Questions
20 Theory of Computation & Compilers (Computer Science) questions asked in Bihar STET previous year papers, each with the correct answer and explanation. Read them free on UTpaper, or attempt the full papers as timed online tests.
Q1Bihar STET 2024 Paper II Computer Science, 11 Jun 2024, Shift 2 (3:00 PM)
String X is accepted by finite automata ifस्ट्रिंग एक्स को परिमित ऑटोमेटा द्वारा स्वीकार किया जाता है यदि
Aδ*(q,x) E Aδ*(q,x) E A
Bδ(q,x) E Aδ(q,x) E A
Cδ(Q0,x) E Aδ(Q0,x) E A
Dδ*(Q0,x) E Aδ*(Q0,x) E A
Show answerHide answer
Correct answer: (D)δ*(Q0,x) E Aδ*(Q0,x) E A
Explanation
A string x is accepted if the extended transition function, starting from the initial state q0, ends in an accepting state: δ*(q0, x) ∈ A (the set of final states).कोई स्ट्रिंग x तब स्वीकार की जाती है जब विस्तारित transition function, आरंभिक अवस्था q0 से शुरू होकर, किसी स्वीकार करने वाली अवस्था पर समाप्त हो: δ*(q0, x) ∈ A (अंतिम अवस्थाओं का समुच्चय)।
Q2Bihar STET 2024 Paper II Computer Science, 11 Jun 2024, Shift 2 (3:00 PM)
Tate true or false: Statement: Every right-linear grammar generates a regular language.टेट सच या गलत: कथन: प्रत्येक सही-रैखिक व्याकरण एक नियमित भाषा उत्पन्न करता है।
ATRUEसत्य
BFALSEगलत
Cmay beहो सकती है
Dcan’t sayनहीं कह सकते
Show answerHide answer
Correct answer: (A)TRUEसत्य
Explanation
Right-linear grammars (A → aB or A → a) are exactly the regular grammars, so every right-linear grammar generates a regular language.Right-linear grammars (A → aB या A → a) ठीक वही regular grammars हैं, इसलिए हर right-linear grammar एक regular भाषा उत्पन्न करता है।
Q3Bihar STET 2024 Paper II Computer Science, 11 Jun 2024, Shift 1 (10:00 AM)
The complement of a language will only be defined when and only when the __________ over the language is defined.किसी भाषा के पूरक को केवल तभी परिभाषित किया जाएगा जब और केवल तभी जब भाषा पर __________ को परिभाषित किया जाता है।
AAlphabetवर्णमाला
BWordशब्द
CStringस्ट्रिंग
DGrammarव्याकरण
Show answerHide answer
Correct answer: (A)Alphabetवर्णमाला
Explanation
The complement of L is Σ* − L, so it can be defined only once the alphabet Σ is fixed.L का complement Σ* − L होता है, इसलिए इसे तभी परिभाषित किया जा सकता है जब वर्णमाला Σ तय हो।
A universal Turing machine takes the description of any other TM and its input and simulates it, so it is a reprogrammable (stored-program) Turing machine.
Q7Bihar STET 2025 Paper II Computer Science, 7 Nov 2025, Shift 1 (9:00 AM)
According to Chomsky hierarchy, which of the following is recognized by Recursively
Enumerable language?चॉम्स्की पदानुक्रम के अनुसार, निम्नलिखित में से कौन पुनरावर्ती रूप से enumerable भाषा द्वारा
मान्यता प्राप्त है?
AType 0प्रकार 0
BType 1प्रकार 1
CType 2प्रकार 2
DType 3प्रकार 3
Show answerHide answer
Correct answer: (A)Type 0प्रकार 0
Explanation
Recursively enumerable languages are Type 0 in the Chomsky hierarchy. They are generated by unrestricted grammars and recognised by Turing machines. Types 1, 2 and 3 are context-sensitive, context-free and regular.Recursively enumerable भाषाएँ Chomsky पदानुक्रम में Type 0 हैं। वे unrestricted व्याकरणों से बनती हैं और Turing मशीनों से पहचानी जाती हैं। Type 1, 2 और 3 क्रमशः context-sensitive, context-free और regular हैं।
Q8Bihar STET 2025 Paper II Computer Science, 4 Nov 2025, Shift 2 (2:00 PM)
Which of the following conversion is not possible (algorithmically)?निम्नलिखित में से कौन सा रूपांतरण संभव नहीं है (एल्गोरिथ्मिक रूप से)?
ARegular grammar to context-free grammarनियमित व्याकरण से संदर्भ-मुक्त व्याकरण तक
BNon-deterministic pushdown automata to deterministic pushdown automataगैर-नियतात्मक पुशडाउन ऑटोमेटा से नियतात्मक पुशडाउन ऑटोमेटा
CNon-deterministic finite state automata to deterministic finite state automataगैर-नियतात्मक परिमित अवस्था ऑटोमेटा से नियतात्मक परिमित अवस्था ऑटोमेटा
DNon deterministic Turing machine to deterministic Turing machineगैर नियतात्मक ट्यूरिंग मशीन से नियतात्मक ट्यूरिंग मशीन
Show answerHide answer
Correct answer: (B)Non-deterministic pushdown automata to deterministic pushdown automataगैर-नियतात्मक पुशडाउन ऑटोमेटा से नियतात्मक पुशडाउन ऑटोमेटा
Explanation
Not every non-deterministic PDA can be converted into a deterministic one, because DPDAs accept only the deterministic context-free languages. NFA-to-DFA and NTM-to-DTM conversions are always possible, and every regular grammar is already context-free.हर non-deterministic PDA को deterministic में नहीं बदला जा सकता, क्योंकि DPDA केवल deterministic context-free भाषाएँ स्वीकार करते हैं। NFA से DFA और NTM से DTM में रूपांतरण हमेशा संभव है, और हर regular व्याकरण पहले से context-free है।
Q9Bihar STET 2025 Paper II Computer Science, 4 Nov 2025, Shift 2 (2:00 PM)
Which of the following is type 1 language or Type 1 grammar?निम्नलिखित में से कौन सा टाइप 1 भाषा या टाइप 1 ग्रामर है?
ARegular grammar/ Regular languageRegular grammar/ Regular language
In the Chomsky hierarchy, Type 0 is recursively enumerable, Type 1 is context-sensitive, Type 2 is context-free and Type 3 is regular.Chomsky पदानुक्रम में Type 0 recursively enumerable, Type 1 context-sensitive, Type 2 context-free और Type 3 regular है।
Q10Bihar STET 2025 Paper II Computer Science, 4 Nov 2025, Shift 2 (2:00 PM)
A universal Turing machine is a--------एक सार्वभौमिक ट्यूरिंग मशीन एक -------- है
A universal Turing machine reads another TM's description plus its input from the tape and simulates it. In effect it is a programmable, reprogrammable Turing machine, the model for stored-program computers.Universal Turing मशीन टेप से किसी दूसरी TM का विवरण और उसका इनपुट पढ़ती है और उसका अनुकरण करती है। असल में यह प्रोग्राम योग्य, पुनः प्रोग्राम की जा सकने वाली Turing मशीन है, जो stored-program कंप्यूटर का मॉडल है।
Q11Bihar STET 2025 Paper II Computer Science, 4 Nov 2025, Shift 2 (2:00 PM)
Which of the following is an extension to the basic model of Turing machine:निम्नलिखित में से कौन ट्यूरिंग मशीन के मूल मॉडल का एक विस्तार है:
Multi-tape, multi-head and non-deterministic Turing machines are all extensions of the basic TM, and none of them adds computational power.Multi-tape, multi-head और non-deterministic Turing मशीन सब मूल TM के विस्तार हैं, और कोई भी गणनात्मक शक्ति नहीं बढ़ाता।
Q12Bihar STET 2025 Paper II Computer Science, 4 Nov 2025, Shift 2 (2:00 PM)
Let the word be “automata”. The total number of states required to recognize the word
using DFA would be __________मान लीजिए शब्द "ऑटोमेटा" है। DFA का उपयोग करके शब्द को पहचानने के लिए आवश्यक कुल
अवस्थाओं की संख्या __________ होगी
A9 states9 अवस्थाएं
B8 states8 अवस्थाएं
C10 states10 अवस्थाएं
Dword cannot be recognized using DFADFA का उपयोग करके शब्द को पहचाना नहीं जा सकता
Show answerHide answer
Correct answer: (A)9 states9 अवस्थाएं
Explanation
"automata" has 8 characters. A DFA needs one state before reading any character plus one after each character: 8 + 1 = 9 states (a dead state is not counted)."automata" में 8 अक्षर हैं। DFA को कोई अक्षर पढ़ने से पहले एक अवस्था और हर अक्षर के बाद एक अवस्था चाहिए: 8 + 1 = 9 अवस्थाएँ (dead state गिनी नहीं जाती)।
Q13Bihar STET 2025 Paper II Computer Science, 3 Nov 2025, Shift 2 (2:00 PM)
Which of the following statement is false?निम्नलिखित में से कौन सा कथन गलत है?
AA recursive language is also a regular languageएक पुनरावर्ती भाषा भी एक नियमित भाषा है
BA context free language is also a regular languageएक संदर्भ मुक्त भाषा भी एक नियमित भाषा है
CA context free language is also recursive enumerable languageएक संदर्भ मुक्त भाषा भी पुनरावर्ती गणनीय भाषा है
DBoth (a) and (b)(a) और (b) दोनों
Show answerHide answer
Correct answer: (B)A context free language is also a regular languageएक संदर्भ मुक्त भाषा भी एक नियमित भाषा है
Explanation
Every regular language is context-free, but not every context-free language is regular (e.g. a^n b^n), so statement (b) is false. Note that (a) is also false, since recursive languages need not be regular.हर regular भाषा context-free होती है, पर हर context-free भाषा regular नहीं होती (जैसे a^n b^n), इसलिए कथन (b) असत्य है। ध्यान दें कि (a) भी असत्य है, क्योंकि recursive भाषाएँ regular होना ज़रूरी नहीं।
Q14Bihar STET 2025 Paper II Computer Science, 3 Nov 2025, Shift 2 (2:00 PM)
Regular expression for all strings starts with b and ends with bba is.सभी स्ट्रिंग्स के लिए नियमित अभिव्यक्ति बी के साथ शुरू होती है और बीबीए के साथ समाप्त होती है।
Aaba*b*bbaaba*b*bba
Bab(ab)*bbaab(ab)*bba
Cb(a+b)*bbab(a+b)*bba
DAll of the mentionedAll of the mentioned
Show answerHide answer
Correct answer: (C)b(a+b)*bbab(a+b)*bba
Explanation
b(a+b)*bba starts with b, allows any string of a and b in the middle, and ends with bba. The other expressions start with a, so they are wrong.b(a+b)*bba b से शुरू होता है, बीच में a और b की कोई भी स्ट्रिंग आने देता है और bba पर समाप्त होता है। बाकी व्यंजक a से शुरू होते हैं, इसलिए गलत हैं।
Q15Bihar STET 2025 Paper II Computer Science, 3 Nov 2025, Shift 2 (2:00 PM)
Can a DFA recognize a palindrome number?क्या एक DFA एक पैलिंड्रोम नंबर को पहचान सकता है?
AYesहाँ
BNoनहीं
CYes, with input alphabet as ∑*हाँ, इनपुट अक्षर ∑* के साथ
DCan’t be determinedनिर्धारित नहीं किया जा सकता
Show answerHide answer
Correct answer: (B)Noनहीं
Explanation
Recognising palindromes requires remembering an unbounded first half to compare with the second half. A DFA has finite memory, so palindromes are not regular; a PDA is needed.Palindrome पहचानने के लिए पहली अनबाउंडेड आधी स्ट्रिंग याद रखनी पड़ती है ताकि दूसरी आधी से तुलना हो। DFA की मेमोरी सीमित है, इसलिए palindrome regular नहीं हैं; PDA चाहिए।
Q16Bihar STET 2025 Paper II Computer Science, 3 Nov 2025, Shift 1 (9:00 AM)
Halting state of Turing machine are:ट्यूरिंग मशीन की रुकने की स्थिति ------------- है
AStart and stopशुरू करें और रोकें
BAccept and rejectस्वीकार और अस्वीकार
CStart and rejectप्रारंभ करें और अस्वीकार करें
DReject and allowअस्वीकार करें और अनुमति दें
Show answerHide answer
Correct answer: (B)Accept and rejectस्वीकार और अस्वीकार
Explanation
A Turing machine halts only on entering an accept state or a reject state. On some inputs it may also loop forever.Turing मशीन केवल accept अवस्था या reject अवस्था में पहुँचने पर रुकती है। कुछ इनपुट पर वह हमेशा के लिए लूप में भी जा सकती है।
Q17Bihar STET 2025 Paper II Computer Science, 3 Nov 2025, Shift 1 (9:00 AM)
If NFA of 5 states excluding the initial state is converted into DFA, maximum possible
number of states for the DFA is?यदि प्रारंभिक अवस्था को छोड़कर 5 अवस्थाओं के NFA को DFA में परिवर्तित किया जाता है, तो DFA के
लिए अधिकतम संभव अवस्थाओं की संख्या क्या है?
A6464
B3232
C128128
D187187
Show answerHide answer
Correct answer: (A)6464
Explanation
An NFA with 5 states plus the initial state has 6 states. The subset construction can produce up to 2⁶ = 64 DFA states.5 अवस्थाओं के साथ प्रारंभिक अवस्था जोड़ने पर NFA में 6 अवस्थाएँ हैं। Subset construction से अधिकतम 2⁶ = 64 DFA अवस्थाएँ बन सकती हैं।
Q18Bihar STET 2025 Paper II Computer Science, 3 Nov 2025, Shift 1 (9:00 AM)
The complement of a language will only be defined when and only when the __________
over the language is defined.किसी भाषा के पूरक को केवल तभी परिभाषित किया जाएगा जब और केवल तभी जब भाषा पर
__________ को परिभाषित किया जाता है।
AAlphabetवर्णमाला
BWordशब्द
CStringस्ट्रिंग्स
DGrammarव्याकरण
Show answerHide answer
Correct answer: (A)Alphabetवर्णमाला
Explanation
The complement of L is Σ* - L, so it can be defined only once the alphabet Σ is fixed.L का पूरक Σ* - L है, इसलिए इसे तभी परिभाषित किया जा सकता है जब वर्णमाला Σ तय हो।
A Language for which DFA exist is a________एक भाषा, जिसके लिए DFA मौजूद होता है, वह ________ होती है।
ARegular Languageनियमित भाषा
BNon-Regular Languageअनियमित भाषा
CAny languageकोई भी भाषा
DCannot be saidकहा नहीं जा सकता है।
Show answerHide answer
Correct answer: (A)Regular Languageनियमित भाषा
Explanation
A language is regular exactly when some DFA (equivalently an NFA or regular expression) accepts it.कोई भाषा तभी regular होती है जब कोई DFA (या इसके समतुल्य NFA अथवा regular expression) उसे स्वीकार करे।
If NFA of 5 states excluding the initial state is converted into DFA, maximum possible number of states for the DFA is?यदि प्रारंभिक अवस्था को छोड़कर 5 अवस्थाओं के NFA को DFA में परिवर्तित किया जाता है, तो DFA के लिए अवस्थाओं की अधिकतम संभावित संख्या क्या है?
A6464
B3232
C128128
D187187
Show answerHide answer
Correct answer: (A)6464
Explanation
5 states plus the initial state is 6 NFA states. Subset construction can give at most 2^6 = 64 DFA states.5 अवस्थाएँ और प्रारंभिक अवस्था मिलाकर 6 NFA अवस्थाएँ हुईं। Subset construction से अधिकतम 2^6 = 64 DFA अवस्थाएँ बन सकती हैं।
How to use these Bihar STET Computer Science questions
Every question here was asked in a real Bihar STET paper; the paper and shift are shown on the card, and the number opens the question on its own page. Try each one before tapping Show answer, then attempt the full Bihar STET papers as timed tests to check your speed under exam conditions.