Download Exam Template v1.0

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Boolean satisfiability problem wikipedia , lookup

Propositional formula wikipedia , lookup

Laws of Form wikipedia , lookup

Transcript
UNIVERSITY OF ABERDEEN
SESSION 2006-2007
Examination in CS3511 (Discrete Methods)
Date: 23 May 2006. Time: 9:00-11:00AM
Answer THREE out of these four questions.
Use a separate answer book for each question.
Each question is worth 25 marks; the marks for each part of a question are shown in brackets.
1.
Propositional Logic
(a) Express each of the following propositions using just  and . No proof of equivalence is needed.
(i)
pq
(ii)
pp
(iii)
pq
(iv)
(pq)r
(7)
(b) Simplify these formulas as much as possible. No proof of equivalence is needed.
(i)
(p(qr))(p(qr))
(ii)
p(pq)(qr)(rs)
(6)
(c) Translate the following argument into propositional logic, and prove it using Natural Deduction.
(Please number and justify each step of your proof in the usual way.)
Premisses: If it rains then it’s wet. If it’s wet then I’m miserable. I’m not miserable.
Conclusion: It does not rain.
(6)
(d) Consider a connective ‘*’ whose meaning is defined as follows:
p*q is false if and only if (p is false and q is true)
Which of the following is/are a tautology, which a contradiction, and which a contingency? Explain your answers.
(i) p*p
(ii) (p*p)p
(iii) (q*(q*p))*p
(6)
TURN OVER
Examination in CS3511 (Discrete Methods)
2.
- 2 of 3 -
May/June 2006
Mathematical Induction
(a) Explain briefly but precisely what is wrong with the following “proof” that all natural numbers
are larger than 500. (Saying that it proves a false proposition is not enough.)
Abbreviate P(n)= “n>500”
Basis step: P(0) is true. (Trivial.)
Inductive step: Suppose P(n) is true. Consider n+1. Since n>500 (by Induction Hypothesis),
it follows directly that n+1>500, that is, P(n+1). QED.
(6)
(b) Explain briefly but precisely what is wrong with the following “proof” that all people have the same age.
(Saying that it proves a false proposition is not enough.)
Abbreviate P(n) = “all people in any set consisting of n people have the same age”
Basis step: P(1) is true. (Trivial.)
Inductive step: Suppose P(n) is true. Now consider a set S of n+1 people, p_1,p_2,..,p_n+1.
Consider the set S1 consisting of the first n of these: {p_1,p_2,..,p_n.}. By Induction
Hypothesis, all its elements must have the same age (since it has n elements).
Consider the set S2 consisting of the last n of these: {p_2,p_3,..,p_n+1}. By Induction
Hypothesis, all its elements must have the same age (since it has n elements).
But S1 and S2 must have a nonempty intersection, from which it follows
that all elements of S itself have the same age. QED
(10)
(c) Explain briefly but precisely what is wrong with the following “proof” that, for every non-negative integer n,
6n=0. (Saying that it proves a false proposition is not enough.)
Let P(m) be short for “6m=0”
Basis step: P(0) is true. (Trivial)
Inductive step: Suppose P(j) is true for all nonnegative integers j such that 0jk. Consider k+1.
The number k+1 can be written as k+1 = x+y, where x and y are natural numbers smaller than k+1.
Clearly, 6(k+1)=6(x+y)=6x+6y. By Induction Hypothesis, 6x=6y=0, so 6(k+1)=0, hence P(k+1).
QED
(9)
TURN OVER
Examination in CS3511 (Discrete Methods)
3.
- 3 of 3 -
May/June 2006
Predicate logic
(a) Suppose you were to use predicate logic to capture some properties of animals. So far, you have
written the following formula: x(Horse(x)y(HorseHead(y)Has(x,y)) (“Every horse has a
head”). Suppose you want to formalise, in addition, that a horse can have only one head. How
would you do this in predicate logic?
(b) [Building on the question in (a)]. From these two propositions, plus the fact that every
horses’ head belongs to a horse (i.e., x(HorseHead(x)y(Horse(y)Has(y,x))),
can you infer that the number of horses’ heads equals the number of horses?
If yes, then explain why this is so. If not, then say in ordinary English
and in predicate logic what is missing.
(c) Consider the following formulas:
 = xG(x).  = xG(x).  = xG(x).
Assume that the domain is not empty.
(i)
(ii)
(iii)
(iv)
(6)
(7)
 = xG(x).
Select two of these formulas which cannot both be true and cannot both be false.
Select two of these formulas which can both be true but cannot both be false.
Select two of these formulas which can both be false but cannot both be true.
What is the fourth possibility? Can you select two of these formulas that satisfy it?
(Hint: It might help you to think of a concrete example, for instance a domain of 2 people in a room
and a predicate G(x) = “x is wearing a hat”)
(12)
4. Relations and Functions.
(a) Determine the transitive closure of each of the following relations:
(i)
The empty relation {}
(ii)
{(a,a)}
(iii)
{(a,b)}
(iv)
{(a,b),(b,a)}
(v)
The relation {(x,y): x is a natural number  y is a natural number  y=x+1}.
(vi)
The relation that holds between A and p if p a proposition and A is a set of propositions,
and p is obtained from the propositions in A using one of the inference rules of Natural Deduction
for propositional logic.
(8)
(b) Orderings
(i)
Consider the relation xy (“x is a subset of y”), defined on all sets x and y. Is this a Partial Order
(i.e., is it reflexive, antisymmetric, and transitive)? Is it a Linear Order (i.e., a Partial Order in
which xy(xy  yx)? Explain your answer.
(ii)
Consider the set S = {,{a},{a,b},{a,b,c},{a,b,c,d}, {a,b,c,d,e,f}},
with the relation xy (“x is a subset of y”).
Is the structure (S, ) a Partial Order? Is it a Linear Order? Explain your answer.
(9)
(c) Classify the following relations from S={a,b,c,d} to S’={a,b,c,d,e},
saying whether they are partial functions, functions, injections,
surjections, bijections. (Terminology: Recall that injection = one to one; surjection = onto):
(i)
(ii)
(iii)
(iv)
(v)
R1={a,a}
R2={(a,a), (b,b), (c,c),(d,d)}
R3={(a,b), (b,c), (c,d),(d,e),(e,a)}
R4={(a,b),(b,b),(c,b)}
R5={(a,b),(b,c),(c,d),(d,e)}
(8)
TURN OVER
Examination in CS3511 (Discrete Methods)
- 4 of 3 -
May/June 2006
TURN OVER