Bhanu Priya has Published 1581 Articles

Construct DFA beginning with ‘a’ but does not have substring ‘aab’

Bhanu Priya

Bhanu Priya

Updated on 15-Jun-2021 12:37:02

795 Views

ProblemGiven language to construct the deterministic finite automata (DFA) is, the strings start with ‘a’ but not contain substring ‘aab’ over alphabet ∑={a, b}.SolutionIf the input is: “baabba”The output is: string is not acceptedBecause the string does not start with ‘a’, and generating a substring ‘abb’, DFA transition diagramThe DFA ... Read More

Prove that the polynomial time reduction is from the Clique problem to the Vertex Cover problem

Bhanu Priya

Bhanu Priya

Updated on 15-Jun-2021 12:30:04

2K+ Views

Vertex cover is a subset of vertices that covers all the edges in a graph. It is used to determine whether a given graph has a 3SAT to vertex cover.Clique is called a subset of vertices that are all directly connected. It determines whether a clique of size k exists ... Read More

Construct a DFA recognizing the language {x | the number of 1's is divisible by 2, and 0'sby 3} over an alphabet ∑={0,1}

Bhanu Priya

Bhanu Priya

Updated on 15-Jun-2021 12:20:23

3K+ Views

ProblemThe given language L={ x | the number of 1's is divisible by 2, and 0's by 3} over an alphabet ∑={0, 1}.SolutionThe language is divided into two parts, first we need to find the number of 1’s divisible by 2 and second find out the number of 0’s divisible ... Read More

What is a Queue Automaton?

Bhanu Priya

Bhanu Priya

Updated on 15-Jun-2021 12:17:12

412 Views

A queue automaton is like a push-down automaton (PDA) except that the stack is replaced by a queue.A queue is a tape allowing symbols to be written only on the left-hand end and read only at the right-hand end.Each write operation (we’ll call it a push) adds a symbol to ... Read More

Differentiate between Ambiguous and Unambiguous Grammar

Bhanu Priya

Bhanu Priya

Updated on 15-Jun-2021 12:14:50

6K+ Views

Before understanding the differences between ambiguous grammar and unambiguous grammar, let us learn about these concepts.Ambiguous GrammarA grammar is said to be ambiguous if there exists more than one left most derivation or more than one right most derivation or more than one parse tree for a given input string.If ... Read More

Construct DFA of alternate 0’s and 1’s

Bhanu Priya

Bhanu Priya

Updated on 15-Jun-2021 12:13:10

2K+ Views

ProblemConstruct deterministic Finite automata (DFA) whose language consists of strings with alternate 0’s and 1’s over an alphabet ∑ ={0, 1}.SolutionIf Σ = {0, 1} (ε + 1)(01)* (ε + 0) is the set of strings that alternate 0’s and 1’s Another expression for the same language is (01)*+ 1(01)*+ ... Read More

Construct a TM performing multiplication of two unary numbers

Bhanu Priya

Bhanu Priya

Updated on 15-Jun-2021 12:11:27

6K+ Views

AlgorithmStep 1 - Read the leftmost ‘0’ replace it by ‘x’ and move right to process the immediate symbol after ‘#’.Step 2 - Replace the symbol ‘0’ by x and move right reach the first ‘B’ after ‘#’Step 3 - Replace B by ‘0’ and move left until the nearest ... Read More

Design a TM to compute addition of two unary numbers

Bhanu Priya

Bhanu Priya

Updated on 15-Jun-2021 12:08:55

7K+ Views

The unary input number n is represented with a symbol 0 n – times.Example4 → 00001 → 05 → 00000The separation symbol, „#‟ (any other special character) shall be used to distinguish between two or more inputs.For Example: 5, 2 are the inputs represented by 00000 # 00.AlgorithmStep 1 - ... Read More

Distinguish between Finite Automata and Turing Machine

Bhanu Priya

Bhanu Priya

Updated on 15-Jun-2021 12:06:32

4K+ Views

Before understanding the differences between the finite automata (FA) and the turing machine (TM), let us learn about these concepts.Finite AutomataFinite automata is an abstract computing deviceIt is a mathematical model of a system with discrete inputs, outputs, states and set of transitions from state to state that occurs on ... Read More

C Program to build DFA accepting the languages ending with “01”

Bhanu Priya

Bhanu Priya

Updated on 15-Jun-2021 12:03:41

12K+ Views

ProblemDesign deterministic finite automata (DFA) with ∑ = {0, 1} that accepts the languages ending with “01” over the characters {0, 1}.SolutionThe strings that are generated for a given language are as follows −L={01, 001, 101, 110001, 1001, ……….}The minimum length of the string is 2, the number of states ... Read More

Advertisements