
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 1163 Articles for Computers

654 Views
Push down Automata (PDA) is complement of the PDA that contain Substring bbbStepsMake the PDA for accepting those strings that have conation bbb.Complement it by making non-accepting as accepting and vice versa.Construct PDAYou can construct the PDA as shown below for the (a, b)* languageThe nature of transition format is Input, Top of stack, PUSH/POPExamplea ,a , aa means on i/p a and top of stack is a then push aAt q0 i, e initial if a or b anything came move state to q1Till q1 we get 1 b to make substring b_ _ so now on q1 if ... Read More

2K+ Views
Let us begin by understanding the concept of deterministic finite automata (DFA) in the theory of computation (TOC).Deterministic Finite Automaton (DFA)In DFA, for each info image, one can decide the state to which the machine will move. Henceforth, it is called Deterministic Automaton.Formal Definition − A Deterministic Finite automata is a 5-tuplesM=(Q, ∑, δ, q0, F)Where, Q − Finite set called states.∑ − Finite set called alphabets.δ − Q × ∑ → Q is the transition function.q0 ∈ − Q is the start or initial state.F − final or accept state.Non-deterministic finite automata (NDFA)In NDFA, for a specific info image, ... Read More

11K+ Views
A Turing machine (TM) is a 7-tuple (Q, ∑, Γ, δ, q0, qaccept , qreject).Where, Q is a finite set of states.∑ is the input alphabet that does not contain the blank symbol t.Γ is the tape alphabet, where t ∈ Γ and ∑ ⊆ Γ.δ: (Q × Γ) → (Q × Γ × {L, R}) is the transition function.q0 ∈ Q is the start state.qaccept ∈ Q is the accept state.qreject ∈ Q is the reject state, where qreject ≠ qaccept.For accepting even-length palindrome over the alphabet {0, 1}, follow the steps given below −Match the first and last ... Read More

339 Views
ProblemDesign a TM (Turing Machine) that takes a binary number as an input and replaces the last digit of the string with its Boolean complement.SolutionA Turing machine is a 7-tuple (Q, ∑, Γ, δ, q0, qaccept , qreject)Where, Q is a finite set of states.∑ is the input alphabet that does not contain the blank symbol t.Γ is the tape alphabet, where t ∈ Γ and ∑ ⊆ Γ.δ − (Q × Γ) → (Q × Γ × {L, R}) is the transition function.q0 ∈ Q is the start state.qaccept ∈ Q is the accept state.qreject ∈ Q is the ... Read More

4K+ Views
CFL refers to Context Free Language in the theory of computation (TOC). Let us now understand how CFL is closed under Union.CFL is closed under UNIONIf L1 and L2 are CFL’s then L1 U L2 is also CFL.Let L1 and L2 are generated by the Context Free Grammar (CFG).G1=(V1, T1, P1, S1) and G2=(V2, T2, P2, S2) without loss of generality subscript each non terminal of G1 and a1 and each non terminal of G2 with a2 (so that V1∩V2=φ).Subsequent steps are used production entirely from G1 or from G2.Each word generated thus is either a word in L1 or ... Read More

3K+ Views
A Recursively enumerable language is the language that accepts every string otherwise not. If a language that halt on every string, then we call it as recursive language.ProblemWe need to prove that the set of all languages that are not recursively enumerable on {a} is not countable.First let see what the recursive enumerable language is −Recursive Enumerable LanguageA language L is recursively enumerable if L is the set of strings accepted by some TM.If L is a recursive enumerable language then −if w ∈ L then a TM halts in a final state, if w ∉ L then a TM ... Read More

3K+ Views
ProblemWe have to prove that the cartesian product of a finite number of countable sets is countable.SolutionLet the X1, X2 ,…….. Xn be the countable sets.Yk= X1 * X2 * …….* Xk when k =1……. N). Thus, Yn := X1 * X2 * · · · * XnProofUsing the induction −In case k = 1 then Y1 = X1 is countable.Assuming that Yk (k ∈ n, 1 ≤ k < n) is countable;Then Yk+1 = ( X1 * X2 * …….* Xk) * Xk+1 = Yk * Xk+1 where the Yk and the Xk+1 can be called countable. Hence the ... Read More

20K+ Views
To begin with, let us learn about the P class in the theory of computation (TOC).P-ClassThe class P consists of those problems that are solvable in polynomial time, i.e. these problems can be solved in time O(n k) in the worst-case, where k is constant.These types of problems are called tractable and others are called intractable or super polynomial.Generally, an algorithm is a polynomial time algorithm, if there exists a polynomial p(n) such that the algorithm can solve any instance of size n in a time O(p(n)).Problems requiring Ω(n 50) time to solve are essentially intractable for large n. Most ... Read More

2K+ Views
ProblemExplain the pumping lemma for context free language by showing that the language of strings in the form xnynzn is not a context free language.SolutionPumping lemma (Context free grammar)We can prove that a particular language is not context free grammar using pumping lemma.Let’s take the concept of proof by contradictionHere we assume that language is CFGConditions of pumping lemmaFirst of all consider a string and split into 5 parts those are pqrst it must satisfy the following conditions −|qs|>=1|qrs|=n (“ n” is pumping length)pqirsit € L for different values of iLet the L be the CF language.Now we can take ... Read More

14K+ Views
The problems for which we can’t construct an algorithm that can answer the problem correctly in the infinite time are termed as Undecidable Problems in the theory of computation (TOC).A problem is undecidable if there is no Turing machine that will always halt an infinite amount of time to answer as ‘yes’ or ‘no’.ExamplesThe examples of undecidable problems are explained below. Here, CFG refers to Context Free Grammar.Whether two CFG L and M equal − Since, we cannot determine all the strings of any CFG, we can predict that two CFG are equal or not.Given a context-free language, there is ... Read More