Professional Documents
Culture Documents
Algorithmic Thinking
Algorithm: A Familiar Idea
Algorithm: a precise and systematic method for producing a specified result; precise method used in information processing. o Recognition of a button or click o Placeholder technique o Hex to bits To write a precise algorithm, we need to pay attention to three points: o Capability computer knows what and how to do the operations o Language ensure that the description is unambiguous o Context make few assumptions about the input or execution setting 5 Essential Properties of Algorithms o Input specified: the data to be transformed during the computation to produce the output. Must specify the type of data, the amount of data, and the form that the data will take. o Output specified: the data resulting from the computation, the intended result. Often the description is given in the name of the algorithm o Definiteness: specifying the sequence of operations for transforming the input into the output. Ensures that if the algorithm is performed at different times or by different agents using the same data, the output is the same. o Effectiveness: the operations are doable. o Finiteness: algorithm must eventually stop, either with the right output or with a statement that no solution is possible. Language o Natural Language Used when the agent is a person
Ambiguity exists
o Programming Language Agent is the computer Formal Language: programming languages that are designed to express algorithms. Rarely ambiguous
Context: the assumptions of the program are not fulfilled. o can have everything else, but be executed in the wrong context, and it will not work. Program an algorithm that has been customized to solve a specific task under a specific set of circumstances in a specific language.