
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

1K+ Views
A Turing machine (TM) can be formally described as seven tuples −(Q, X, ∑, δ, q0, B, F)Where, Q is a finite set of states.X is the tape alphabet.∑ is the input alphabet.δ is a transition function: δ:QxX->QxXx{left shift, right shift}.q0 is the initial state.B is the blank symbol.F is the final state.Binary numbers1 = 12 = 103 = 114 = 1005 = 1016 = 110. . .AlgorithmStep 1 − Move to the right end of the string.Step 2 − Repeat:If the current cell contains 1, write 0 and move left until the current cell contains 0 or blank.Step 3 ... Read More

1K+ Views
A Turing machine (TM) can be formally described as seven tuples −(Q, X, ∑, δ, q0, B, F)Where, Q is a finite set of states.X is the tape alphabet.∑ is the input alphabet.δ is a transition function:δ:QxX->QxXx{left shift, right shift}.q0 is the initial state.B is the blank symbol.F is the final state.Input − n a natural numberOutput − n + 2Let’s represent natural numbers in unary form (e.g. 3 = 111, 5 = 11111) and 0 will be represented by the empty symbol.AlgorithmMove the tape head to the left of the first 1 (if it exists).Change that empty cell to ... Read More

8K+ Views
2’s complement of binary numbers can be done by using two approaches.Adding 1’s complement+1Traverse bits from left to right, find the 1st 1 bit then reverse all the bits after the 1 bit.ExampleLet the input be 1110010Thus, after performing 2’s complement, the output will be as follows −Output − 0001110Coming to the Turing machine to find 2’s complement, If input is as follows −B010000100The output is as follows −B101111100ExplanationStep 1 − Here, we need to start from the rightmost ends.Step 2 − We will move the R/W head all the way to the right, skipping all the 0s and 1s.Step ... Read More

5K+ Views
1’s complement means transforming the 0 bit to 1 and the 1 bit to 0.Let the input be −B00101110BThe output is as follows −B11010001BConceptThe concept is explained below −Step 1 − Start scanning the input from left to right.Step 2 − If the R/W is at 1, then make it 0 and move right.Step 3 − If the R/W is at 0, then make it 1 and move right.Step 4 − Repeat the steps given above and we will reach B (blank).Step 5 − Then move the R/W head all the way to the left without changing anything until it ... Read More

2K+ Views
ProblemThe language L = {ww | w ε {0, 1}} having the string of 0’s and 1’s which is followed by itselfL={00, 11, 1100, 0011, …..}SolutionThe logic for solving the problem is as follows −Find the midpoint of the string.Then match the symbols.ExplanationStep 1 − First, we need to find the midpoint of the string.Step 2 − We will make the first 0 to X or 1 to Y and then move R/W head to the right until the last character is found.Step 3 − Then make this 0 to X or 1 to Y.Step 4 − Now, we will ... Read More

2K+ Views
A push down automata (PDA) can be formally described as seven tuples(Q, Σ, S, δ, q0, I, F)Where, Q is finite number of statesΣ is input alphabetS is stack symbolΔ is the transition function: QX(Σ∪{e})XSXQq0 is the initial state (q0 belongs to Q)I is the initial state top symbolF is a set of accepting statesProblemConstruct PDA for L = {anb(2n) | n>=1} ∪ {anbn | n>=1}SolutionLetL = {anb(2n) | n>=1}{anbn | n>=1}Construct PDA for L= L1 U L2So, the strings which are generated by the given language L1 are as follows−L1={abb, aabbbb, aaabbbbbb, ….} andL2= {ab, aabb, aaabbb, ….}L= L1 ... Read More

25K+ Views
A deterministic finite automata (DFA) can remember a finite amount of information but A push down automata (PDA) can remember an infinite amount of information.Basically a PDA is as follows −“Finite state machine+ a stack”PDA has three components, which is as follows −An Input tapeA control unitA Stack with infinite sizeA PDA can be formally described as seven tuples (Q, Σ, S, δ, q0, I, F)Q is finite number of statesΣ is input alphabetS is stack symbolΔ is the transition function: QX(Σ∪{e})XSXQq0 is the initial state (q0 belongs to Q)I is the initial state top symbolF is a set of ... Read More

3K+ Views
A push down automata (PDA) can be formally described as seven tuples(Q, Σ, S, δ, q0, I, F)Where, Q is finite number of statesΣ is input alphabetS is stack symbolΔ is the transition function: QX(Σ∪{e})XSXQq0 is the initial state (q0 belongs to Q)I is the initial state top symbolF is a set of accepting states(F belongs to Q)ProblemConstruct PDA for 0n1m2(n+m) where n, m>=1.SolutionSo, the strings which are generated by the given language are as follows −L={0122, 001222, 000112222, ….}That is to add the number of 0's and 1's, and that will equal the number of 2's.So for every 0's ... Read More

8K+ Views
A push down automata (PDA) can be formally described as seven tuples(Q, Σ, S, δ, q0, I, F)Where, Q is finite number of statesΣ is input alphabetS is stack symbolΔ is the transition function: QX(Σ∪{e})XSXQq0 is the initial state (q0 belongs to Q)I is the initial state top symbolF is a set of accepting states(F belongs to Q)ProblemConstruct PDA for 0n1m2m3n where n, m≥1.SolutionSo, the strings which are generated by the given language are −L={0123, 011223, 001233….}The number of 1’s and 3’s are same and number of 2’s and 1’s are sameConstruction of PDA for given problemThe PDA is as ... Read More

1K+ Views
A push down automata (PDA) can be formally described as seven tuples(Q, Σ, S, δ, q0, I, F)Where, Q is finite number of statesΣ is input alphabetS is stack symbolΔ is the transition function: QX(Σ∪{e})XSXQq0 is the initial state (q0 belongs to Q)I is the initial state top symbolF is a set of accepting statesProblemConstruct PDA for a(n+m)bmcn n, m≥1.SolutionSo, the strings which are generated by the given language are −L={aabc, aaaabccc, aaaaabbccc, ….}That is to add the number of b's and c's, and that will equal the number of a's.For every b's and c's we will pop a's from ... Read More