6. Suggest a method for representing rational numbers on a Turing machine, then sketch a method for adding and subtracting such numbers. 6. Suggest a method for representing rational numbers...
Discrete Mathematical Structures
Draw a Turing machine that takes a string representing two unary numbers, x and y, separated by a 0, and determines whether x greaterthanorequalto y. For example, the input for x = 3, y = 4 would be 11101111. Use two halt states: one for yes and one for no. Give the trace of your machine in the previous problem processing the strings 11101111 and 11110111. Draw a TM that computes f(w) = w^R where w elementof...
Design a turing machine that subtracts two binary numbers
When adding and subtracting complex numbers, all numbers must be in O polar fornm O scientific notations rectangular formm O none of the above
Design a visual Turing machine to compute: (1) x+y x and y are natural numbers
Design a visual Turing machine to compute: (1) x+y x and y are natural numbers
construct a turing machine to compute x-y where x and y are natural numbers
5. Design a Turing machine that takes as input two numbers a and b, such that a is not equal to b and determines which number is higher. Give the transition table for the machine. Show by drawing the steps, how the machine works when a-3 and b-2. Can we use a PDA for the same problem? Give reasons for your answer (10+5+5-20).
Question 8. Design a Turing machine that calculates the sum of two unary numbers. (You can assume the input consists of two unary numbers separated by a single blank space.)
5. Consider the following N-N function f: 4n+1 ifn is odd if n is even. Representing numbers in binary: (a) give an implementation level description in English of a Turing machine that computes this f; (b) give the complete transition table of this Turing machine. (4 marks) (6 marks)
(Rational class) Create a class called Rational for performing arithmetic with fractions. Write a program to test your class. Use integers variables to represent the private data of the class- the numerator and the denominator. Provide a constructor that enables an object of this class to be initialized when it is declared. The constructor should contain default values in case are no initializers are provided and should store the fraction in reduced form. For example, the fraction 3/6 would be...
Rational Number *In Java* A rational number is one that can be expressed as the ratio of two integers, i.e., a number that can be expressed using a fraction whose numerator and denominator are integers. Examples of rational numbers are 1/2, 3/4 and 2/1. Rational numbers are thus no more than the fractions you've been familiar with since grade school. Rational numbers can be negated, inverted, added, subtracted, multiplied, and divided in the usual manner: The inverse, or reciprocal of...