{
  "translations": {
    "en": {
      "transform": {
        "type": "multiple",
        "description": "To complete this proof regarding the lower bound for PAIRING, we need to find a way to <b>reduce</b> SORTING to PAIRING. That means to take an input to sorting, convert it to an input to PAIRING, run PAIRING, then take the output from PAIRING and get the (correct) output to SORTING for the original input.<br/><br/>This can be done as follows. Take an instance of SORTING (i.e., an array A of $n$ elements). A second array B is added generated that simply stores $i$ in position $i$ of the array for $0 \\leq i < n$. Pass the two arrays to PAIRING.<br/><br/>Take the resulting set of pairs, and use the value from the B half of the pair to tell which position in the sorted array the A half should take; that is, we can now reorder the records in the A array using the corresponding value in the B array as the sort key. This is a simple $\\Theta(n)$ Binsort.<br/></br>The conversion of SORTING to PAIRING can be done in $O(n)$ time, and likewise the conversion of the output of PAIRING can be converted to the correct output for SORTING in $O(n)$ time. Thus, the cost of this sorting algorithm is dominated by the cost for PAIRING.",
        "question":"The lower bound for SORTING in the worst and average cases is in $\\Omega(n \\log n)$. If we convert SORTING to PAIRING fast enough, is it true that PAIRING also has a lower bound in $\\Omega(n \\log n)$?",
        "answer": "Yes",
        "choices": ["Yes", "No"]
      },
      "template": {
        "type": "select",
        "description":"<b>The Reduction Template</b> <br> <br>Consider any two problems for which a suitable reduction from one to the other can be found. The first problem takes an arbitrary instance of its input, which we will call I, and transforms I to a solution, which we will call SLN. The second problem takes an arbitrary instance of its input, which we will call I', and transforms I' to a solution, which we will call SLN'. We can define reduction more formally as a three-step process:",
        "question":"Which of the follwing is true?",
        "answer":  ["SLN is the solution of I", "SLN must be the correct solution for I for the reduction to be acceptable"],
        "choices": ["the transformation from any instance I of the first problem to an instance I' of the second problem is not necessary", "SLN is the solution of I", "SLN must be the correct solution for I for the reduction to be acceptable", "SLN' is not the solution of I'"]
      },
      "result": {
        "type": "select",
"description": "It is important to note that the reduction process does not give us an algorithm for solving either problem by itself. It merely gives us a method for solving the first problem given that we already have a solution to the second. More importantly for the topics to be discussed in the remainder of this chapter, reduction gives us a way to understand the bounds of one problem in terms of another. Specifically, given efficient transformations, the upper bound of the first problem is at most the upper bound of the second. Conversely, the lower bound of the second problem is at least the lower bound of the first.",
        "question":"Which of the follwing is true?",
        "answer":  ["The upper bound of the first problem is at most the upper bound of the second", "The lower bound of the second problem is at least the lower bound of the first", "Reduction gives us a way to understand the bounds of one problem in terms of another"],
        "choices": ["The upper bound of the first problem is at most the upper bound of the second", "The lower bound of the second problem is at least the lower bound of the first", "Reduction gives us a way to understand the bounds of one problem in terms of another"]
      }

    }
  }
}

