Introduction to Computation Flashcards
What does a computer do?
1) Performs calculations
2) Remembers the results
What makes a computer turing complete?
6 Primitives
Right: Move the Machine’s head to the right of the current square
Left: Move the Machine’s head to the left of the current square
Print: Print a symbol on the current square
Scan: Identify any symbols on the current square
Erase: Erase any symbols presented on the current square
Nothing/halt: Do nothing
What can’t a computer do?
Turing’s halting problem.
Problems that take too long to solve (encryption relies on this).
What is an algorithm vs a program?
An algorithm is a conceptual idea.
A program contains concrete instantiations of algorithms.
What are the types of knowledge?
Declarative knowledge - Statements of fact.
Imperative knowledge - Methods for finding new information (algorithm).
What is a fixed vs stored program computer?
A fixed program computer is designed to perform specific functions.
A stored program computer stores and manipulates sequences of instructions.
What is a programming language?
A programming language provides a set of primitive operations with mechanisms to combine these into more complex but legal expressions.
What is syntax?
Expressions that are valid within a language.
What is static semantics?
Which syntactically valid expressions have a meaning.
What is formal semantics?
What meaning is associated with static sematically valid expressions.
What are errors of syntax, static and formal semantics?
Sytax: Incorrect code
Static semantic: Code does’t make sense (i.e 5/@)
Formal semantic: Crashes
Infinite loop
Produces undesired answer
How do you float an object?
float(
How do you int an object?
int(
How do you get the type of an object?
type(
How do you get the length of an object?
len(