{
  "translations" :{
    "en": {
    	"sc1": "Imagine drawing a graph to show the cost of finding the maximum value among $n$ values, as $n$ grows. That is, the $x$ axis would be $n$, and the $y$ value would be the cost for a given value of $n$.",
    	"sc2": "Of course, for the maximum-finding algorithm we get a diagonal line going up to the right, as $n$ increases.",
    	"sc3": "Now, imagine the graph showing the cost for each instance of the problem of finding the maximum value among (say) 20 elements in an array. So the $x$ axis has a position for each problem instance (that is, a problem input). We could order them any way that we like, but perhaps we will do it in order of increasing cost.",
    	"sc4": "The first position along the $x$ axis of the graph might correspond to having the maximum element in the first position of the array. Of course, the cost is always 20.",
    	"sc5": "<br> The second position along the $x$ axis of the graph might correspond to having the maximum element in the second position of the array, which also costs 20. And so on.",
    	"sc6": "<br>Therefore, the graph would be a horizontal line with value 20.",
    	"sc7": "Now, let us switch to the problem of doing a sequential search for a given value in an array. Think about the graph showing all the problem instances of size 20.",
    	"sc8": "The first problem instance might be when the value we search for is in the first position of the array.<br>This has cost 1.",
    	"sc9": "The second problem instance might be when the value we search for is in the second position of the array.<br>This has cost 2. And so on.",
    	"sc10": "If we arrange the problem instances of size 20 from least expensive on the left to most expensive on the right, we see that the graph forms a diagonal line from lower left (with value 0) to upper right (with the greatest value being 20)",
    	"sc11": "Finally, let us consider the cost for performing sequential search as the size of the array $n$ gets bigger. What will this graph look like? Think about this for a minute before continuing.",
    	"sc12": "The shape of this graph depends on whether we are considering:",
    	"sc13": "<br> (1) The best case cost (that would be a horizontal line with value 1.)",
    	"sc14": "<br> (2) The worst case cost (that would be a diagonal line with value $i$ at position $i$ along the $x$ axis.)",
    	"sc15": "<br> (3) The average cost (that would be a a diagonal line with value $i/2$ at position $i$ along the $x$ axis).",
    	"sc16": "This is why we must always say that function $f(n)$ is in $O(g(n))$ in the best, average, or worst case. If we leave off which class of inputs we are discussing, we cannot know which cost measure we are referring to for most algorithms.",
        "lab1": "Cost",
        "lab2": "Problem Instance"
    }
  }
}
