problemsalgorithmsand programs programmers commonly deal with problemsalgorithmsand computer programs these are three distinct concepts problemsas your intuition would suggesta problem is task to be performed it is best thought of in terms of inputs and matching outputs problem definition should not include any constraints on how the problem is to be solved the solution method should be developed only after the problem is precisely defined and thoroughly understood howevera problem definition should include constraints on the resources that may be consumed by any acceptable solution for any problem to be solved by computerthere are always such constraintswhether stated or implied for exampleany computer program may use only the main memory and disk space availableand it must run in "reasonableamount of time problems can be viewed as functions in the mathematical sense function is matching between inputs (the domainand outputs (the rangean input to function might be single value or collection of information the values making up an input are called the parameters of the function specific selection of values for the parameters is called an instance of the problem for examplethe input parameter to sorting function might be an array of integers particular array of integerswith given size and specific values for each position in the arraywould be an instance of the sorting problem different instances might generate the same output howeverany problem instance must always result in the same output every time the function is computed using that particular input this concept of all problems behaving like mathematical functions might not match your intuition for the behavior of computer programs you might know of programs to which you can give the same input value on two separate occasionsand two different outputs will result for exampleif you type "dateto typical unix command line promptyou will get the current date naturally the date will be different on different dayseven though the same command is given howeverthere is obviously more to the input for the date program than the command that you type to run the program the date program computes function in other wordson any particular day there can only be single answer returned by properly running date program on completely specified input for all computer programsthe output is completely determined by the program' full set of inputs even "random number generatoris completely determined by its inputs (although some random number generating systems appear to get around this by accepting random input from physical process beyond the user' controlthe relationship between programs and functions is explored further in section