Computational Thinking Flashcards
What differentiates a “computer person” from the others?
A computer person uses computational thinking to solve a problem, via a step-by-step strategy, starting from inputs and producing solutions in form of outputs
Example of unary notation
For instance, if we were to count the number of people in a room, we could use one physical hand and count up to 5 (a number for each finger up)
Example of binary notation
Unlike unary notation, binary notation uses a different notation to count: not just fingers up to represent the numbers, but the order in which the fingers are up or down instead.
Now, having double the values for every finger, i can count up to 2x2x2x2x2 or 2^5 (fingers), and get 32 possible values, having the possibility to count from 0 to 31 with one single hand
What is a transistor?
It’s sort of a computer’s finger, that the device uses and switches on and off, creating a binary notation for computing and counting. When off and on, the transistor can be equal to 0 and 1, just like the finger can be up and down.
How do you represent numbers in the binary system?
We are used to think that 123 corresponds to “one-hundred-twenty-three”. That is because:
1100
210
3*1
The sum of these operations will give us exactly the number 123.
This is the decimal system.
Instead, the binary systems works with the powers of 2, as follows:
n1
n2
n4
n8
…
Where n can be only 1 or 0, producing a sum of numbers equal to the number we want to represent.
PLEASE NOTE: As we go higher with the numbers, we need far more switches, thus more hardware.
How do you represent letters with the binary system?
Using the ASCII, a collective agreement that whenever you’re in the context of a text-based program, binary digits that would normally represent number will instead represent letters.
PLEASE NOTE: This shows that how bits are interpreted is entirely context-dependent
How can ASCII represent all the thousands of foreign languages’ digits if it can only count up to 256?
ASCII was substituted by (and became a subset of) UNICODE, which can represent 4 billions of digits
For instance, emojis are encoded in the UNICODE huge space for digits, and sometimes companies can decide to collectively agree on one code for a same-expression emoji.
What is a byte?
It corresponds to 8 bits
What is RGB?
It’s a system to represent colors, corresponding to RED, GREEN and BLUE, each with 8 bits, for a total of 24 bits.
Those values will determine the quantity of r, g or b in the mix, which eventually will produce a color
Why images and colors are often quantified in kilobytes, megabytes and gigabytes?
Because every single pixel of an image requires 24 bits for the RGB representation of color, that will be part of a bigger image. Thus, to represent a very detailed image, you will need millions o pixels, each with 24 bits.
What are frames?
Frames are images that are put on next of the other, to reproduce in a certain velocity (for instance 24 frames per second) the illusion of movement, or better, a video.
What is an algorithm?
It’s a finite sequence of instructions and operations, given some initial conditions, that will eventually output a determined objective.
For example, going through a phone book page by page to find Mike Smith’s number. It’s correct, even if it’s not efficient. For instance, skipping one page every two pages, will make it more efficient (faster) but potentially incorrect.
The smaller the steps, the more efficient is the algorithm
What do we mean with the term “pseudocode”?
It’s a sequence of english sentences used to describe the steps of an algorithm
What are “functions”?
In a programming language, words that prescribe actions (e.g., “open”, “quit”, “call”)
What are “conditions”?
In a programming language, words that prescribe a “fork in a road” (e.g. “if”, “else”)