- Related Questions & Answers
- Construct a TM for adding 1 to a binary natural number?
- Construct a TM for the language L= {ww : w ∈ {0,1}}
- Find the sum of first and last digit for a number using C language
- Design a TM that increments a binary number by 1
- Construct a Turing machine for adding 2 to the binary natural number?
- 1’s and 2’s complement of a Binary Number?
- Construct a TM performing multiplication of two unary numbers
- Sum of the first and last digit of a number in PL/SQL
- Design a TM for equal number of a’s and b’s
- Construct a TM that accepts even-length palindromes over the alphabet {0,1}?
- Construct Finite State Machine as Processing input
- Replace a letter with its alphabet position JavaScript
- Construct a TM recognizing strings of the form an bn cn| n≥1 over = {a, b, c}
- How to replace some preceding characters with a constant 4 asterisks and display the last 3 as well - JavaScript?
- JavaScript program to take in a binary number as a string and returns its numerical equivalent in base 10

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

Design a TM (Turing Machine) that takes a binary number as an input and replaces the last digit of the string with its Boolean complement.

A 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 reject state, where qreject ≠qaccept.

In this TM,

In state q0, we will read all inputs until a blank symbol is encountered.

If a blank is found, we move one place LEFT.

Now, we have two options: either, the last digit is 0 or 1.

If it is 0, then replace it with 1, or vice versa.

State q4 is the final state.

The Turing Machine will be as follows if the binary number is taken as an input and if the last digit of the string is replaced with its Boolean complement.

Advertisements