CP1300 Theory

(Sections 11.*)
Last modified Wednesday, 25-Oct-2000 23:12:47 UTC.

Content




Self assessments


Tutorial Questions


Exam style questions

  1. O(Nm) is called "polynomial complexity". What are the following complexities called?
    • O(1)
    • O(logbN)
    • O(N)
    • O(N*logbN)
    • O(kN)
  2. What is the complexity, in big-O notation, of the following C++ code fragment?
    Index = N;
    Total = 0;
    while (Index > 1) {
        Total += Index;
        Index =/ 2;
        }
    for (Index = N; Index > -N; Index--)
        Total += Index;
    
  3. What is "The Totality Problem" in computing theory? Can you provide an algorithm for solving this problem?
  4. Positive integers can be represented by strings of A's, where the number of A's is the number represented. For example, the string "A" represents the number 1, the string "AA" represents the number 2, and so on. Using this way of representing integers, write a Turing machine state table to add 1 to an integer. Assume that the representation of the integer is on the tape and that the machine starts out in state S with the head looking at the first symbol of the integer. At the end the machine must be in state H and the tape must contain the representation of the result.