topic 2 - fundamental problems Flashcards
(103 cards)
what is computer science?
Computer Science is the study of computers and what they can do;the inherent powers and limitations of abstract computers; the design, char-acteristics and use of real computers; and the applications of computers tosolve problems
what is the difference between computer sciences and other sciences?
Problems in Computer Science are primarily about the repeated journey towards some goal, rather than just establishing a goal in isolation.
/what are key to the problems in computer science?
the constructive nature of their solutions; the repeated application of these solutions; and the concern with and measurement of the difficulty of solving problems
what are essential notions for finding solutions giving an example for each relating to a travelling salesman?
- computation (the salesman’s machine);* resource (the time taken); and* correctness (the quality of the solution)
how does the idea of abstraction of real world problems cause issues?
in order for a computer to solve a solution to a problem, the problem must be astracted so it shares the main characteristics however not completely identical to the real issue.
what is abstraction focused on in computer science?
with ‘information hiding’ than with ‘information neglect’
what are the essential qualities of the abstraction to solve a problem?
these abstractions need to be represented and manipulated within a computer program; and* these abstractions mirror reality sufficiently closely so that any conclusions reached (by the computer) remain valid as regards the real-world problem
what is the trade off when it comes to abstracting?
A trade-off arises between the quality of the solution and the general cost of getting the solution
how do you abstact a problem?
start with a base issue and then develop nessecary additions in order to be more accurate to true issue. for example the travelling sales man problem you may at first only look at the distances between citys then you may take into account the speed limits of the roads which will affect time taken to travel and then you can take into account the level of trafffic and so on
what is the features of a decision problem?
they consist of a set of instances and a subset of I which is a yes instance ’,with it being our job to decide upon the answer correctly.
how do you solve a desicion problem?
In order to solve a decision problem, we need to decide (using somealgorithm or program) whether any given instance is or is not a yes-instance
how would you represent in a graph a map colouring problem where there is only three colours and they cannot touch a state with the same colour?
represent the important information on a graph with nodes respresenting all the states and then join lines called edges between the nodes that are touching. the graph has the function G= (V, E) where V is a vertex (node) and E is set of edges
what was the first substantial theorem to be proved using a computer?
the four colour theorem which says every map can be coloured using 4 colours
how do you sort a list using lexicographic ordering?
we compare two lists by working down the lists entry by entry until two corresponding entries differ;* the list with the least entry (we assume that there is some ordering on the entries) is deemed to be the least of the two lists;* if we never find two different corresponding entries but run out of one of the lists then this shortest list is the least list (note that in this case ,the shorter list is a prefix of the longer one)
how would you abstract the question” Can you find a route from the start town to the end town, composed of interim routes from town to town, but so as to avoid motorways?” and what are the pros and cons?
you can abstract it two ways —-a graph G = (V, E) where the vertices correspond to towns and an edge(u, v) to the existence of a route from town u to town v avoiding any other town; together with* a list of edges corresponding to the (direct town-to-town) routes that are motorways; and* the start and end towns.—– or just as towns as the nodes and the various roads that are not motorways will be the edges. first is worst for information storage however is better if you want to make adjustments in future
what does a search problem consist off?
a set of instances I;* a set of solutions J; and* a binary search relation R ⊆ I × J
what is a binary search relation?
Binary search compares the target value to the middle element of the array. If they are not equal, the half in which the target cannot lie is eliminated and the search continues on the remaining half, again taking the middle element to compare to the target value, and repeating this until the target value is found.
why do you have to abstract both instances and the solution for a search problem?
we have to abstract solutions so that a solution returned from our computation corresponds to a solution of the underlying real-world (search) problem
what is the relationship between search problems and decision problems?
It is almost always the case that corresponding to any decision problem, there is a search problem and vice versa. as a search problem aims to find a solution rather than just prove there is one. and a decision problem will have the same set of instances as the search problem and the yes instance is when x is an instance and there is a corresponding to solution that matches x
what does an optimasation problem consist of ?
it consists of a set of instances I;* for every instance x ∈ I, there is a set of feasible solutions f (x);* for every instance x ∈ I and for every feasible solution y ∈ f (x), there is a value v(x, y) ∈ N = {0, 1, 2, . . .} giving the measure of the feasible solution y for the instance x; and* there is a goal which is either min or max .
what are the three outcomes of a maximisation optimisation problem?
Ideally you want to find a maximum however it may be the case that there are no feasible solutions for an instance; or for a maximization problem, there are feasible solutions of increasingly large measure. in both of the last two cases this should be signalled
how can you decide whether a graph can be coloured by hand?
you will need to develop a systematic procedure/ algorithm so that if the answer is yes you will be able to draw it by hand and if the answer is no then there still might be a possibility that it can be drawn by hand ie a false negative.
what is an effective procedure to solve a solution?
an effective procedure is one that is easy to implement and also gives back as few false errors as possible
what is the optimal solution to the colouring of a graph problem?
it is optimal when you can colour a graph with as few colours as possible and the solution is proper ie no same colours are touching