Computational Thinking Flashcards

(58 cards)

1
Q

Computational Thinking Techniques

A

-Pattern matching. -Abstraction. -Decomposition. -Algorithms

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

Pattern Matching

A

identifying when one problem is similar to a different problem and solving this problem using the same method

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

Abstraction

A

removing irrelevant details and reducing a problem down to essential elements

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

Decomposition

A

breaking a complex task down into smaller and simpler tasks

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

Algorithms

A

sequence of steps used to solve a problem

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

Continuous data

A

analog data. Has an infinite number of potential values. E.g. height 1.8 1.82 1.8254

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

Discrete data

A

distinct seperate values for data. E.g. Number of students in a room

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

Bit

A

1 binary digit. 0 or 1

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

Byte

A

8 bits. 0 to 255

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

Kilobyte

A

1024 bytes(because 2 to the power of ten is 1024)

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

Megabyte

A

1024 kilobytes (2 to the power of 20 bytes)

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

Converting binary to decimal

A

write table

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

Benefits of binary numbers in computers

A

-simple and quick to carry out operations for computers.
-binary signals are less affected by noise than others.
-easy to make exact copies of digital info

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

Hexadecimal

A

base 16. So positions are powers of 16

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

How to convert from decimal to hexadecimal

A

divide by 16 and write down number then divide the remainder by 16 and repeat from left to right

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

Why is hexadecimal useful

A

provides a way of representing numbers using fewer digits. Only uses 2 digits can represent numbers up to 255 which would require 8 digits in binary

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

Do computers use hexadecimal

A

not but programmers use them as shorthand for binary as they are easier to understand and remember

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

Character set

A

collection of characters that are used for a purpose. English uses the roman character set.

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

ASCII

A

character set allowed for 128 characters using 7 bit binary

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

Extended ASCII

A

allowed 256 characters using 8 bit binary

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

Limitations of ASCII

A

only set number of characters(128 / 256) that did not include non-roman character sets for languages like Chinese or Russian. Or symbols like emojis

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

Unicode

A

universal standard character set that is being extended regularly. Includes characters for all major languages and symbols like emojis

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

UTF-8

A

Unicode Transformation Format. Uses 8 bit blocks to represent a character. Method for encoding to save space taken up by unicode. Backwards compatible with ASCII

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

How UTF-8 works

A

uses 1 to 4 bytes for each character. Only uses necessary number of bytes for each character saving space

25
Importance of ASCII and Unicode
**provide standard** that is **readable by other computers.** Ensures **outputs between them is consistent** when communicating.
26
NIbble
4 bits
27
kilobit
1024 bits
28
elegance
desirable characteristic indicates solution is as **simple as possible**. Only has necessary features, is clear and works efficiently
29
how to compare algorithms
key factor is efficiency (whichever does less work). This does not use time because that depends on computer executing algorithm
30
What determines amount of work algorithm does
-depends on input size -depends on specific properties of input data( e.g. no 17's or all 17's) -not affected by small constant numbers of operations(e.g. +3)
31
Ignoring constants
done because they have no significant impact because its the variable that actually changes the operation size. In 3n the 3 has little significance compared to n
32
Linear complexity
when the amount of work done is n (or 5n or n +14) the work done is linearly proportional to the input size
33
Big O notation
describes algorithmic time complexity. always features n the input size. Tells us how complexity of an algorithm grows as input grows. Usually describes worst case complexity of a program. Also can describe best and average case. In Big O, The dominant term is the highest order of n (e.g. between n and n^2 it would be n^2) so you'd write O(n^2)
34
What are Equivalence classes And ranked
**groups algorithms** that have an equivalent(more or less the same) complexity, meaning they grow at similarly. From least most complex: O(1/n^2), O(1/n), O(1), O(logn), O(n), O(n logn), O(n^2), O(2^n), O(n!)
35
constant time
when an algorithm always takes the same amount of time to complete. O(1)
36
why equivalence classes are important
-allow us to **see algorithms in the same class** -**quantify the difference in complexity** between algorithms in a different class -**Prevent wasting time looking for better algorithm** because the best equivalence class can often be proven mathematically. (e.g. for linear search of a list there is no better algorithm than O(n)).
37
O(n^2) class
quadratic complexity algorithms. E.g. bubble sort because it features nested loops
38
what is algorithmic time complexity
how long an algorithm would take to complete given an input of n. It is the **Execution Time** of an algorithm which is independent of human measures of time(Seconds). Often expressed using **Big O notation** to provide the best, worst and average time taken to complete an algorithm
39
name the complexity cases and what they represent
1. Best Case: condition that allows algorithm to be completed in the **shortest** amount of time 2. Worst Case: asituation which causes the **longest** possible running time of an algorithm. **This is generally looked at when evaluating time complexity** 3. Average Case: **expected** performance of an algorithm
40
n^2 - n in big O notation
This is approximately the same size as n^2 so we write O(n^2)
41
worst case scenario for quicksort
-1.) keep picking the largest number as the pivot. Each below piv list will have all numbers except the last pivot -2.) Each loop will have to make one less comparison than the last. -3.) This creates a scenario with [ (n-1)+(n-2)+...+2+1 ] comparisons made by the algorithm. -4.group the comparisons into pairs like [ (n-1)+1] they will cancel out to become just n -5.) there will be (n-1)/2 total pairs that create n -6.) therefore ((n-1)/2) X n = (n^2 - n)/2 n^2 is the highest order term therefore quicksort has O(n^2) time complexity
42
intractable problems
no algorithm exists that can solve them in a reasonable amount of time. May be solvable with low number of possibilities but becomes extremely difficult as number of possibilities increases
43
Examples of intractable problems
-traveling salesman -knapsack problem -subset sum
44
traveling salesman
salesman needs to visit n towns. He starts at home and knows the distance between all the towns. He needs to find the shortest route between all the towns and return to home. You have to check all O(n!) possible solutions to know which would be the shortest route.
45
knapsack problem
knapsack can only hold certain weight. You have n items with particular weights and price values. You must make the contents of the knapsack as valuable as possible without exceeding the weight limit. No algorithm to solve it
46
Subset sum
You have a set of n numbers. You have a target number. You must find all the subsets of the set which add up to the target.
47
Heuristic
a **"rule of thumb"**. Produces an **approximate yet usable** solution to a problem. Often involve **small changes that sacrifice precision**. Useful when you need a **solution to an intractable problem**. Best applied when consequences of assumptions can be known and understood.
48
Recursive algorithm
**breaks down a problem into smaller problems that and then solves each of them in similar fashion**. Typically uses recursive functions in code.
49
Worst case time complexity of quicksort
O(n^2)
50
Average case time complexity of quicksort
O(nlog(n))
51
Worst + Average case time complexity of bubble sort
O(n^2)
52
Worst + Average case time complexity of insertion sort
O(n^2)
53
Best case time complexity of insertion sort
O(n)
54
Worst + Average + Best case time complexity of selection sort
O(n^2)
55
Non-english character set before Unicode
JIS X 0201 for basic japanese characters encoded in 7 bit and later 8 binary encoding. Dominant before Unicode replaced it.
56
Digital Input
Has two discrete values (ON/OFF). In electrical circuits these are represented by voltages (5V = ON, 0V = OFF) E.g. pushbutton, switch, keyboard, keypad
57
Analogue Input
Have any value within a certain range. Values constantly vary. Represent continuous data. E.g. temperature, sound, light, CO2 sensors
58
Components of a turing machine
1. Infinite tape (can hold symbols usually 1, 0 or B) 2. Tape head (that reads and writes symbols on tape moving left or right) 3. Transition Table (set of rules that define how the machine changes its state, reads/writes symbols, and moves the tape head)