Lesson 1: Introduction to Computation and Programming Flashcards

1
Q

Algorithm

A
  • An algorithm is a sequence of instructions for solving a particular type of problem.

…similar in meaning to: recipe, process, method, technique, procedure, routine.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Computation Problems

A
  • Given a value (or set of values) called inputs

- Produce some value (or set of values) called outputs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Computation

A
  • The transformation of data from inputs to outputs.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Statement of a Computational Problem

A
  • Specifies the inputs and desired outputs (including their types and any restrictions).

Example: Given two coordinates (in lat-lon), compute the great circle distance (in nm) between them.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Instance of a Computational Problem

A
  • Specifies the inputs and consists of all the inputs needed to compute a solution to the problem.

(satisfying whatever constraints might be imposed by the problem statement)

Example: What is the great circle distance (in nm) between (37° 37’ 8” N, 122° 22’ 29” W) and (41° 58’ 46” N, 87° 54’ 16” W)?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Important Properties of Algorithms

A
  • Finiteness: An algorithm must always terminate after a finite number of steps.
  • Definiteness: Each step of the algorithm must be precisely defined so that the actions can be carried out rigorously and unambiguously.
  • Input: An algorithm has zero or more inputs—quantities that must be given before the algorithm begins.
  • Output: An algorithm produces one or more outputs—quantities that have a specified relation to the inputs.
  • Feasibility: All of the operations to be performed in the algorithm must be sufficiently basic that they can, in principle, be done exactly and in a finite length of time by hand (i.e., using pencil and paper).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Programming

A
  • The act of implementing algorithms in a computer language to solve a problem.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

In order to be successful in programming, you need:

A
  • A specification of the computational problem to be solved:
  • – the inputs (their types, meanings, restrictions)
  • – the outputs (their types, meanings, restrictions)
  • An algorithm to solve the problem.
  • – Is it correct?
  • – Is it efficient (how many resources does it require)?
  • A means for storing and manipulating program data:
  • – variables (types)
  • – data structures (complex organizations of variables)
  • A language for specifying the instructions: this controls the flow of program execution.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Computer

A

A machine that executes a set of instructions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Instructions can be implemented in electronic hardware:

A
  • Advantage: fast execution

- Disadvantages: single purpose, can’t be changed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Software

A
  • Flexibility comes from the developement of software (logical instructions) that can be executed on standardized hardware (e.g., computer processing units or CPUs)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Machine Code

A
  • Instructions that can be executed directly by the computing machines.
  • – specific to hardware
  • – expressed in binary
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Computer Programming Language

A
  • A higher level abstraction.
  • – hardware independent
  • – “human readable” instructions that make it more natural to implement an algorithm
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Debugging

A
  • The systematic process of removing bugs from code to obtain the intended program behavior
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Domain Specific Programming Languages

A
  • Languages dedicated to a particular problem domain, a particular problem representation technique, and/or a particular solution technique

Examples: Matlab, R, S-Plus, GAMS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

General Purpose Programming Languages

A
  • Languages intended to be used in any context; do not rely on particular problem domains, represenations, or solution techniques
    Examples: Fortran, Pascal, C, C++, Java, Python, Ruby
17
Q

Program

A
  • The (computer) code that implements that logic.
18
Q

The task of an analyst in using computation to solve problems:

A
  1. Define the problem (statement of computational problem)
  2. Identify (or design) the algorithm.
  3. Implement the algorithm in computer code.
  4. Manage the process (testing, debugging, documenting for yourself and others)