Algorithmic Problem Solving, Exam Paper - Mathematics - 3, Exams of Mathematics

Exercises Problem Sheet

Typology: Exams

2010/2011

Uploaded on 09/08/2011

russel85
russel85 🇬🇧

4.6

(5)

285 documents

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
G51APS-E1
The University of Nottingham
SCHOOL OF COMPUTER SCIENCE
A LEVEL 1 MODULE, AUTUMN 2009–2010
ALGORITHMIC PROBLEM SOLVING
Time allowed 1 hour 30 minutes
Candidates must NOT start writing their answers until told to do so.
Answer THREE questions.
Marks available for sections of questions are
shown in brackets in the right-hand margin.
Dictionaries are not allowed with one exception. Those whose first language is not English may use a
standard translation dictionary to translate between that language and English provided that neither
language is the subject of this examination. Subject specification translation dictionaries are not permitted.
No electronic devices capable of storing and retrieving text, including electronic dictionaries, may be used.
DO NOT turn examination paper over until instructed to do so
ADDITIONAL MATERIAL: Appendix with a summary of the mathematical laws discussed in the
APS lectures and tutorials.
INFORMATION FOR INVIGILATORS: The final page (containing fig. 4.1) should be handed in
with the examination book at the end of the examination. Please ensure that both are securely
tied together.
G51APS-E1 Turn over
pf3
pf4
pf5

Partial preview of the text

Download Algorithmic Problem Solving, Exam Paper - Mathematics - 3 and more Exams Mathematics in PDF only on Docsity!

G51APS-E

The University of Nottingham

SCHOOL OF COMPUTER SCIENCE

A LEVEL 1 MODULE, AUTUMN 2009–

ALGORITHMIC PROBLEM SOLVING

Time allowed 1 hour 30 minutes

Candidates must NOT start writing their answers until told to do so.

Answer THREE questions.

Marks available for sections of questions are shown in brackets in the right-hand margin.

Dictionaries are not allowed with one exception. Those whose first language is not English may use a standard translation dictionary to translate between that language and English provided that neither language is the subject of this examination. Subject specification translation dictionaries are not permitted.

No electronic devices capable of storing and retrieving text, including electronic dictionaries, may be used.

DO NOT turn examination paper over until instructed to do so

ADDITIONAL MATERIAL: Appendix with a summary of the mathematical laws discussed in the APS lectures and tutorials.

INFORMATION FOR INVIGILATORS: The final page (containing fig. 4.1) should be handed in with the examination book at the end of the examination. Please ensure that both are securely tied together.

G51APS-E1 Turn over

1 a) Table 1.1 shows a list of expressions and assignments to the variables in the expressions. State for each, whether or not the expression is an invariant of the assignment. Justify your answer, either by using the invariant rule for assignment statements, or by giving a counterexample. Assume that m and n are integers, and d and e are booleans. (10)

Assignment Expression Invariant? n := n+1 n mod 3? n := n+21 n mod 7? m , n := m+1 , n− 2 6 ×m + 3×n? m , n := m+1 , n− 2 3 ×m + 6×n? d , e := d , ¬e d = e?

Table 1.1 Fill in entries marked “?”

b) Full marks for the following question can only be obtained by not using case analysis.

In an abridged version of Shakespeare’s Merchant of Venice, Portia had two caskets: gold and silver. Inside one of these caskets, Portia had put her portrait, and on each was an inscription. Portia explained to her suitor that each inscription could be either true or false but, on the basis of the inscriptions, he was to choose the casket containing the portrait. If he succeeded, he could marry her.

The inscriptions are:

Gold: Exactly one of these inscriptions is true. Silver: This inscription is true if the portrait is in the gold casket.

Let pg stand for “the portrait is in the gold casket”, let ps stand for “the portrait is in the silver casket”, ig stand for “the inscription on the gold casket is true” and is for “the inscription on the silver casket is true”.

(i) What relation between pg and ps do you deduce from the fact that there is only one portrait?

(2)

(ii) What relation between ig and is do you deduce from the statement on the gold casket? (2)

(iii) What relation between is and pg do you deduce from the statement on the silver casket? (2)

(iv) By combining your answers to these three questions, deduce in which casket the portrait has been placed. What can you conclude about the two inscriptions? (4)

(v) Suppose now that the inscriptions on the caskets are the following:

Gold: Exactly one of these inscriptions is true. Silver: The portrait is in the gold casket.

Deduce in which casket the portrait has been placed. What can you conclude about the two inscriptions?

(5)

G51APS-E

that it is always carried when the bridge is crossed.

Describe an algorithm to get all the people across the river. Make clear how many crossings are needed and which individuals cross on each occasion. (You may use the notation pt for the person who takes time t to cross. So, p 1 is the one who takes 1 minute to cross, p 5 is the person who takes 5 minutes to cross, etc.) Full marks can only be obtained by giving an algorithm that minimises the total time taken.

(15)

4 a) An odd number of people, each armed with a water gun, are spread around a field, so that, for each of them, each of the others is a different distance away. At a given signal, each person fires at and hits his nearest neighbour (no one shoots themselves). Assume there are at least three people. Prove, using induction, that some person does not get wet at all. Your answer should be divided in the following two parts:

(i) The basis of your proof is when there are three people, so that, for each of them, each of the other two is a different distance away and they fire at the nearest neighbour. Explain carefully why in this case one person does not get wet. (5)

(ii) Suppose now that there are n people, where 3 < n and n is odd. We know that, for each of them, each of the others is a different distance away and they fire at the nearest neighbour. Prove, using induction, that some person does not get wet at all. State explicitly what is the induction hypothesis you use. (Hints: since all the distances are different, consider what happens to the two closest neighbours.)

(10)

b) Lucy, Minnie, Nancy, and Opey ran a race. Asked how they made out, three of them made the following pairs of statements:

Lucy: “Nancy won” ; “Opey was second”. Minnie: “Nancy was second”; “Opey was third”. Nancy: “Opey was last”; “Lucy was second”.

We know that each of the girls made one and only one true statement.

For the following questions, use the notation pn to denote that the person whose name starts by letter p ended the race in position n. For example, N 1 means that Nancy won the race and M 2 means that Minnie was second.

(i) Express Lucy’s statement using inequivalence. (2)

(ii) Express Minnie’s statement using inequivalence. (2)

(iii) Express Nancy’s statement using inequivalence. (2)

(iv) By combinining your answers to these three questions, deduce the final positions of each one of the girls. (Hints: conjunction distributes over inequivalence and for all p , q , m , and n , the following two rules hold: pm ∧ pn ≡ m = n and pn ∧ qn ≡ p = q .) (4)

G51APS-E

STUDENT IDENTIFICATION NUMBER:

Q

A B

C D

F G^ H

I J K

L M N

O P

E

Figure 4.1: (Question 2) Label each position with its mex number. This sheet should be handed in with your examination book.

G51APS-E1 End