Introduction to computational thinking Flashcards
Modern computer / Universal machine
a modern computer can be defined as “a machine that stores and manipulates information under the control of a changeable program”
computer are devices for manipulating information
computers operate under the control of a changeable program
Hardware
the physical part of the machine
CPU: central processing unit, carries out all the basic operations on the data (e.g. “are two numbers equal”
Main memory: volatile memory, meaning it only works as long as the power is on, so as soon as the power is interrupted, the content is lost. Also called RAM memory. Very fast memory.
Secondary memory: permanent storage (also called non-volatile). This can be the harddrive (also called Magnetic), a flash drive (such as a USB memory) or optical memory e.g. on a CD or DVD)
Input devices: are things that pass information to the computer, such as the keyboard, the mouse, the camera or the microphone
Output devices: things that pass information back to the users, such as a monitor, the printer, or a speaker
Software
a computer program
sets of operating instructions that direct and control computer processing –> a detailed step-by-step set of instructions telling.a computer what to do, which get executed by the computer
Program: implementation of an algorithm in a particular programming language in order to run it on a computer
The machine stays the same but the program changes (so what the machine Does changes)
Fetch Execute Cycle
- Load the program into the main memory (RAM)
- Fetch the first / next instruction from memory
- Decode the instruction to see what it represents
- Carry out the instruction to see what it represents
- Repeat from step 2: load the next instruction from memory
Programming languages
The tools used to formulate an algorithm or procedure into a program the computer can solve
Syntax: the precise form. The syntax says if the sentence “makes sense”, like if it is grammatically coherent in the programming sense.
Semantics: the precise meaning, the structure of the language. The meaning of phrases and words. If there are no errors in the syntax and in the static semantics, it will have a meaning i.e. It will have semantics
Syntax
The precise form.
The syntax says if the sentence “makes sense”, like if it is grammatically coherent in the programming sense.
Semantics
The precise meaning, the structure of the language.
The meaning of phrases and words. If there are no errors in the syntax and in the static semantics, it will have a meaning i.e. It will have semantics
High-level programming languages
Designed to be understood and written by humans, such as Python, Java, C#
Must be translated into machine language so the computer can execute it by compilers (faster than interpreters) or interpreters
Low-level programming languages
Represented in binary, 0 and 1s, which is what the computer understands
Also known as machine language
Interpreter
The interpreter makes it possible for the computer to execute any legal set of instruction (instructions written in the correct language), and can thus make it possible to compute anything.
It takes your line of code and goes through it step by step and turn high level language into machine language, ie binary code
Compilers
Converts programs written in high level languages into machine language
Faster than interpreters
Computational thinking
Process solving process, based on a fundamental understanding of computers – basically problem solving when trying to think like a computer
It is used to come up with algorithms which are used in programming
- Decomposition: breaking down the problem into smaller maneable problems, components
- Pattern recognition: Identifying patterns n a set of data
- Abstraction: Identifying rules that or principles that produce a set of patterns
- Algorithmic design: Formulating a step by step guide
Algorithm
Algorithm: a description of the procedure that can be followed to solve a particular problem
can include branching (make a selection, ie if herbs exist, then add to egg before serving, else skip the step) and looping (repeat certain operations or while-looping)
A program is an implementation of an algorithm in a particular programming language in order to run it on a computer
Expressed through psedocode, flowcharts, natural language or particular programming languages
Pseudocode
Use structural components from programming languages, but intended to be human-readable and not machine-readable, so there’s also no syntax
Computational complexity
Classifying computational problems according to their inherent difficulty
Computational complexity is the reason why encryptions work and why analyzing Big Data requires new kinds of approaches to both hardware and software
See picture for Big O Notation