Recall that we write:

  • if there are such that, whenever , we have
  • if
  • if and

Example

Let . Then , and .

Example: Satisfiability

Fix a set of propositional variables
Formulas:
Assignment:
Eval:

SAT is the set of formulas S.T .

Cost of evaluation

  • Each connective takes one time step.
  • evaluating a formula under an assignment hits time . ( is the length of the input data)

Cost of satisfiability:

  • Input: Formula
  • One algorithm to solve: There are assignments to . Just check them all
  • This takes time , as evaluating is and the algorithm takes .

Example: Sorting

  • Input: A string of natural numbers
  • Problem: Determine if the string is already sorted ?
    • Determine is sorted, i.e.,
  • One algorithm: check for each ,
  • Linear time