Question

In: Computer Science

Given a list of numbers, could you build a Turing machine to sort them into non-decreasing...

Given a list of numbers, could you build a Turing machine to sort them into non-decreasing order? Non-decreasing order is essentially the same thing as increasing order, except that it recognizes that some of the numbers might be repeated. Explain why this is or why this is not possible. Do not try to give an algorithm or even a description of how the machine would work--just an explanation as to why it is or is not possible.

Solutions

Expert Solution

First of thing you should understand if there is any algorithm for a problem to solve then definitely that problem can be solved using turing machine refer CHURCH THESIS.

Please Refer This detail information.

Abstract

For nondeterministic Turing machines with one work-tape and one-way input a lower time bound Ω(m2) on sorting m strings of length each is shown, which matches the upper bound. For the related Element Distinctness Problem with input of the same format we prove the upper bound O(m2) if = O(m/ log m), showing this problem to be easier than sorting. The bound O(m2) also holds for deterministic machines if = c+log m with constant c. For this problem Szepietowski has shown the bound Θ(m2 log m) on deterministic Turing machines without input tape.

1 Introduction

Sorting is among the most widely studied tasks in computer science. Many algorithms have been developed for computational models that treat the keys of items to be sorted as atomic units. There are however interesting solutions like radix-sort that access portions of the keys. The investigation of such algorithms clearly requires a model that processes its input on a bit-level. The traditional model in this field is the Turing machine. As discussed in Section 2, multi-tape Turing machines are quite efficient at solving the sorting problem. In the present work we consider the sorting problem for binary strings or equivalently natural numbers in binary encoding. This is no severe restriction, since pointers to data can be stored in the least significant digits. We denote the problem of sorting m strings of length by SORT(m, ), where we assume that m and are related by some easily computable function. When considering nondeterministic sorting procedures we require that within the given time bound at least one computation writes the sorted input on a work-tape and all other cells contain blanks. No terminating computation produces an incorrect output. A decision problem which is closely connected to sorting is the Element Distinctness Problem (EDP). The EDP asks whether m elements given as strings of bits each are pairwise different. We denote this problem by EDP(m, ). As a language recognition problem EDP can be defined in the following way: EDP(m, ) = {x1#x2# ··· #xm | xi ∈ {0, 1} , xi = xj for i = j}. Since on many computational models EDP can be efficiently reduced to sorting,lower bounds on the decision problem EDP carry over to the sorting problem.

2 Previous Work

It is well-known that deterministic Turing machines with three work-tapes can sort much faster than machines with one such tape. Using merge-sort and radixsort machines of the former type can solve SORT(m, ) in time O(m(log m)) and O(m2) resp. [Rei90, p. 152]. Radix-sort can be implemented on machines with two work-tapes by making two passes over the sequence of strings when sorting according to a bit, but for large (e.g., = m2) the resulting bound O(m2) is worse than sorting by selection. One of the factors in this bound can be replaced by log m with the help of a merge-sort strategy that first determines the final position of each string by counting. If the input-tape of a two-tape Turing machine is restricted to be read-only we obtain the off-line Turing machine investigated in [Wie92] by Wiedermann. He gave a nondeterministic solution running in time O(m3/2). A deterministic algorithm for Turing machines with a separate two-way input-tape having the same complexity was presented in [Pet08]. This bound cannot be improved in general by the lower bound from [DMS91]. The most restricted model we mention here is the single-tape machine that receives its input on the work-tape. For this model Wiedermann could show the bound Θ(m log m+2−1 m ) in [Wie92], which is better than the naive quadratic algorithm for small . The investigation of the EDP on Turing machines with a single work-tape was initiated by L´opez-Ortiz [LO94]. He proved the lower bound Ω(m2 log m) on the time necessary for a nondeterministic Turing machine without separate input-tape to accept the EDP with m elements of = k log m bits each for k ≥ 2. There is a straight-forward deterministic solution in time O(m2 log2 m) and L´opez-Ortiz conjectured that the latter bound was optimal. Szepietowski [Sze96] showed that the lower bound Ω(m2 log m) also holds for elements of size c + log m with constant c. In this case there is a matching upper bound. The nondeterministic version of the conjecture of L´opez-Ortiz was disproved in [Pet02] with a solution of complexity O(m2(log m)3/2(log log m)1/2). An even better algorithm in [BABP03] showed the lower bound to be tight in the case of nondeterministic machines, while the deterministic version of the conjecture turned out to be true. In [Pet08] the EDP was solved by Turing machines with a single work-tape and a separate two-way input-tape. For the EDP with m elements of size = O(m/ log2 m) a nondeterministic solution of time complexity O(m3/21/2) was presented, which is slightly faster than the sorting procedures mentioned above. In the present work we investigate computational models between the machines discussed above, namely Turing machines with one work-tape and a separate one-way input-tape. Probabilistic Turing machines of this kind have been investigated by Kalyanasundaram and Schnitger [KS92], who could show the lower bound Ω(m2/ log m) on EDP with elements of size 2 log m. We prove here that in the case of nondeterministic machines the EDP is easier than sorting by showing an optimal lower bound on sorting and a faster algorithm for EDP.


Related Solutions

python3: Given a list of numbers in order order, return a new list sorted in non-decreasing...
python3: Given a list of numbers in order order, return a new list sorted in non-decreasing order, and leave the original list unchanged. function only def mergeSort(inputArray): #code here a = [3,4,6,1,21,11,9,8] b = mergeSort(a) print('original array is: ', a) print('sorted array is: ', b)
What is a Turing Machine? Be able to describe its parts. Given a Turing Machine description,...
What is a Turing Machine? Be able to describe its parts. Given a Turing Machine description, be able to carry out a computation and show the resultant tape. What is the halting problem? Is the halting problem decidable? What is Hoare Logic? When proving a program correct, we must look at the initial assertion and final assertion. What are these? What is a loop invariant?
Create a 3-tape Turing machine that implements multiplication with binary numbers. The first tape and the...
Create a 3-tape Turing machine that implements multiplication with binary numbers. The first tape and the second tape hold the numbers being multiplied and the third tape holds the product of the first two tapes. The two binary numbers may be different lengths.
JavaScript (HTML) Task: Please read 10 numbers that are list below, sort the numbers and then...
JavaScript (HTML) Task: Please read 10 numbers that are list below, sort the numbers and then print those numbers. 10 numbers = { 9, 3, 2, 1, 10, 30, 4, 6, 7, 8} [Reference JavaScript code] <html> <body>     <H1>prompt()</h1>     <p id="pro"></p>     <script>        // Array creation        var num= new Array();               var ix = 0;        // Read 10 numbers        for (ix = 0; ix < 10; ix++)        {num[ix] = prompt("Enter a number");...
Describe a non-deterministic Turing machine algorithm that takes one integer and checks for primality. What is...
Describe a non-deterministic Turing machine algorithm that takes one integer and checks for primality. What is the complexity of the algorithm?
If you have a Turing machine with a tape that is not just linear at each...
If you have a Turing machine with a tape that is not just linear at each move, instead you have the ability to move up, down, left, or right. There is a single read/write head. The transition function looks like. The tape extends up and right infinitely. That is, you can never go left or down of where you start, but you can go infinitely up and to the right. Is this machine equivalent to the standard Turing machine model?...
Design a Turing machine that, given a positive binary number n greater than or equal to...
Design a Turing machine that, given a positive binary number n greater than or equal to 2, subtracts 2 from this number. Test it, step-by-step, on the example of n = 2.
What is the possible transition diagram of Turing Machine for the given expression? M (x, y)...
What is the possible transition diagram of Turing Machine for the given expression? M (x, y) = x + y where x and y are integers expressed in unary notation to calculate f (2,3), then the input will be 110111
You are given the following questions, but not required to solve them for numbers. Instead, please...
You are given the following questions, but not required to solve them for numbers. Instead, please read them carefully and follow the instructions to complete each requirement. 1) Stoneycreek golf course is planning for the coming season. Investors would like to earn a 12% return on the company's $40 million of assets. The company primarily incurs fixed costs to groom the greens and fairways. Fixed costs are projected to be $20 million for the golfing season. About 500,000 golfers are...
Create a Python program that will take an unsorted list of 1000 integers and sort them...
Create a Python program that will take an unsorted list of 1000 integers and sort them using a bubble sort and an insertion sort. Your output should include displaying both sorted lists (from each algorithm) identifying each sorted list by the algorithm used.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT