CS402 – Theory of Automata: Midterm Important Subjective (63 Solved Q&As)

Computer Science • Read every solved subjective question with its model answer directly on this page. Free, no login required.

All 664 Midterm Packs · CS402 Course Page · CS402 MCQ Pack (246 MCQs)

  1. What is the difference between the strings and the words of a language?
    Topic: Alphabets, Strings & Languages

    A string is formed by the concatenation of a finite number of letters from the alphabet. Words are the strings that belong to some language. So every word is a string, but a string is called a word (of a language) only when it belongs to that language.

  2. Is there any difference between Kleene's star and Kleene's closure?
    Topic: Alphabets, Strings & Languages

    There is no difference between the two; both names are used for the same operation (the set of all strings, including the null string Λ, formed by concatenating letters of the alphabet any number of times).

  3. Is there any difference between a PALINDROME and the reverse of a palindrome? Explain.
    Topic: Alphabets, Strings & Languages

    A palindrome is a string that reads the same when written forward or backward, e.g. abba and 1221 are palindromes. The reverse of a palindrome is the palindrome itself: reversing a palindrome gives back exactly the same string. Hence there is no difference — every palindrome is its own reverse, and the language PALINDROME remains unchanged when all its words are reversed.

  4. Check whether the following statements are correct or not; if a statement is not correct, correct it. 1. A string in a regular language cannot be infinite. 2. Concatenation of finite letters from an alphabet is called sigma. 3. There cannot be more than one FA for the same language.
    Topic: Alphabets, Strings & Languages

    1. True — every string is a finite concatenation of letters (it is a language, not a string, that may be infinite). 2. False — the concatenation of a finite number of letters from an alphabet is called a string; sigma (Σ) is the alphabet itself. 3. False — many different FAs can be built for one and the same language.

  5. What are the points (parts) of Kleene's theorem?
    Topic: Kleene's Theorem, TG & GTG Conversions

    Kleene's theorem consists of the following three parts: 1. If a language can be accepted by an FA, then it can be accepted by a TG as well. 2. If a language can be accepted by a TG, then it can be expressed by an RE as well. 3. If a language can be expressed by an RE, then it can be accepted by an FA as well. Together these parts show that FA, TG and RE all define exactly the same class of languages (the regular languages).

  6. Write the first step to convert a GTG to an FA (first step of the conversion process in Kleene's theorem).
    Topic: Kleene's Theorem, TG & GTG Conversions

    Step 1: If a TG has more than one start state, introduce a new start state, connect the new state to the old start states by transitions labeled Λ, and make the old start states non-start states.

  7. Explain with an example how, in GTGs, we directly join the initial state with the final state.
    Topic: Kleene's Theorem, TG & GTG Conversions

    Eliminate the middle state and connect the first state with the last one by a single transition labeled by the RE which is the concatenation of the corresponding two REs in the existing sequence, also including the possibility of a circuit (loop) at the middle state. Example: if x —a→ y, y has a loop labeled c, and y —b→ z, then after eliminating y there is a single transition x —ac*b→ z.

  8. What is the difference, and what is common, between an NFA and an FA (DFA)?
    Topic: NFA & Finite Automata

    Differences: 1. Both have a finite number of states, with one initial state and some (maybe none) final states; the real difference lies in the transitions. 2. In an FA, for each state and for each input letter there is exactly one transition showing how to move from one state to another, while in an NFA there may be more than one transition for certain letters, and there may not be any transition for certain letters. 3. An FA is deterministic — the next state is always uniquely determined — while an NFA is non-deterministic, so a string is accepted if any one of its possible paths ends in a final state. Common features: both have a finite set of input letters (the alphabet), a finite set of states with one start state, and both accept exactly the regular languages — every NFA has an equivalent FA.

  9. How can we build the transition table of the FA corresponding to a given NFA?
    Topic: NFA & Finite Automata

    In an NFA there may be more than one transition for a certain letter, and there may not be any transition for a certain letter. So, starting from the initial state — corresponding to the initial state of the given NFA — the transition table of the corresponding FA, along with the new labels of states, can be built by introducing an empty state for a letter having no transition at a certain state, and a state corresponding to the combination of states for a letter having more than one transition.

  10. Explain the Moore machine.
    Topic: Moore & Mealy Machines

    A Moore machine consists of the following: • A finite set of states q0, q1, q2, … where q0 is the initial state. • An alphabet Σ of input letters. • An alphabet {x, y, z, …} of output characters from which output strings are generated. • A transition table that shows, for each state and each input letter, what state is entered next. • An output table that shows what character is printed by each state as it is entered. A Moore machine has no final states; it is a finite automaton with output, where the output depends only on the state entered.

  11. What is the function of a Mealy machine?
    Topic: Moore & Mealy Machines

    The 1's complementing machine and the incrementing machine, which are basically Mealy machines, are very helpful in computing. The incrementing machine helps in building a machine that can perform the addition of binary numbers.

  12. Define alphabet, string and language, giving an example of each.
    Topic: Alphabets, Strings & Languages • 3 marks marks

    An alphabet Σ is a finite, non-empty set of symbols (letters), e.g. Σ = {a, b} or Σ = {0, 1}. A string is a finite concatenation of letters from Σ, e.g. abba is a string over {a, b}; the string with no letters is the null string Λ, whose length is 0. A language is a set of strings chosen from Σ*, e.g. the language of all strings over {a, b} that start with a. The strings belonging to a language are called its words.

  13. What is the null string Λ? If Σ = {a, b}, write all the strings of Σ* having length at most 2, and state how many strings of length m exist over an alphabet of n letters.
    Topic: Alphabets, Strings & Languages • 3 marks marks

    Λ is the string containing no letter; its length is 0, and joining Λ with any string leaves that string unchanged. Σ* (Kleene star closure of Σ) is the set of all strings over Σ, including Λ. The strings of length at most 2 are: Λ, a, b, aa, ab, ba, bb — 7 strings in total. In general, over an alphabet of n letters, the number of strings of length m is n^m.

  14. Define the reverse of a string, a palindrome, and the reverse of a language, with examples.
    Topic: Alphabets, Strings & Languages • 2 marks marks

    The reverse of a string is obtained by writing its letters in reverse order, e.g. reverse(aab) = baa. A palindrome is a string that is the same as its own reverse, e.g. abba and 1221. The reverse of a language L is the set of the reverses of all its words: L^R = { reverse(w) : w ∈ L }.

  15. Define a regular expression (RE) recursively over an alphabet Σ.
    Topic: Regular Expressions • 3 marks marks

    Regular expressions over Σ are defined as follows: (1) Λ is an RE, denoting the language {Λ}; (2) every letter a of Σ is an RE, denoting {a}; (3) if r and s are REs denoting languages L1 and L2, then r + s is an RE denoting L1 ∪ L2, rs is an RE denoting the concatenation L1L2, and r* is an RE denoting the closure L1* (r+ denotes one or more repetitions); (4) nothing else is an RE.

  16. Write regular expressions for the following languages over Σ = {a, b}: (a) all strings that start with a and end with b; (b) all strings that begin and end with the same letter.
    Topic: Regular Expressions • 5 marks marks

    (a) a(a + b)*b — the string must start with a, end with b, and anything (or nothing) may come in between. (b) a(a + b)*a + b(a + b)*b + a + b — the first two parts cover strings of length at least 2 beginning and ending with a, or beginning and ending with b; the parts a and b cover the single-letter strings, which trivially begin and end with the same letter.

  17. Show, with the help of a counterexample string, that (a + b)* and a* + b* do not denote the same language.
    Topic: Regular Expressions • 2 marks marks

    (a + b)* denotes the set of ALL strings over {a, b}, because a and b may be mixed in any order, e.g. it contains the string ab. But a* + b* denotes only those strings that consist entirely of a's or entirely of b's, so ab is not in the language denoted by a* + b*. Since ab belongs to one language and not the other, the two REs are not equivalent.

  18. Define a finite automaton (FA) formally, and explain how an FA decides whether a string is accepted or rejected.
    Topic: Finite Automata • 5 marks marks

    An FA is a collection of: a finite set of states; an input alphabet Σ; a start (initial) state; a set of final (accepting) states, which may be empty; and a transition table (or diagram) that gives, for every state and every letter of Σ, exactly one next state — an FA is therefore deterministic. To decide a string, start in the start state and follow the transitions, consuming one letter at a time. If, after the whole string has been consumed, the machine is in a final state, the string is accepted; otherwise it is rejected. The set of all strings accepted by an FA is called the language accepted by it.

  19. Build an FA that accepts exactly those strings over Σ = {a, b} which start with a. Describe the states and transitions of your diagram in words.
    Topic: Finite Automata • 5 marks marks

    Use three states: q0 (start, non-final), q1 (final), and q2 (a dead state, non-final). Transitions: q0 —a→ q1 and q0 —b→ q2; from q1, both a and b loop back to q1; from q2, both a and b loop back to q2. A string starting with a moves to q1 and remains there whatever follows, so it is accepted; a string starting with b falls into the dead state q2, and the empty string Λ stays in q0, so both are rejected.

  20. Build an FA for the EVEN-EVEN language — the set of strings over Σ = {a, b} having an even number of a's and an even number of b's. Describe the states and transitions in words.
    Topic: Finite Automata • 5 marks marks

    Four states keep track of the parity (even/odd) of the a's and b's read so far: q0 = (even a, even b) — the start state and the only final state; q1 = (odd a, even b); q2 = (even a, odd b); q3 = (odd a, odd b). Reading an a flips the a-parity and reading a b flips the b-parity: q0 —a→ q1, q0 —b→ q2; q1 —a→ q0, q1 —b→ q3; q2 —a→ q3, q2 —b→ q0; q3 —a→ q2, q3 —b→ q1. A string is accepted exactly when it ends in q0, i.e. when both counts are even (the empty string Λ is also accepted).

  21. Build an FA accepting all strings over Σ = {a, b} that contain the substring aba. Describe the states and transitions in words.
    Topic: Finite Automata • 5 marks marks

    Use four states q0, q1, q2, q3, where qi records that the longest suffix of the input read so far which is also a prefix of 'aba' has length i. q0 is the start state and q3 is the only final state. Transitions: q0 —a→ q1, q0 —b→ q0; q1 —a→ q1, q1 —b→ q2; q2 —a→ q3, q2 —b→ q0; q3 —a→ q3, q3 —b→ q3. As soon as the substring aba has occurred, the machine reaches q3 and stays there, so every string containing aba is accepted, and no other string is.

  22. Define a transition graph (TG) and state how a TG differs from an FA.
    Topic: Transition Graphs & Generalized TG • 3 marks marks

    A TG is a collection of states connected by transitions labeled with strings (possibly Λ) over the alphabet; it may have more than one start state, and some states are final. A string is accepted if there is at least one path from a start state to a final state whose labels concatenate to that string. Differences from an FA: in a TG the transition labels are strings, not single letters; there may be several start states; for a given state and letter there may be several paths or no path at all, whereas an FA has exactly one transition for every state–letter pair. Every FA is a TG, but every TG is not an FA.

  23. What is a generalized transition graph (GTG)? How does it differ from a TG, and what is it used for?
    Topic: Transition Graphs & Generalized TG • 3 marks marks

    A GTG is a transition graph in which the transitions are labeled with regular expressions instead of letters or strings. It differs from a TG only in its labels: a single GTG transition labeled r stands for all the strings denoted by the RE r. GTGs are used in the proof of Kleene's theorem (Part II): a TG is first converted into a GTG, and then states are eliminated one by one, combining RE labels, until a single transition remains whose label is the RE for the whole language.

  24. Describe the method of building a regular expression for the language accepted by a TG (Kleene's theorem, Part II): state the steps used to reduce a TG to a single RE.
    Topic: Kleene's Theorem & Conversions • 5 marks marks

    Step 1: If the TG has more than one start state, introduce a new start state joined to the old start states by Λ-transitions, and make the old start states non-start; similarly, if needed, introduce a new single final state joined from the old final states by Λ-transitions. Step 2: Combine parallel transitions between the same pair of states into one transition labeled with the sum (+) of their labels — the TG has now become a GTG. Step 3: Eliminate the intermediate states one by one: whenever a state z is removed, for every pair of states x, y joined through z by x —r1→ z —r2→ y with a loop r3 at z, add (or merge by +) the transition x —r1(r3)*r2→ y. Step 4: When only the start and the final state remain, the label of the single transition between them is the required RE (with Λ added if the empty string is accepted).

  25. In proving Kleene's theorem, Part III, describe how an FA is built for r = r1 + r2, for r = r1r2, and for r = r*, when FAs for r1 and r2 are already known.
    Topic: Kleene's Theorem & Conversions • 5 marks marks

    Union (r1 + r2): introduce a new start state and connect it to the states that were originally connected to the old start states, using the same transitions as the old start states; the final states of both given FAs remain final. Concatenation (r1r2): begin with the FA for r1; from each of its final states, add the transitions that leave the start state of the FA for r2, so that after completing an r1-word the machine continues like the second FA; the final states are those of the second FA (the final states of the first FA also stay final if Λ belongs to L(r2)). Closure (r*): introduce a new start state which is also final (so that Λ is accepted) and give it the same outgoing transitions as the old start state; also, from every old final state, add the outgoing transitions of the old start state, so that after finishing one repetition the machine can start the next one.

  26. Define an NFA and an NFA-Λ, and explain how an NFA-Λ is converted into an equivalent NFA having no Λ-transitions.
    Topic: NFA & NFA-Λ • 5 marks marks

    An NFA is like a TG whose transitions are labeled with single letters: it has one start state, and for a given state and letter there may be more than one transition or no transition at all; a string is accepted if some path for it ends in a final state. An NFA-Λ is an NFA that also allows transitions labeled Λ, which can be followed without consuming any letter. Conversion: for each state and each letter, collect every state that can be reached by first following any Λ-transitions, then the transition for that letter, and then any Λ-transitions again (the Λ-closures before and after the letter); make exactly these the transitions of the new NFA, and declare a state final if its Λ-closure contains a final state of the NFA-Λ. Removing all Λ-transitions in this way gives an NFA that accepts the same language.

  27. Give an example, described in words, of an NFA that accepts the language of strings over Σ = {a, b} ending in ab, and explain why the machine is non-deterministic.
    Topic: NFA & NFA-Λ • 3 marks marks

    Take states q0 (start), q1, and q2 (final). Transitions: from q0, reading a leads to q0 as well as to q1; from q0, reading b leads to q0; from q1, reading b leads to q2. The machine keeps looping in q0 and, at some point, guesses that the final 'ab' has begun by moving to q1 and then q2. It is non-deterministic because from q0 the letter a has two possible transitions (to q0 and to q1); the string is accepted if at least one of the possible paths ends in the final state q2.

  28. Differentiate between a Moore machine and a Mealy machine.
    Topic: Moore & Mealy Machines • 3 marks marks

    In a Moore machine the output depends only on the state that is entered, so the output is attached to the states (shown in an output table), and the output string is one symbol longer than the input string because the start state also prints a symbol. In a Mealy machine the output depends on the current state together with the input letter, so the output is attached to the transitions, and the output string has the same length as the input string. Neither machine has final states, so neither accepts or rejects strings — both are finite automata with output.

  29. Construct a Mealy machine that outputs the 1's complement of a binary input string. Describe its states, transitions and outputs in words.
    Topic: Moore & Mealy Machines • 5 marks marks

    A single state q0 is enough (it is the start state; a Mealy machine has no final states). Transitions: in q0, on input 0 the machine stays in q0 and outputs 1; on input 1 it stays in q0 and outputs 0. Thus every input bit is flipped as it is read: for example, the input 1010 produces the output 0101, which is the 1's complement of the input.

  30. Construct a Moore machine over Σ = {a, b} which prints 1 whenever the portion of the input read so far ends with ab, and prints 0 otherwise. Describe the states, transitions and outputs in words.
    Topic: Moore & Mealy Machines • 5 marks marks

    Use three states: q0 — the input so far does not end with a (output 0); q1 — the input so far ends with a (output 0); q2 — the input so far ends with ab (output 1). q0 is the start state. Transitions: q0 —a→ q1, q0 —b→ q0; q1 —a→ q1, q1 —b→ q2; q2 —a→ q1, q2 —b→ q0. Because a Moore machine prints the output of each state as it is entered (starting with q0), the output symbol is 1 exactly at those positions where the input read so far ends in ab.

  31. Why is there 'no question of accepting a language' in Moore and Mealy machines?
    Topic: Moore & Mealy Machines • 2 marks marks

    Moore and Mealy machines have no final (accepting) states: every input string simply produces an output string, and no string is accepted or rejected. They are finite automata with output — computing (transducing) machines — not language-accepting machines like an FA.

  32. Define a regular language, and state the closure properties of the class of regular languages.
    Topic: Regular Languages & Closure Properties • 5 marks marks

    A language is called regular if it can be expressed by a regular expression — equivalently (by Kleene's theorem), if it can be accepted by an FA or by a TG. The regular languages are closed under the following operations, i.e. applying any of them to regular languages always gives a regular language: union, concatenation, Kleene closure (star), complement, and intersection.

  33. If L1 and L2 are regular languages, show that L1 ∩ L2 is also a regular language.
    Topic: Regular Languages & Closure Properties • 3 marks marks

    By De Morgan's law for sets, L1 ∩ L2 = (L1' ∪ L2')', where L' denotes the complement of L. Since L1 and L2 are regular, their complements L1' and L2' are regular (closure under complement); the union L1' ∪ L2' is regular (closure under union); and the complement of that union is again regular (closure under complement). Hence L1 ∩ L2 is regular, which shows closure under intersection.

  34. Why can the language PALINDROME over Σ = {a, b} not be accepted by any FA, i.e. why is PALINDROME not a regular language?
    Topic: Regular Languages & Closure Properties • 3 marks marks

    An FA has only a finite number of states, so while reading a string it can remember only a limited, fixed amount of information about the part already read. To test whether an arbitrarily long string is a palindrome, the machine would have to remember the entire first half of the string in order to compare it, letter by letter, with the reversed second half — and the first half can be arbitrarily long, requiring infinitely many different states. Therefore no FA (and hence no TG or RE) can accept PALINDROME; it is a non-regular language.

  35. What does an automaton mean?
    Topic: Alphabets, Strings & Languages

    An automaton means "something that works automatically".

  36. What is the difference between an alphabet and an element of a set?
    Topic: Alphabets, Strings & Languages

    An alphabet is itself a set; the elements of an alphabet are called letters. For example, the binary alphabet Σ = {0, 1} is a set, and 0 and 1 are its letters.

  37. What is meant by a valid and an invalid alphabet?
    Topic: Alphabets, Strings & Languages

    While defining an alphabet whose letters may consist of more than one symbol, no letter should start with another letter of the same alphabet, i.e. one letter must not be a prefix of another letter (a letter may, however, be a suffix of another). For example, Σ = {a, b} and Σ = {a, b, cd} are valid alphabets, while Σ = {a, b, ac} is invalid, because the letter 'a' is a prefix of the letter 'ac'.

  38. What is meant by the Kleene star closure of a language?
    Topic: Alphabets, Strings & Languages

    Given Σ, the Kleene star closure of the alphabet Σ, denoted by Σ*, is the collection of all strings defined over Σ, including Λ. It is to be noted that Kleene star closure can be defined over any set of strings.

  39. Differentiate between the Kleene star closure (S*) and the PLUS operation (S+).
    Topic: Alphabets, Strings & Languages

    Both operations collect the strings formed by concatenating the elements of the set any number of times. The only difference is that S* also includes the null string Λ (zero repetitions), while S+ does not generate Λ automatically — it contains strings formed by one or more repetitions.

  40. What is meant by a "language" in automata theory?
    Topic: Alphabets, Strings & Languages

    The set of all the words accepted by an automaton is called the language recognized (accepted) by that automaton.

  41. What is meant by tokenizing a string?
    Topic: Alphabets, Strings & Languages

    Tokenization (tokenizing) is the process of breaking a string into the letters belonging to Σ — decomposing the string into its valid units, called tokens.

  42. Consider S*, where S = {ab, ba}. Can any word in this language contain the substrings 'aaa' or 'bbb'? Why or why not?
    Topic: Alphabets, Strings & Languages

    No. Every word of S* is a concatenation of the blocks 'ab' and 'ba', so every 'a' is preceded and followed by a 'b', and every 'b' is preceded and followed by an 'a'. One letter can therefore never be surrounded on both sides by the same letter, so the substrings 'aaa' and 'bbb' can never occur in any word of S*.

  43. Give an example of a set S such that S* contains all possible strings of a's and b's whose length is divisible by 3.
    Topic: Alphabets, Strings & Languages

    Let S contain all possible strings of a's and b's of length 3. By the product rule there are 2 × 2 × 2 = 8 such strings: S = {aaa, aab, aba, baa, abb, bba, bab, bbb}. Every word of S* is a concatenation of length-3 blocks, so its length is divisible by 3, and every string of a's and b's whose length is divisible by 3 can be formed in this way.

  44. A student was asked to give a recursive definition of the language PALINDROME over Σ = {a, b} and wrote: Rule 1: a and b are in PALINDROME. Rule 2: If x is in PALINDROME, then so are axa and bxb. All the words of the language defined above have odd length, so it is not all of PALINDROME. Fix this problem. Also give a recursive definition of EVENPALINDROM, the language of all palindromes of even length.
    Topic: Alphabets, Strings & Languages

    The problem is that the base words a and b have odd length, and Rule 2 adds two letters at a time, so only odd-length palindromes are generated. The fix is to include the null string in the base: Rule 1: Λ, a and b are in PALINDROME. Rule 2: If x is in PALINDROME, then so are axa and bxb. Rule 3: Nothing else is in PALINDROME. Now Λ (length 0) generates all even-length palindromes and a, b generate all odd-length ones. For EVENPALINDROM: Rule 1: Λ is in EVENPALINDROM. Rule 2: If x is in EVENPALINDROM, then so are axa and bxb. Rule 3: Nothing else is in EVENPALINDROM.

  45. What is meant by equivalent regular expressions? Give an example. When are two FAs said to be equivalent?
    Topic: Regular Expressions

    Two regular expressions are said to be equivalent if they generate the same language. For example, r1 = (a + b)*(aa + bb) and r2 = (a + b)*aa + (a + b)*bb are equivalent, because both generate the strings over {a, b} that end in 'aa' or 'bb'. Similarly, two FAs are said to be equivalent if they accept the same language.

  46. How can we know what language a certain regular expression represents?
    Topic: Regular Expressions

    The language of a regular expression is determined by the three ways in which it is built up: r1 + r2 represents the union of the languages of r1 and r2 (a string from either one), r1r2 represents their concatenation (a string of the first followed by a string of the second), and r* represents the closure (any number of repetitions of strings of r, including zero, i.e. Λ as well). Reading the expression part by part in this way shows exactly which strings it generates; for example, (a + b)*ab represents all strings over {a, b} that end in 'ab'.

  47. Give the regular expression for the EVEN-EVEN language.
    Topic: Regular Expressions

    (aa + bb + (ab + ba)(aa + bb)*(ab + ba))*

  48. Write the regular expression for the language of strings, defined over Σ = {a, b}, containing the substring 'aa'.
    Topic: Regular Expressions

    (a + b)*aa(a + b)* — any string (possibly Λ) may come before and after an occurrence of 'aa'.

  49. Write a regular expression for the language, over Σ = {a, b}, that does not have 'bbb' at any place.
    Topic: Regular Expressions

    (a + ba + bba)*(Λ + b + bb). Scanning a string from left to right, between any two a's there can be at most two b's, and the string may also end with zero, one or two b's; this expression generates exactly the strings in which 'bbb' never occurs.

  50. An FA does not accept any string in three conditions. Write all of them.
    Topic: Finite Automata

    1. If there is no path starting from the initial state and ending in a final state. 2. If there is no final state. 3. If it is disconnected with the final state (the final state cannot be reached from the initial state).

  51. By looking at a transition diagram, how can we identify whether it is an FA or a TG?
    Topic: Finite Automata

    We can identify it by checking the transitions. If there is a transition for every letter at every state, then it is an FA; otherwise we will consider it a TG.

  52. In a transition diagram, how can the initial and final states be represented?
    Topic: Finite Automata

    The initial state is represented by a minus sign (−) placed before that state, and the final state by a plus sign (+). Alternatively, an arrow head can also be placed before the initial state, and the final state can be shown with a double circle.

  53. What is a transition?
    Topic: Finite Automata

    For each state and for each input letter, a transition shows how to move from one state to another.

  54. Name the four types of automata.
    Topic: Finite Automata

    1. Finite state machine (deterministic / nondeterministic FSM) 2. Deterministic pushdown automaton (DPDA) 3. Pushdown automaton (PDA) 4. Linear bounded automaton (LBA)

  55. If a language can be expressed by an FA, then why do we need an NFA? Justify your answer.
    Topic: NFA & NFA-Λ

    NFAs are interesting because we can express languages more easily with them than with FAs. An FA (DFA) can be understood as one machine, while an NFA can be understood as multiple little machines computing at the same time. Moreover, it is often easier to build an NFA for a given language and then convert it into an FA than to build the FA directly.

  56. Describe the method of building an NFA corresponding to the concatenation of two FAs.
    Topic: NFA & NFA-Λ

    Introduce additional transitions, for each letter, connecting each final state of the first FA with the states of the second FA that are connected with the initial state of the second FA, corresponding to each letter of the alphabet. Remove the + sign of each of the final states of the first FA and the − sign of the initial state of the second FA. This creates nondeterminism at the final states of the first FA, and the NFA obtained in this way is the required NFA.

  57. Differentiate between FA, TG and GTG.
    Topic: Transition Graphs & Generalized TG

    In an FA, the transitions are marked with single letters of the alphabet, and every state must show a transition for every letter, so an FA is deterministic (an FA is also called a DFA). TGs and GTGs provide certain relaxations: there may exist more than one path for a certain string, or there may not be any path for a certain string — this property creates nondeterminism. In a TG, the edges are labeled with strings (possibly Λ) and there may be more than one start state; in a GTG, the directed edges connecting some pair of states are labeled with regular expressions. Every FA is a TG, but not every TG is an FA.

  58. What is meant by nondeterminism?
    Topic: Transition Graphs & Generalized TG

    A machine is nondeterministic when its current state and current input do not uniquely determine the next state — for a certain state and letter there may be more than one possible transition, or no transition at all. TGs and GTGs provide this relaxation: there may exist more than one path for a certain string, or there may not be any path for a certain string. A deterministic machine, in contrast, knows exactly what to do for every possible input.

  59. Define a Mealy machine.
    Topic: Moore & Mealy Machines

    A Mealy machine is a finite automaton with output. It consists of a finite set of states, with one initial state; an input alphabet Σ; an output alphabet; and a transition table that shows, for each state and each input letter, the next state together with the output character printed on that transition. The output therefore depends on the present state and the present input letter, and the length of the output string is the same as the length of the input string. A Mealy machine has no final states.

  60. What are finite automata with output?
    Topic: Moore & Mealy Machines

    An FA which generates an output string corresponding to each input string is called a machine with output (a finite automaton with output). There are two types of machines with output: the Moore machine and the Mealy machine.

  61. What is the difference between regular languages and non-regular languages?
    Topic: Regular Languages & Closure Properties

    The language generated by any regular expression is called a regular language, while the language that cannot be expressed by any regular expression is called a non-regular language.

  62. What does it mean that a language is closed under an operation?
    Topic: Regular Languages & Closure Properties

    A language is closed under an operation if applying that operation to the words of the language always results in a word of the same language. For example, the set of integers is closed under addition, because the sum of any two integers is again an integer.

  63. What is the concept of the union of two FAs?
    Topic: Regular Languages & Closure Properties

    When we take the union of two FAs, the resultant FA must accept all the words that were accepted by the two FAs individually — just as the union of two sets contains the members of both sets.

MIHORA VU – Virtual University Assignment Solutions 2026, Solved Past Papers & All 455+ Courses

Official MIHORA TECH academic repository offering 28,328+ verified study documents for all 455+ Virtual University of Pakistan courses. Access VU Assignment Solution 2026 (Latest Session), Moaaz & Waqar Siddhu solved midterm & final papers, lecture handouts, and quizzes with 100% direct high-speed links.

SPRING 2026 / FALL 2026 ACTIVE SESSION

VU Assignment Solution 2026 (Latest Solved Assignments, GDBs & Quizzes)

Get high-scoring solutions for Assignment 1, Assignment 2, and Graded Discussion Boards across Computer Science, Mathematics, Management, English, and Economics. Compliant with Turnitin similarity limits (< 19%) and official 24-hour grace periods.

Open VU Assignment Solution 2026 Hub →

Popular Virtual University Courses (2026 Solved Papers & Solutions):

CS101 – Introduction to Computing CS201 – Introduction to Programming CS301 – Data Structures CS302 – Digital Logic Design CS401 – Computer Architecture & Assembly Language CS402 – Theory of Automata CS403 – Database Management Systems CS501 – Advance Computer Architecture CS502 – Fundamentals of Algorithms CS504 – Software Engineering - I CS506 – Enterprise Application Development CS601 – Data Communication CS602 – Computer Graphics CS604 – Operating Systems CS605 – Software Engineering - II CS607 – Artificial Intelligence CS610 – Computer Networks CS619 – Final Year Project MTH101 – Calculus & Analytical Geometry MTH202 – Discrete Mathematics MTH301 – Calculus II (Multivariable Calculus) MTH302 – Business Mathematics & Statistics MTH501 – Linear Algebra ENG101 – English Comprehension ENG201 – Business and Technical English Writing MGT101 – Financial Accounting MGT211 – Introduction to Business MGT301 – Principles of Marketing MGT501 – Human Resource Management ACC311 – Fundamentals of Auditing ACC501 – Business Finance STA301 – Statistics and Probability ECO401 – Economics (Micro & Macro) ISL202 – Islamic Studies / Ethics PAK301 – Pakistan Studies PHY101 – Physics - Mechanics & Waves

Complete Directory of All 455 Virtual University Courses & Codes

Browse the complete curriculum of all 455 accredited courses across 27 faculties of Virtual University of Pakistan. Every course includes verified lecture handouts, Moaaz & Waqar Siddhu solved papers, and 2026 assignment solution templates.

Accounting & Finance (16 Courses)

ACC301 – Financial Accounting ACC311 – Fundamentals of Auditing ACC501 – Business Finance BNK601 – Banking Laws & Practices BNK603 – Consumer Banking BNK604 – Commercial Banking BNK610 – Credit & Risk Management in Banking EFIN623 – Economics of Financial Markets FIN611 – Advanced Financial Accounting FIN621 – Financial Statement Analysis FIN622 – Corporate Finance FIN623 – Taxation Management FIN624 – Islamic Banking & Finance FIN625 – Credit & Risk Management FIN630 – Investment Analysis & Portfolio Management FIN722 – Advanced Corporate Finance

Bioinformatics (7 Courses)

BIF101 – Basic Bioinformatics BIF401 – Introduction to Bioinformatics BIF402 – Computational Biology Methods BIF501 – Genomics & Proteomics BIF601 – Bioinformatics Algorithms BIF602 – Structural Bioinformatics BIF604 – Systems Biology

Biological Sciences (16 Courses)

BIO101 – Basic Biology BIO102 – Introductory Biology & Diversity BIO201 – Cell Biology BIO202 – Biochemistry BIO203 – General Genetics BIO204 – Biochemical Techniques BIO301 – Molecular Biology BIO302 – Animal Physiology BIO303 – Developmental Biology BIO401 – Ecology & Evolutionary Biology BIO502 – Immunology & Pathology BIO503 – Pharmacology & Toxicology BIO504 – Applied Microbiology BIO505 – Environmental Biotechnology BIO506 – Forensic Biology BIO731 – Advanced Molecular Genetics

Virtual University of Pakistan (43 Courses)

BNK611 – Economic Ideology in Islam BT613T – Agricultural Biotechnology CS306 – Introduction to Python CS441 – Big Data Concepts CS442 – Introduction to Data Science CS620 – Modeling & Simulation CS701 – Theory of Computation CS703 – Operating Systems CS704 – Advanced Computer Architecture ECO302 – Microeconomics EDU407 – EDU407 ENG401 – Introduction to Literature: Short Story and Poetry GSC201 – Teaching of General Science MCM516 – TV News Reporting and Production MGMT611 – Human Relations MGMT629 – Crisis Management MGT201 – Financial Management MGT401 – Financial Accounting II MGT404 – MGT404 MGT504 – Organization Theory & Design MGT520 – International Business MGT522 – MGT522 MGT601 – SME Management MGT603 – Strategic Management MGT613 – Production and Operations Management MGT703 – Strategic Management MGT705 – Advanced Cost and Management Accounting MGT713 – Production / Operations Management MTH102 – Basic Algebra and Trigonometry MTH201 – Multivariable Calculus MTH304 – Mechanics MTH403 – MTH403 MTH404 – MTH404 MTH405 – MTH405 MTH621 – Real Analysis I MTH633 – Group Theory MTH642 – Fluid Mechanics MTH643 – MTH643 PAK303 – PAK303 PSC401 – Public International Law PSY409 – Positive Psychology SE601 – Software Construction & Development SE602 – Software Re—engineering

Bio-Technology (34 Courses)

BT101 – Ecology, Biodiversity & Evolution BT102 – Microbiology BT201 – Biotechnology Fundamentals BT301 – Recombinant DNA Technology BT302 – Cell and Tissue Culture BT401 – Genetic Engineering BT402 – Fermentation Technology BT403 – Agricultural Biotechnology BT404 – Medical Biotechnology BT405 – Industrial Biotechnology BT406 – Nanobiotechnology BT501 – Biochemical Engineering BT502 – Biosafety & Bioethics BT503 – Molecular Diagnostics BT504 – Stem Cell Technology BT505 – Food Biotechnology BT511 – Vaccine Technology BT512 – Drug Design & Development BT513 – Genomics & Functional Proteomics BT514 – Enzyme Technology BT601 – Advanced Genetic Engineering BT602 – Bioinformatics in Biotechnology BT603 – Bioprocess Engineering BT604 – Aquatic Biotechnology BT605 – Environmental Bioremediation BT611 – Synthetic Biology BT612 – Metabolic Engineering BT613 – Biofuels and Bioenergy BT614 – Clinical Research in Biotechnology BT693 – Research Project in Biotechnology BT732 – Advanced Molecular Biology Seminar BT734 – Advanced Cellular Biotechnology BT735 – Current Topics in Biotechnology NTBT301 – Nanotechnology in Biotechnology

Chemistry (2 Courses)

CHE201 – General Chemistry CHE301 – Organic Chemistry

Computer Science (55 Courses)

CS000 – Introduction to Computer Fundamentals CS001 – Computer Proficiency License CS101 – Introduction to Computing CS201 – Introduction to Programming CS202 – Web Design & Development CS204 – Cyber Law & Intellectual Property CS205 – Information Security Management CS206 – Ethical Hacking & Defense CS301 – Data Structures CS302 – Digital Logic Design CS304 – Object Oriented Programming CS310 – Introduction to Programming (Python) CS311 – Introduction to Web Services Development CS312 – Mobile Application Development CS314 – Embedded Systems & IoT CS315 – Web Engineering CS401 – Computer Architecture & Assembly Language CS402 – Theory of Automata CS403 – Database Management Systems CS405 – Mobile Computing CS407 – Cloud Computing Fundamentals CS408 – Human Computer Interaction CS409 – Ethical & Legal Issues in Computing CS410 – Design & Analysis of Algorithms CS411 – Visual Programming CS420 – Game Design and Development CS432 – Network Security CS435 – Cloud Computing Infrastructure CS501 – Advance Computer Architecture CS502 – Fundamentals of Algorithms CS505 – Agile Software Development CS506 – Enterprise Application Development CS507 – Information Systems CS508 – Modern Programming Languages CS510 – Compiler Construction CS511 – Distributed Systems CS521 – Data Science Principles CS601 – Data Communication CS602 – Computer Graphics CS603 – Software Architecture CS604 – Operating Systems CS606 – Compiler Design & Construction CS607 – Artificial Intelligence CS608 – Digital Signal Processing CS609 – System Programming CS610 – Computer Networks CS614 – Data Warehousing CS619 – Final Year Project CS621 – Information Retrieval Techniques CS625 – Formal Methods in Software Engineering CS627 – Computer Vision & Pattern Recognition CS636 – Big Data Analytics CS708 – Advanced Computer Graphics CS713 – Advanced Software Architecture CS718 – Advanced Artificial Intelligence

Software Engineering (4 Courses)

CS504 – Software Engineering - I CS605 – Software Engineering - II CS611 – Software Quality Assurance CS615 – Software Project Management

Statistics (18 Courses)

DSTA630 – Data Science Research Methods STA000 – Basic Statistics Fundamentals STA100 – Foundations of Statistics STA301 – Statistics and Probability STA304 – Statistical Inference STA404 – Experimental Design STA406 – Sampling Techniques STA408 – Biostatistics and Epidemiology STA630 – Research Methods in Social Sciences STA631 – Advanced Statistical Methods STA632 – Multivariate Analysis STA641 – Non-Parametric Methods STA642 – Econometric Models STA730 – Advanced Research Methodology in Statistics STAT100 – Statistics Fundamentals STAT404 – Applied Statistical Modeling STAT408 – Statistical Computing STAT730 – Advanced Biostatistics

Education (44 Courses)

ECE101 – Introduction to Early Childhood Care & Education EDU101 – Foundations of Education EDU201 – Learning Theories & Applications EDU205 – Classroom Management EDU301 – General Methods of Teaching EDU302 – Human Development & Learning EDU303 – School, Community and Teacher EDU304 – Educational Assessment & Evaluation EDU305 – Curriculum Development & Instruction EDU306 – Contemporary Trends in Education EDU401 – Critical Thinking and Reflective Practices EDU402 – Educational Leadership & Management EDU403 – Art, Craft & Calligraphy in Education EDU404 – Teaching of English EDU405 – Teaching of Mathematics EDU406 – Teaching of General Science EDU410 – ICT in Education EDU411 – Teaching of Social Studies EDU430 – Information & Communication Technology in Teaching EDU431 – Test Development & Measurement EDU433 – Educational Statistics EDU501 – Educational Psychology EDU505 – Guidance and Counseling in Schools EDU510 – Qualitative Research in Education EDU512 – Comparative Education EDU514 – Special Education Principles EDU515 – Early Childhood Education Curriculum EDU516 – Educational Technology & Media EDU601 – Philosophy of Education EDU602 – Educational Planning and Policy EDU604 – Educational Administration & Supervision EDU630 – Research Methods in Education EDU654 – Teacher Education in Pakistan EDU702 – Advanced Seminar in Educational Leadership EDU705 – Advanced Educational Policy Analysis EDUA305 – Applied Curriculum Development EDUA403 – Elementary Arts Education EDUA405 – Pedagogy of Mathematics EDUA516 – Educational Media Design EDUA630 – Action Research in Educational Settings MEDU402 – Master Level Educational Leadership MEDU406 – Science Teaching Pedagogies MEDU430 – Advanced ICT in Education MEDU601 – Advanced Philosophy of Education

Economics (11 Courses)

ECO401 – Economics (Micro & Macro) ECO402 – Microeconomics Analysis ECO403 – Macroeconomics Analysis ECO404 – Managerial Economics ECO406 – Development Economics ECO501 – Monetary Economics ECO601 – International Economics ECO603 – Public Sector Economics ECO606 – Agricultural Economics ECO607 – Environmental & Resource Economics ECO610 – Econometrics Principles

Management Sciences (26 Courses)

EMG525 – Engineering Project Management MGMT614 – Leadership & Team Building MGMT615 – Project Management Practices MGMT617 – Project Management Methodologies MGMT622 – Operations Management MGMT623 – Supply Chain Management MGMT625 – Knowledge Management Systems MGMT627 – Global Business Strategy MGMT628 – Strategic Management MGMT630 – Business Strategy & Policy MGMT631 – Innovation Management MGT101 – Financial Accounting MGT111 – Introduction to Public Administration MGT211 – Introduction to Business MGT301 – Principles of Marketing MGT402 – Cost & Management Accounting MGT411 – Money & Banking MGT501 – Human Resource Management MGT502 – Organizational Behaviour MGT503 – Principles of Management MGT510 – Total Quality Management MGT602 – Entrepreneurship MGT604 – Management of Financial Institutions MGT610 – Business Ethics & Corporate Governance MGT611 – Business & Labor Law MGTE630 – Business Management Strategy

English (34 Courses)

ENG001 – Basic English Grammar & Composition ENG101 – English Comprehension ENG201 – Business and Technical English Writing ENG301 – Business Communication ENG501 – History of English Language ENG502 – Introduction to Linguistics ENG503 – English Morphology and Syntax ENG504 – Sociolinguistics ENG505 – Phonetics & Phonology ENG506 – World Englishes ENG507 – Psycholinguistics ENG508 – Semantics & Pragmatics ENG509 – English for Specific Purposes (ESP) ENG510 – Language Testing & Evaluation ENG511 – Syllabus Design & Materials Development ENG512 – Stylistics & Literary Analysis ENG513 – Second Language Acquisition (SLA) ENG514 – Classical Poetry ENG515 – Classical Drama ENG516 – Research Methodology in Linguistics ENG517 – Modern Poetry ENG518 – Modern Drama ENG519 – Classical Novel ENG520 – Modern Novel ENG521 – American Literature ENG522 – Postcolonial Literature ENG523 – Continental Literature & Criticism ENG524 – Literary Criticism & Theory ENG525 – Discourse Analysis ENG526 – Applied Linguistics in Education ENG527 – Creative Writing & Composition ENG528 – Corpus Linguistics ENG529 – Translation Studies & Theory FENG301 – Functional English for Professionals

Islamic Studies (4 Courses)

ETH100 – Ethics (For Non-Muslim Students) ETH201 – Ethics & Moral Philosophy (For Non-Muslims) ISL201 – Islamic Studies ISL202 – Islamic Studies / Ethics

General Guides (1 Courses)

GENERAL – General University Resources, Guides & Handbooks

General Sciences (1 Courses)

GSC101 – General Science

Human Resources (4 Courses)

HRM613 – Human Resource Development HRM617 – Compensation & Benefits Management HRM624 – Conflict & Negotiation Management HRM627 – Strategic Human Resource Management

Information Technology (4 Courses)

IT430 – E-Commerce & Digital Business IT601 – Network Administration IT602 – Database Administration ITU430 – E-Commerce Systems

Microbiology (4 Courses)

MB501 – General Microbiology & Microbial Diversity MB502 – Microbial Physiology & Metabolism MB504 – Medical Microbiology MIC501 – Applied Microbiology

Mass Communication (22 Courses)

MCD401 – Media Content Development MCD403 – Media Ethics & Professional Standards MCM000 – Introduction to Communication Fundamentals MCM101 – Introduction to Mass Communication MCM301 – Communication Skills MCM304 – Mass Media in Pakistan MCM310 – Radio Broadcasting & Audio Media MCM311 – Radio & Television Production MCM401 – Fundamentals of Public Relations MCM404 – Electronic Media Content Creation MCM411 – News Writing and Reporting MCM431 – Digital Media & Online Journalism MCM501 – Development Support Communication MCM511 – Media Ethics, Cyber Laws & Regulation MCM514 – Feature, Column & Editorial Writing MCM517 – Advertising Strategy & Campaigns MCM520 – Print Media Design & Layout MCM531 – International & Cross-Cultural Communication MCM601 – Theories of Mass Communication MCM604 – Communication Research Methodology MCM610 – Cyber Journalism & Web Publishing MCMP310 – Radio & Audio Production Practical

Marketing (5 Courses)

MKT501 – Marketing Management MKT530 – Consumer Behaviour MKT610 – Customer Relationship Management (CRM) MKT621 – Advertising & Brand Management MKT630 – International Marketing Strategy

Mathematics (20 Courses)

MTH001 – Elementary Mathematics MTH100 – General Mathematics MTH101 – Calculus & Analytical Geometry MTH104 – Sets & Logic MTH202 – Discrete Mathematics MTH301 – Calculus II (Multivariable Calculus) MTH302 – Business Mathematics & Statistics MTH401 – Differential Equations MTH501 – Linear Algebra MTH601 – Operations Research MTH603 – Numerical Analysis MTH622 – Vector & Tensor Analysis MTH631 – Real Analysis MTH632 – Complex Analysis MTH634 – Topology MTH641 – Functional Analysis MTH644 – Mathematical Methods MTH645 – Mechanics MTH646 – Differential Geometry MTH647 – Fluid Mechanics

Social Studies (3 Courses)

PAK301 – Pakistan Studies PAK302 – History of Pakistan PAK522 – Ideology & Constitution of Pakistan

Physics (3 Courses)

PHY000 – Foundational Physics PHY101 – Physics - Mechanics & Waves PHY301 – Circuit Theory

Psychology (23 Courses)

PSY101 – General Psychology PSY401 – Clinical Psychology Fundamentals PSY402 – Social Psychology PSY403 – Developmental Psychology PSY404 – Abnormal Psychology PSY405 – Personality Theories & Assessment PSY406 – Educational Psychology Applications PSY407 – Experimental Psychology & Lab Methods PSY408 – Health Psychology PSY502 – History and Systems of Psychology PSY504 – Cognitive Psychology PSY505 – Psychological Testing & Measurement PSY510 – Positive Psychology & Well-being PSY511 – Counseling Psychology Principles PSY512 – Organizational & Industrial Psychology PSY513 – Neuropsychology Fundamentals PSY515 – Forensic & Criminal Psychology PSY516 – Cross-Cultural Psychology PSY610 – Neurological Basis of Behavior PSY611 – Psychopathology & Diagnostics PSY631 – Psychological Assessment Practicum PSY632 – Research Methods in Psychology PSYP631 – Psychological Assessment Lab Practical

Sociology (14 Courses)

SOC101 – Introduction to Sociology SOC201 – Pakistani Society and Culture SOC301 – Social Psychology & Society SOC302 – Cultural Anthropology SOC401 – Social Research Methods SOC402 – Classical Sociological Theories SOC403 – Social Change & Modernization SOC404 – Urban Sociology SOC601 – Rural Sociology & Community Development SOC602 – Gender Studies & Society SOC605 – Criminology & Juvenile Delinquency SOC608 – Sociology of Development SOC609 – Sociology of Health & Medicine SOC610 – Demography & Population Dynamics

Urdu Literature (2 Courses)

URD101 – Functional Urdu (Urdu Zaban-o-Adab) URDU101 – Urdu Language & Literature

Zoology (35 Courses)

ZOO101 – Principles of Animal Life I ZOO102 – Principles of Animal Life II ZOO103 – Animal Diversity: Invertebrates ZOO111 – Fundamentals of Zoology ZOO201 – Animal Diversity: Chordates ZOO202 – Animal Form & Function I ZOO203 – Animal Form & Function II ZOO301 – Animal Physiology ZOO302 – Cell & Molecular Biology in Zoology ZOO307 – Principles of Ecology ZOO401 – Evolution & Principles of Systematics ZOO403 – Animal Behavior & Sociobiology ZOO404 – Biostatistics for Zoologists ZOO405 – General Developmental Biology ZOO501 – Developmental Biology ZOO502 – Environmental Biology ZOO503 – Biostatistics in Zoological Research ZOO504 – Zoogeography & Paleontology ZOO505 – Wildlife of Pakistan & Conservation ZOO506 – Endocrinology ZOO507 – Animal Diversity & Behavior ZOO509 – Fish Biology & Fisheries Science ZOO510 – General Microbiology & Immunology ZOO511 – Immunology & Serology ZOO512 – Parasitology & Vectors ZOO513 – Applied Entomology ZOO514 – Biochemistry of Animals ZOO515 – Genetics & Population Biology ZOO516 – Aquaculture & Fisheries Management ZOO517 – Toxicology & Environmental Health ZOO518 – Comparative Vertebrate Anatomy ZOO519 – Mammalogy ZOO520 – Ornithology (Bird Biology) ZOO603 – Applied Parasitology & Vector Biology ZOO630 – Research Methodology in Zoology

Core Student Calculators & Rules Handbooks

Frequently Asked Questions – MIHORA VU Study Library

Where can I download VU Assignment Solution 2026 for CS101, CS201, MTH101, and all subjects?

MIHORA VU (https://study.mihora.tech/vu-assignment-solution-2026) offers verified 2026 assignment solutions, GDB answers, quiz files, and Dev-C++ code templates for all 455 Virtual University courses with 100% free direct downloads.

What is the 24-hour assignment grace period in Virtual University?

Virtual University gives students an automatic 24-hour grace period after the official assignment deadline. Submissions during this grace window are awarded full credit with 0 marks deduction.

How to avoid zero marks in VU assignments due to Turnitin plagiarism?

Never copy-paste solutions directly from YouTube or public groups. Keep Turnitin similarity under 19% by renaming code variables, rearranging logical statements, and writing custom explanations.

Where can I get Moaaz and Waqar Siddhu solved midterm and final past papers?

MIHORA VU hosts over 28,328 verified documents including complete Moaaz and Waqar Siddhu past paper collections for all 455 VU subjects, available via direct download without registration.

What is the 20% Two-Half passing rule in Virtual University?

Students must score at least 20% in the First Half (Quizzes, Assignments, GDBs, and Midterms) AND independently at least 20% in the Final Term exam paper to pass any course.