Computational thinking quiz

Topic 1

Section 2 - How does hardware execute software?

Question 18a

What is the Instruction Set Architecture (ISA)[2]

 

Question 18b

what is the primary component of the ISA? [1]

 

Question 19

Give three instructions of the MIPS (Microprocessor without Interlocked Pipeline Stages) ISA and explain carefully what they do. [6]

 

Question 20

What is an assembly language and what relationship does an assembly language have to a high-level programming language? [3]

 

Question 21

What are the three types that MIPS instructions are partitioned into? Briefly describe these types. [6]

 

Question 22

Detail four different functions of the operating system. [4]

 

Question 23

What is a process within an operating system and what are the two essential elements of a process? Is it the case that an operating system for a CPU with one processor can only have one process? [5]

 

Question 24

Explain the principle of mutual exclusion and give an illustration to show that ensuring mutual exclusion is important. [6]

 

Question 25

Describe the life-cycle of processes within the operating system (be sure to explain each component of the life-cycle). [10]

 

Question 26

What is a process control block (PCB) and what is one used for by the operating system> Name 3 items in a PCB. [6]

 

Question 27

 Explain the principle of context switching with regard to process control blocks [5]

Topic 2

Section 1 - What type of problem do we have to solve?

Question 1

Give three different notions relating to general problem solving that are key concerns in Computer Science? [3]

 

Question 2

What is abstraction in relation to real-world problem solving? How does abstraction in Computer Science differ from abstraction in other subjects? [4]

 

Question 3

What is the real-world travelling salesman problem? Explain how this problem is usually abstracted so that it is amenable to computational solution. Illustrate how this abstraction might not be in keeping with reality.

 

Question 4

What is the real-world map-colouring problem? Explain how we might abstract this problem as a graph colouring problem. What is a planar graph? Explain how planar graphs and maps are related. Is every graph a planar graph? [8]

 

Question 5

What is the real-world scheduling problem? Explain how we might abstract this problem as a graph colouring problem. [4]

 

Question 6

Give a precise definition of a decision problem. [2]

 

Question 7

What is a graph? What is a proper colouring of a graph and an optimal colouring of a graph? [5]

 

Question 8

Give a precise definition of a search problem and of a solution of a search problem. [5]

 

Question 9

Explain how there is always a decision problem corresponding to any search problem.[1]

 

Question 10

Give a precise definition of an optimisation problem and of a solution of an instance of an optimisation problem.[5]

 

Question 11

What is the Graph 3-Colouring (decision) problem and what is the Graph Colouring (optimisation) problem? [4]

 

Question 12

What is an independent set in a graph? What is the Independent Set (optimisation) problem? [3]

 

Question 13

What is the difference between a maximum independent set and a maximal independent set in a graph? [2]

 

Question 14

Outline a real-world application of finding independent sets in graphs (you should explain clearly how finding independent sets is related to solving the real-world problem). [5]

Section 2 - Methods to solve some fundamental problems?

Question 15

Give a (not necessarily precise) definition of what it means for an algorithm to be greedy. [2]

 

Question 16

Describe two different algorithms (in English) that enable you to colour graphs. Explain whether or not your algorithms yield an optimal colouring. [6]

 

Question 17

What is a crown graph on 2n vertices? What is the smallest number of colours that can be used so as to obtain a proper colouring of the crown graph? [4]

 

Question 18

Sometimes we can decide whether a graph can be coloured with a certain number of colours, k say, by transforming the graph into a smaller graph so that the original graph can be k-coloured if, and only if, the transformed graph can. On occasion, we can iteratively do this so that we get a graph so small that we can trivially see whether or not it can be k-coloured. Give an example of such a transformation that we might use in this way. [5]

 

Question 19

What do we mean by a brute-force algorithm to decide whether a graph can be coloured with 4 colours? [2]

 

Question 20

Outline a greedy algorithm for finding an independent set in a graph. Does your algorithm solve the Independent Set (optimisation) problem (optimally)? (If so then you should explain why; if not then you should provide a counter-example). [6]

 

Question 21

Outline a greedy algorithm for finding a tour in a given collection of cities. Does your algorithm solve the Travelling Salesman (optimisation) problem (optimally)? (If so then you should explain why; if not then you should provide a counter-example.) Show how your algorithm proceeds on the following instance of the Travelling Salesman problem (the city names are in bold and the distances between 2 cities are given in the table): [10]

Section 3 - From Algorithms to Software?

Question 22

Briefly (and, necessarily, without being too precise) explain the difference between an algorithm and a program. Suppose we have an algorithm and wish to implement it in Python. How many different implementations are there of this algorithm? [5]

 

Question 23

Give 4 different programming paradigms and briefly explain the underlying principle for each paradigm. [6]

 

Question 24

Give 4 different drivers of the evolution of programming languages and briefly explain each of these driving motivations. [4]

 

Question 25

Give 3 general properties any programming language should have. [3]

 

Question 26

What are the syntax and semantics of a programming language? Give 2 reasons why we should strive for a formal semantics for a programing language. [6]

 

Question 27

In order to execute a high-level program we must first convert it into machine code so that the CPU can ‘understand’ it. Briefly explain the difference between compilation and interpretation. [4]

 

Question 28

Give an advantage of compilation over interpretation, and of interpretation over compilation. [2]

 

Question 29

Outline a more refined view of (the phases of) compilation. [8]

 

Question 30

In compilation, over 50% of the time taken can be spent on lexical analysis; that is, character handling. In moving from a program as a string of symbols to a token stream, which algebraic construction is usually used to define tokens? [2]

Topic 3

Section 1 - Efficiency and Complexity

Question 1

Give two different resources used by an algorithm that we might measure? [2]

 

Question 2

Why do we usually measure the time taken by an algorithm rather than the time taken by an implementation of  an algorithm?     [2]

 

Question 3

What are the basic general principles behind measuring the time taken by some algorithm, expressed using pseudo-code, on some particular input?   [3]

 

Question 4

In pseudo-code we assume that any ‘basic’ instruction takes c units of time to execute. What is this constant c supposed to reflect? [2]

 

Question 5

What is the worst-case time complexity of an algorithm? Why is it expressed as a function on the natural numbers? [4]

 

Question 6

Define precisely what we mean when we say that two functions  f (n) :                                 N → N and g(n) : N → N are such that f = O(g).                                   [2]

 

Question 7

Consider the following functions:

 

Question 8

Suppose that you had two algorithms to solve some problem that had time complexities O()  and O() and two computers, one of which was 100 times faster than the other. Suppose also that you could only run the slower algorithm on the fast machine and the faster algorithm on the slower machine. Say which configuration you would choose to solve your problem and why. [4]  

 

Question 9a

What is the pseudo-code for the algorithm Bubble-sort?

 

Question 9b

What is the time complexity of Bubble-sort ? (You should explain your answer.) [5]

 

Question 10a

 What is the pseudo-code for the algorithm Selection-sort? 

 

Question 10b

What is the time complexity of Selection-sort ? (You should explain your answer.) [6]

Section 2 - Complexity and Hardness

Question 11

What do we mean when we say that a decision problem is tractable? What is the complexity  class P?           [4]

 

Question 12

Give two objections to the definition of a tractable problem as a problem solvable in O(nk) time, for some k.  [4]

 

Question 13

What do we mean when we say that a decision problem is efficiently checkable?  [3]

 

Question 14

What is the complexity class NP.  [2]

 

Question 15

Explain why the decision problem whose instances are  pairs  (G, b), with G a graph and b a natural number, and whose yes-instances are instances where G can be properly b-coloured is in NP.                         [3]

 

Question 16

What do we mean when we write P ⊆ NP? Explain why P ⊆ NP. [3]

 

Question 17

What is the P versus NP problem? [2]

 

Question 18

Define precisely the notion of a polynomial-time transformation.           [4]

 

Question 19

Prove the following: if X and Y are decision problems so that there is a polynomial-time transformation from X to Y Y ∈ P then X ∈ P

 

Question 20

Define what it means for a problem to be NP-complete. Prove that if

 

Question 21

What do we mean when we say that a problem is NP-hard?                 [2]

Section 3 - How can we solve hard problems?

Question 22

What is a brute-force algorithm? [2]

 

Question 23

Outline how an algorithm might generate every possible set of k vertices of a graph of size n (there is no need to present the full algorithm; just describe how your algorithm works in English). [6]

 

Question 24

Give two different heuristic methods for solving hard problems that are inspired by nature. [2]

 

Editors

View count: 7330