C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN: 9781337102087
Author: D. S. Malik
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
AUTOMATA THEORY: Find a Turing machine that computes the remainder of its input when divided by 3 while
each number is represented by 1’s.
If the remainder is zero, output should be one zero on the tape.
If the remainder is greater than zero, output should start with one zero following by the
remainder.
For example, an input tape containing the number 8:
Input: B11111111B (B represents blank)
executing should leave the number 2 on the tape, because 2 is the remainder of 8 when
divided by 3. Output: 011
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- tuing machine , computer sciencearrow_forwardTuring Machine Design a Turing Machine (M1) that takes any string as input (except the empty string), and shifts each character of the string one place into the right. For instance, if the tape initially contains the following [a|b|a|␣|␣], then it should contain the following after M1 halts [#|a|b|a|␣]. You may assume that M1 always halts and accepts except when the tape does not contain anything. Assume the input alphabet Σ is {a, b} and the tape alphabet Γ is Σ ∪ {#, a, b, ␣}. a)(30 points) Draw the state diagram for M1. b)(20 points) Provide the formal definition for M1. C)(25 points) Describe what M1 does in numbered stages (as an algorithm). d) (25 points) Modify M1 to make it shift the tape content by two characters instead of one (e.g., the tape content in the previous example should be [#|#|a|b|a|␣]). Redraw the new version of M1.arrow_forwardSPIM simulator (QtSpim). Simulation: Write a MIPS program that computes the expression; y = A * B + C * D Where A, B, C, and D are integersarrow_forward
- 5. Consider the algorithm that takes an input n and runs the following pseudocode: for i := 1 to 5 for j := 1 to n k := 7.i+1 next j k := k + 3 – 2 - i next iarrow_forwardQ1. Design a Turing machine to count number of l's in the tape and write the output at beginning of the tape. (Consider that tape has binary numbers only). Q2. Consider the TM defined by M = (Q. E,r, 8, q0, B, F) 8 ( qo, a ) = (q1, a , R) 8 ( qo , b ) = ( q1 , b, R) 8( qo, B) = (q1,B , R) 8(q1, a) = ( qo, a, L) 8(q1, b )= ( qo, b , L) 8 ( qı, B ) = ( qo, B, L) What is the state of TM on input 'ab'?arrow_forwardComputer sciencearrow_forward
- Let X. Y and Z be binary strings of same length and X-Xo X1.. X Xa. Y- yo y. y... Ya- and Z- zo Z1... Z..z A bitwise operation on X and Y is defined as f (X. Y)-Z where z- x, & y. The operation is defined as follows. Design a Turing machine T to compute the function f(X. Y). Assume any two characters as separators among the strings X. Y and Z.arrow_forwardComputer Science Please answer the questions. It is either yes or no for the answers.arrow_forwardDesign a Turing machine that computes the function S1 if w is even lo if w is odd Note that you need to use unary representation for w. For example, if w = 3, then representation f(w) = of w is 111.arrow_forward
- Turing Machine theory of computation Design a Turing Machine (M1) that takes any string as input (except the empty string), and shifts each character of the string one place into the right. For instance, if the tape initially contains the following [a|b|a|␣|␣], then it should contain the following after M1 halts [#|a|b|a|␣]. You may assume that M1 always halts and accepts except when the tape does not contain anything. Assume the input alphabet Σ is {a, b} and the tape alphabet Γ is Σ ∪ {#, a, b, ␣}. a)(30 points) Draw the state diagram for M1. b)(20 points) Provide the formal definition for M1. C)(25 points) Describe what M1 does in numbered stages (as an algorithm). d) (25 points) Modify M1 to make it shift the tape content by two characters instead of one (e.g., the tape content in the previous example should be [#|#|a|b|a|␣]). Redraw the new version of M1.arrow_forwardE3arrow_forwardThe unary numeral system is a numeral system to represent natural numbers as sequences of ones, that is, to represent a number ?, a symbol representing “1” is repeated ? times. For example, the number 4 is represented by 1111. The number 0 would be represented by the empty string. Create a Turing machine which adds 3 to a natural number, that is, writes three times a 1 after the given unary number. Afterwards move the head to the left-most position of input.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr