Computational Thinking Flashcards

You may prefer our related Brainscape-certified flashcards:
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 patterns and recognising when 2 are similar

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

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

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
Q

Importance of ASCII and Unicode

A

provide standard that is readable by other computers. Ensures outputs between them is consistent when communicating.

26
Q

NIbble

A

4 bits

27
Q

kilobit

A

1024 bits

28
Q

elegance

A

desirable characteristic indicates solution is as simple as possible. Only has necessary features, is clear and works efficiently

29
Q

comparing algorithms

A

key factor is efficiency (whichever does less work). This does not use time because that depends on computer executing algorithm

30
Q

amount of work algorithm does

A

-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
Q

Ignoring constants

A

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
Q

Linear complexity

A

when the amount of work done is n (or 5n or n +14) the work done is linearly proportional to the input size

33
Q

Big O notation

A

describes algorithmic time complexity. always features n the input size. Tells us how complexity of an algorithm grows as input grows. Describes worst case complexity of a program

34
Q

Equivalence classes

A

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
Q

constant time

A

when an algorithm always takes the same amount of time to complete. O(1)

36
Q

why equivalence classes are important

A

-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
Q

O(n^2) class

A

quadratic complexity algorithms. E.g. bubble sort because it features nested loops

38
Q

algorithmic time complexity

A

how long an algorithm would take to complete given an input of n. Independent of human measures of time(Seconds). The dominant term is the highest order of n (e.g. between n and n^2 it would be n^2)

39
Q

complexity cases

A
  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
Q

n^2 - n

A

This is approximately the same size as n^2 so we write O(n^2)

41
Q

worst case scenario for quicksort

A

-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
Q

intractable problems

A

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
Q

Examples of intractable problems

A

-traveling salesman
-knapsack problem
-subset sum

44
Q

traveling salesman

A

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
Q

knapsack problem

A

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
Q

Subset sum

A

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
Q

Heuristic

A

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
Q

Recursive algorithm

A

breaks down a problem into smaller problems that and then solves each of them in similar fashion. Typically uses recursive functions in code.

49
Q

Worst case time complexity of quicksort

A

O(n^2)

50
Q

Average case time complexity of quicksort

A

O(nlog(n))

51
Q

Worst + Average case time complexity of bubble sort

A

O(n^2)

52
Q

Worst + Average case time complexity of insertion sort

A

O(n^2)

53
Q

Worst + Average case time complexity of insertion sort

A

O(n^2)

54
Q

Worst + Average + Best case time complexity of selection sort

A

O(n^2)