7: The Exam CS1021 CS1021 Exam structure Exam consists of - - PowerPoint PPT Presentation

7 the exam
SMART_READER_LITE
LIVE PREVIEW

7: The Exam CS1021 CS1021 Exam structure Exam consists of - - PowerPoint PPT Presentation

7: The Exam CS1021 CS1021 Exam structure Exam consists of 4 questions, answer any 3 Each question is in two (roughly) equal parts Questions similar in type to past papers, slight difference in topics. Similar to


slide-1
SLIDE 1

✬ ✫ ✩ ✪

7: The Exam

slide-2
SLIDE 2

CS1021

✬ ✫ ✩ ✪

CS1021 Exam structure

Exam consists of 4 questions, answer any 3 Each question is in two (roughly) equal parts Questions similar in type to past papers, slight difference in topics. Similar to exercises in notes

The Exam 7-1

slide-3
SLIDE 3

CS1021 CS1021 Exam structure (continued)

✬ ✫ ✩ ✪

  • Discrete structures
  • Sets
  • Functions
  • Logic
  • Relations
  • Induction
  • Combinatorics and Probability

Counts for 85% of mark for CS1021

The Exam 7-2

slide-4
SLIDE 4

CS1021

✬ ✫ ✩ ✪

Revision Q and A sessions

  • Friday Jan 16 at 11:00 in 1.1
  • Monday Jan 19 at 11:00 in 1.3

The Exam 7-3

slide-5
SLIDE 5

CS1021

✬ ✫ ✩ ✪

January 2002 Exam Paper

  • 1. a) Let A denote the propositional logic formula

((p ⇒ q) ⇒ (q ⇒ r)) ⇒ s

Find formulae in DNF and CNF forms which are equivalent to A, simplifying your answers where possible. (6 marks) Explain how the DNF form of a formula relates to its truth table, using the above formula A as an example. (2 marks)

The Exam 7-4

slide-6
SLIDE 6

CS1021

✬ ✫ ✩ ✪

b) Let K(x,y) denote the predicate “x knows y”, where the universe of interest is the set of all people in the world. Use quantifiers to express each of the following statements:- i) Everybody knows David ii) Everybody knows somebody iii) There is somebody whom everbody knows iv) Nobody knows everybody v) Everyone knows himself (or herself) vi) There is someone who knows no one except himself (or herself) Translate the following expressions into English:- vii) ∃x,y (K(John,x)∧K(John,y)∧(x = y)) viii) ∃x (K(John,x)∧∀y(K(John,y) ⇒ (x = y))) (12 marks)

The Exam 7-5

slide-7
SLIDE 7

CS1021 January 2002 Exam Paper (continued)

✬ ✫ ✩ ✪

  • 2. a) For each of the following relations on the set {2,3,4,5,6,7,8} say whether the

relation is reflexive, whether it is symmetric, whether it is transitive and whether it is an equivalence relation. i) a P b iff

a+b is odd

ii) a Q b iff

a+b is even

iii) a R b iff

ab is odd

iv) a S b iff

a+ab is even

Justify your answers and draw the digraph for each relation. For those relations that are equivalence relations, describe the equivalence classes. (14 marks)

The Exam 7-6

slide-8
SLIDE 8

CS1021 January 2002 Exam Paper (continued)

✬ ✫ ✩ ✪

b) The relation T on the set {a,b,c,d} is given by the set of pairs

{(a,a),(b,b),(c,c),(a,c),(a,d),(b,d),(c,a),(d,a)}

Find each of i) The reflexive closure of T ii) The symmetric closure of T iii) The transitive closure of T Give your answers either as sets of pairs or as digraphs. (6 marks)

The Exam 7-7

slide-9
SLIDE 9

CS1021 January 2002 Exam Paper (continued)

✬ ✫ ✩ ✪

  • 3. a) Prove by induction that, for all integers n ≥ 1

i)

n

i=1

1 (2i−1)(2i+1) = n 2n+1

ii) Show that any amount of postage over 12p can be made using only 4p and 5p stamps. (12 marks)

The Exam 7-8

slide-10
SLIDE 10

CS1021 January 2002 Exam Paper (continued)

✬ ✫ ✩ ✪

b) Give examples of functions from Z to Z which are i) injective but not surjective ii) surjective but not injective iii) both injective and surjective (but different to the identity function) iv) neither injective nor surjective (8 marks)

The Exam 7-9

slide-11
SLIDE 11

CS1021 January 2002 Exam Paper (continued)

✬ ✫ ✩ ✪

  • 4. a) State the inclusion-exclusion principle.

(2 marks) In a survey of the vegetable eating habits of 270 students, it is found that 64 like sprouts, 94 like broccoli, 58 like cauliflower, 26 like both sprouts and broccoli, 28 like both sprouts and cauliflower, 22 like both broccoli and cauliflower and 14 like all three vegetables. Use the inclusion-exclusion principle to find how many of the 270 students do not like any of these vegetables. (8 marks)

The Exam 7-10

slide-12
SLIDE 12

CS1021

✬ ✫ ✩ ✪

b) Assume that the probability a child is a boy is 0.51, and that the sexes of children born into a family are independent. What is the probability that a family of 5 children has i) at least one boy ii) at least one girl iii) all children of the same sex iv) exactly three boys (10 marks)

The Exam 7-11