CS 454, Section 001 Sonoma State University Spring, 2026
 
Theory of Computation
Instructor: Henry M. Walker

Lecturer, Sonoma State University
Professor Emeritus of Computer Science and Mathematics, Grinnell College

Although much of this course has been well developed in recent semesters, some details may be adjusted from semester to semester. For example, the Signature Project for this course has satisfied SSU's Upper Division GE Area B Requirement for CS Majors for several years, and satisfying that requirement again this semester. However, details of this project likely vary from instructor to instructor and from semester to semester. Also,

Assignment on Class NP and NP-Completeness

  1. Definitions: Consider the terms, "Class NP", "verifier for a language", and "NP-complete".
    Give careful definitions of each of these terms.

  2. A Permutation Sort: One approach to sort an array of n elements is to generate all n! permutations of the elements and then examine each to determine which permutation is ordered.

    1. Explain why this algorithm, called a Permutation Sort, has Θ(n * n!).
    2. Since n * n! is not a polynomial, must we conclude that sorting is not in Class P? Explain briefly.
    3. Does this analysis prove that sorting is in Class NP? Explain.
    4. What is wrong with the statements, "A Permutation Sort is not in Class P" and "A Permutation Sort is not in Class NP"?
  3. Binary Search of an Ordered Array: Suppose array a[0..n-1] is an ordered array of n integers. Then a binary search of the array a for an element is known to take no more than 1+log2n steps. Also, mathematically the logarithm function is not a polynomial.

    1. Does this algorithm demonstrate that the problem of searching an ordered array of integers is in Class P? Explain.
    2. Does this algorithm demonstrate that the problem of searching an ordered array of integers is in Class NP? Explain.
  4. Satisfiability and NP-Completeness: Suppose A and B are problems in class NP.

    1. Recall that the Problem 4 of the Assignment on Turing Machines introduced the notion of a proof summary. Write a proof summary that outlines the idea behind the proof that the Satisfiability Problem (SAT) is NP-Complete.
    2. Suppose A ≤M SAT.
      • Does it always follow that A is NP-Complete? Explain.
      • Does your conclusion change if the mapping function is computable in polynomial time? Explain.
    3. Suppose SAT ≤M B.
      • Does it always follow that B is NP-Complete? Explain.
      • Does your conclusion change if the mapping function is computable in polynomial time? Explain.
  5. NP-Complete and NP-Hard: Consider the concepts of a NP-Hard problem and an NP-Complete problem.

    1. Can a problem be NP-Hard without being NP-Complete? Explain.
    2. Can a problem be NP-Complete without being NP-Hard? Explain.
created Fall, 2023
revised Fall, 2023
revised September, 2025
Valid HTML 4.01! Valid CSS!
For more information, please contact Henry M. Walker at walker@cs.grinnell.edu.
ccbyncsa.png

Copyright © 2011-2026 by Henry M. Walker.
Selected materials copyright by Marge Coahran, Samuel A. Rebelsky, John David Stone, and Henry Walker and used by permission.
This page and other materials developed for this course are under development.
This and all laboratory exercises for this course are licensed under a Creative Commons Attribution-NonCommercial-Share Alike 4.0 International License.