Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Sample Paper 2: Model Answers

Legal & Ethical Issues

The first question asks for discussion of an ethical and/or legal issue that could arise with a
machine learning system that makes recommendations on loan applications. This question
could be answered in several different ways, such as arguing that it is unethical to have a
black-box algorithm make decisions that affect the lives of people (with no explanation of
the decisions made). Another option would be to discuss the issue of bias learned from the
training data. It is likely that any sizable historical data set would contain biases, and the
system could learn these, disadvantaging groups of customers based on ethnicity for
example.

Here is an example answer:

The historical training data is likely to contain biased decisions, and there is a risk that the
system could learn the same biases. The attributes include the area where the customer
lives (via the postal code) which is predictive of ethnicity and religion in some cases.
Suppose that staff making loan decisions had unconsciously discriminated against ethnic
minority customers, being more likely to refuse loans to them, and as a result the ‘reject’
decisions are more likely for postal codes belonging to neighbourhoods with a significant
ethnic minority population. Decisions made by the system could then discriminate in a way
that is unethical and possibly even illegal depending on local laws (e.g. the Equality Act 2010
in the UK). This would be a very serious issue and would need to be suitably managed.

One potential solution would be to remove any attributes that are predictive of ethnicity,
religion or other protected characteristics, for example removing the postal code and
making decisions based only on credit history and current salary. However this is likely to
reduce the accuracy of the system because it has fewer attributes to use to make the
prediction. Postal codes predict the value of a person’s main asset (i.e. their house). Another
possibility would be to investigate the training data for biases, or to monitor the system for
bias when in use. Both approaches would be plausible ways of managing the risk of bias.

(237 words)

Search

Question 2: The algorithm has both the frontier and explored sets, and does not specify any
particular way of selecting nodes from the frontier, so it is the generic Graph Search
algorithm.

Question 3: Depth-First search and the other algorithms derived from it (Iterative Deepening
and Depth-First Depth-Limited Search) would all use a stack to implement the frontier.
Question 4: The answer is ‘None of the above’. For the Graph Search version of A* Search,
the heuristic would need to be consistent (a stronger condition than admissible) to
guarantee that the first solution found is optimal.

Question 5: It’s A* Search so the evaluation function is the sum of the path cost and
heuristic: g(n)+h(n).

Question 6: Apply the Tree Search version of A* Search for three steps. A* Search needs to
keep track of the path cost of each node. I have written the path cost in brackets for each
node.

Initial frontier: [B (0)]

Node selected: B (0)


New frontier set: [E (3)]
Transition from state B to E has a cost of 3 – moving the crane.

Node selected: E (3)


New frontier set: [B (6), F (13)]
From E (3), we can either move the crane back over land with a cost of 3, or pick up the
container with a cost of 10.

Node selected: F (13)


New frontier set: [B (6), C (20), E (16)]
F (13) has an f-cost of 13+9=22, so it is selected. B (6) has a higher f-cost of 26. Expanding F
(13) generates two new nodes: C (20) by moving the crane, and E (16) by putting the
container down.

The question asks for 3 steps so we can stop here. If the search continued, the next node to
be selected would be C (20), and expanding C (20) would generate a node containing the
goal state A (as well as one other node).

Taking out the path costs in brackets, the answer to the exam question is:

Node Selected: B
New frontier set: E

Node Selected: E
New frontier set: BF

Node selected: F
New frontier set: BCE
Logic

Question 7: The symbol means inference. The symbols for inference and entailment look
similar (and the two concepts are closely related) but you should be familiar with both.

Question 8: Each of the four proposition symbols can be set to true or false in a model,
making 16 possible combinations, so there are 16 models in total.

Question 9: Given the starting assignment (where all symbols are set to false), only one
clause is unsatisfied (clause 1). Clause 1 contains A and B, and it is possible for the algorithm
to make a random choice of symbol to flip (i.e. a random move) because p>0. Therefore the
algorithm may choose to flip either A or B.

Two assignments are reachable after one step of WalkSAT:


● A=false, B=true, C=false, where B has been flipped; and

● A=true, B=false, C=false, where A has been flipped.

Question 10: The statement can be written first as a Horn clause in implication form:
( ¬ B ∧ S) ⇒ ¬ L
Then, converting to CNF, the answer is: (B ∨¬ S ∨¬ L)

Question 11: The question gives the search order for DPLL: assign symbols in order A, B, C,
and assign true before false. At the root node, the pure symbol rule and unit propagation
both do nothing.

The first step of DPLL is to assign A=true. Following this assignment, the pure symbol rule
does nothing, and unit propagation assigns B=true (by clause 3), then C=true (by clause 4), at
which point clause 5 is false. The answer for the first step is:

A=true, B=true, C=true, fail

Having failed after assigning A=true, DPLL will then try A=false. Following this assignment,
the pure symbol rule will do nothing. Unit propagation will assign B=true (by clause 1), then
C=true (by clause 2), then clause 5 is false. The answer for the second step is:

A=false, B=true, C=true, fail


Machine Learning

Question 12: The machine learning method logistic regression trains a model that is a linear
function followed by the logistic function. The model trained by logistic regression is
identical to a single neuron that has the logistic function as its activation function.

Question 13: The linear part of a neuron produces the value 6, and the question is to
evaluate the activation function (for three different activation functions). The hard
threshold function evaluates to 1 (because 6 is positive). The logistic function evaluates to a
number very close to 1 that would round to 1 (see Unit 7.5). The rectifier function evaluates
to 6, so the answer is 1,1,6.

Question 14: A reinforcement learning system learns by taking actions in an environment


and gaining feedback from the environment (i.e. evaluating the outcomes of the actions).

Question 15: The question involves evaluating neurons with the hard threshold activation
function. For each neuron, and each example, substitute the values of x and y from the
example into the neuron and calculate the output of the neuron (0 or 1). Compare the
output of the neuron to the label of the example to see if the neuron correctly predicts the
label. If the neuron gets all 4 labels right, then the answer is ‘yes’ for that neuron. The only
one that is accurate for all four examples is: f(x,y) = threshold(x + y – 3.5).

Question 16: The type of question is very similar to several examples in the module, and
formulas are given in the module for calculating sizes of output volumes and numbers of
weights (Unit 7.5.2). In the first dimension, the input volume has size 9 and the filter has size
4, so the filter can be placed in 6 positions within the input volume. The second dimension is
the same as the first, and the number of filters is 10. Therefore the output volume has
dimensions 6x6x10. The number of neurons is the product of the output volume
dimensions, i.e. 6x6x10 = 360. The number of weights is calculated from the receptive field
size and the number of filters: 4x4x3+1 = 49 weights per filter, multiplied by the number of
filters is 490.

You might also like