Question

In: Computer Science

What is a Turing Machine? Be able to describe its parts. Given a Turing Machine description,...

  1. What is a Turing Machine? Be able to describe its parts.
  2. Given a Turing Machine description, be able to carry out a computation and show the resultant tape.
  3. What is the halting problem?
  4. Is the halting problem decidable?
  5. What is Hoare Logic?
  6. When proving a program correct, we must look at the initial assertion and final assertion. What are these?
  7. What is a loop invariant?

Solutions

Expert Solution

1.What is a Turing Machine? Be able to describe its parts.

A Turing machine are often thought of as a finite state machine sitting on an infinitely long tape containing symbols from some finite alphabet Σ. Based on the symbol it’s currently reading, and its current state, the Turing machine writes a replacement symbol therein location (possibly an equivalent because the previous one), moves left or right or stays in place, and enters a new state. It may also plan to halt and, optionally, to output “yes” or “no” upon halting.

Parts of Turing machine:

1. A tape, infinite in both direction, divided into equal-sized cells, contains symbols from the alphabet ;

the tape may contain only finitely many characters different from and they should be consecutive;

2. a register, containing values from, which determines the actual behavior of the Turing machine;

3. a read-write head, pointing always to a specific cell, this connects a tape and therefore the register.

{ Note: 2nd Question is going to be a very long answer, solving 2nd one and others is not possible, sorry for inconvenience}

3.What is the halting problem?

Given a program or algorithm will ever halt or not?
It means the program on specific input will accept it and halt or reject it and halt and it'd never enter an infinite loop. Basically halting means terminating. So can we've an algorithm which will tell that the given program will halt or not? In terms of the Turing machine , will it terminate when run on some machine with some particularly given input string?

The answer is "NO" we can't design a generalized algorithm which will appropriately say that given a program will ever halt or not?
The only way is to run the program and check whether it halts or not.
We can refrain the halting problem question in such how also: Given a program written in some programming language will it ever get into an infinite loop(loop never stops) or will it always terminate(halt)?

4.Is the halting problem decidable?

This is an un-decidable problem because we cannot have an algorithm which will tell us whether a given program will halt or not during a generalized way i.e by having a selected program/algorithm. generally , we can’t always know that’s why we can’t have a general algorithm. the simplest possible way is to run the program and see whether it halts or not. during this way, for several programs, we will see that it'll sometimes loop and always halt.

5.What is Hoare Logic?

Hoare logic (also referred to as Floyd–Hoare logic or Hoare rules) is a formalism with a group of logical rules for reasoning rigorously about the correctness of computer programs. it had been proposed in 1969 by British scientist and logician Tony Hoare and subsequently refined by Hoare and other researchers.


Related Solutions

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
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?
What is a finite-state machine ? What is a pushdown automaton ? What is a Turing...
What is a finite-state machine ? What is a pushdown automaton ? What is a Turing machine? What is a Turing complete language? Compare the finite-state machine , pushdown automaton , and Turing machine.?
Turing machine A that does the following: • On its first and second tape, A receives...
Turing machine A that does the following: • On its first and second tape, A receives two strings w and v, w, v ∈ {0, 1}? , representing two integer numbers. When machine A is started, the tape heads are located on the left-most position, on the most significant bits of w and v. • If none of the inputs w and v is the empty word, the Turing machine A writes the binary representation of the sum of the...
Explain how a Turing Machine can simulate an arbitrary DFA. Use a 2-tape Turing Machine. It...
Explain how a Turing Machine can simulate an arbitrary DFA. Use a 2-tape Turing Machine. It can be done with a 1-Tape Turing Machine, but 2-tape will likely make the explanation more intuitive.
prove or disprove A Turing machine with two tapes is no more powerful than a Turing...
prove or disprove A Turing machine with two tapes is no more powerful than a Turing machine with one tape. (That is, both types of machines can compute the same set of functions.) The cardinality of the set of irrational numbers is greater than the cardinality of the set of all rational numbers. The cardinality of the set of all algebraic numbers is exactly the same as the cardinality of all real numbers.
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.
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.
Describe five Gestalt grouping principles. For each, please provide a description with two parts: its name...
Describe five Gestalt grouping principles. For each, please provide a description with two parts: its name and a picture which illustrates the principle.
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?...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT