[Easy] Theoretical Computer Science

Solution :
a) Set of binary numbers that represents odd numbers :
S-> 0S|1S|1
all odd binary numbers ends with 1.
b) Set of binary numbers that represents even numbers : '
S-> 0S|1S|0
All even binary numbers ends with 0.
if you have any doubts then you can ask in comment section if you find the solution helpful then upvote the answer. Thank you.
[Easy] Theoretical Computer Science Find a grammar for the following languages: (a) Set of binary numerals...
[Easy] Theoretical Computer Science
Consider the grammar: Give a derivation for the string "aaaabbbbbb" and describe the language, i.e. general form of the strings generated by the grammar.
Theoretical Foundation of Computer Science. Is this a regular language: a set consisting of strings x such that x is of prime length or x is of odd length. Prove your answer.
1. Write regular expressions to capture the following regular languages: (a) The set of binary strings which have a 1 in every even position. (Note: odd positions may be either 0 or 1.) (b) The set of binary strings that do not contain 011 as a substring. (c) Comments in Pascal. These are delimited by (* and *) or by { and }, and can contain anything in between; they are NOT allowed to nest, however. 2. Write a DFA...
5. (5 points) Give context-free grammar that generate the following languages (1) (w is a binary string, and w starts and ends with the same symbol (2) the empty language (empty set)
Answer these questions
Construct regular expressions for the following languages: i. Even binary numbers without leading zeros ii, L-(a"b"(n + m) is odd) ii L fa"b"l. n 2 3, m is odd) ni m.
Question 2 (10%) Write a grammar for each of the following languages. Note that N represents the set of natural numbers N = { 0 , 1 , 2 , 3 , . . . } . (a) { bb, bbbb, bbbbbb, . . . } = { ( bb ) ^n +1 | n ∈ N } (b) { a, ba, bba, bbba, . . . } = { b ^n a | n ∈ N }
Construct NFAs for the following languages: 1. The set if binary strings such that the number of 0's is a multiple of 3 or the number of 1's is a multiple of 5. 2. The set of all binary strings containing 101 or 100 as substring 3. The set of all strings such that the 12th symbol from the right end is 0
Computer Science: Computer Architecture 3. Do the following problems: Consider a circuit with 4 binary inputs. It counts the number of 1’s on its input and expresses (encodes or represents) the count as binary values on 2 output lines. a. Draw a truth table to represent the functions of the circuit. b. Provide SOP expressions for the output lines. c. Simplify the SOP expressions. d. Implement the circuit using 2-input NAND gates. 4. do the fowolling problems: a. Verify: xyz...
3. For each of the following languages, . State whether the language is finite or infinite. . State whether the language is regular or nonregular. . If you claim the language is regular: give a DFA (graphical representation) that recog- nizes the language. . If you claim that the language is not regular, describe the intuition for why this is so. Consider the following languages (a) [8 marks] The language of 8 bit binary strings that begin and end with...
Give nondeterministic finite automata that accept each of the following languages. Provide both state-transition diagrams and the corresponding quintuple representations The set of odd binary numbers (without leading zeros) such that the length of the bit string is 4i+2, for some i 21. a.