12.07.2015 Views

IN1004 - Mathematics for Computing mock exam - City University

IN1004 - Mathematics for Computing mock exam - City University

IN1004 - Mathematics for Computing mock exam - City University

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

THE CITY UNIVERSITYNo: XXXX<strong>IN1004</strong> <strong>Mathematics</strong> <strong>for</strong> <strong>Computing</strong>(<strong>mock</strong> <strong>exam</strong> paper)Sample ExaminationTime of <strong>exam</strong>Please read the instructions carefullyAnswer all questions in Section A and either section B or Section C.Calculators are allowed, except programmable onesThe NOTATION, DEFINITIONS and LAWS of Discrete <strong>Mathematics</strong> are appended.External Examiner: XXXXXExaminer: Prof B Cohen


<strong>IN1004</strong> <strong>Mathematics</strong> <strong>for</strong> <strong>Computing</strong>Questions <strong>for</strong> Section A1. Complete the following natural deduction proof by completing each of the eightmissing propositions or justifications, labelled (a) to (h).(4% each)(P∧Q) ∨ (¬P∧R)1. Assume(a)2. AssumeQ(b)3. (e)4. (f)(c)R(d)Q∨R((P∧Q) ∨ (¬P∧R)) → (Q∨R)5. Assume6. (g)7. (h)8. 1,2,4,5,7, ∨E9. 1, 9, →I2. State whether each of the following statements is True or False:a) {∅}∈℘℘∅b) {∅}⊂℘℘∅3. Trans<strong>for</strong>m the conjunction (Α∩Β)' ∩ (A∪C) into an equivalent disjunction.(4%)(4%)


<strong>IN1004</strong> <strong>Mathematics</strong> <strong>for</strong> <strong>Computing</strong>Questions <strong>for</strong> Section B4.A set, S, of students attend a university which offers a set, D, of degree courses and a set,M, of modules. The <strong>University</strong> maintains its records in the following relational model:degree: D↔M The modules required by each degree course.primary: D↔M In each degree some modules are primaryregistered: S→D Every student is registered on exactly one degree.passed S↔M The modules passed by each student are recorded.The regulations state that students who pass all their modules graduate and that a studentmay resit failed non-primary modules only if he/she has passed all his/her primarymodules.The following components may be derived from this model. Each is here defined usingeither a quantified predicate, or a set comprehension, or a relational expression.studies: S↔M The modules that each student studiesstudies = degree ° registeredpassedprimaries: ℘S Those students who have passed all their primary modules.∀s:S.(s∈passedprimaries ↔∀m:M.((registered(s) primary m) → (s passed m)))graduate: ℘S Those students who pass all the modules that they study.graduate = {s:S | studies[{s}] = passed[{s}]}resit: S↔M The failed modules that each student may resit.resit = (studies – passed)↑passedprimariessamemodule: S↔S all pairs of students who study at least one module in common∀s,t:S.((s samemodule t) ↔ ∃m:M.( (s studies m) ∧ (t studies m)))samecourse: S↔S all pairs of students who take exactly the same modulessamecourse = {(s, t):S×S | ∀m:M.( (s studies m) ↔ (t studies m))Provide an equivalent definition of:a) studies, using a Quantified Expression (4%)b) passedprimaries, using Set Comprehension, with no quantifiers (4%)c) graduate, using a Quantified Predicate (4%)d) resit, using Set Comprehension (4%)e) samemodule, using a Relational Expression (4%)f) samecourse, using a Relational Expression with the cf operator (4%)5. Complete the following table using T <strong>for</strong> true and F <strong>for</strong> false2% eachIs the relation: samemodule samecoursereflexive?symmetric?transitive?an equivalence relation?(16%)Section B is continued on the next page


<strong>IN1004</strong> <strong>Mathematics</strong> <strong>for</strong> <strong>Computing</strong>Questions <strong>for</strong> Section B (continued)6.(a) Negate each of the following two quantified expressions taking the negation asdeeply into the expression as possible, then(b) Express in English the meaning of the negated expression.(i)∀s:S.(s∈passedprimaries ↔(6% each)(4% each)∀m:M.((registered(s) primary m)→(s passed m)))(ii) ∀s,t:S.((s samemodule t) ↔ ∃m:M.((s studies m) ∧ (t studies m)))


(a) <strong>for</strong> all n>0, 2 1 ×1 + 2 2 ×2 + 2 3 ×3 + ... + 2 n ×n = 2 + (n-1)2 n+1 (20%)7. Complete the following truth table2% available per rowP Q R Q∧R P→T T TT T FT F TT F FF T TF T FF F TF F F<strong>IN1004</strong> <strong>Mathematics</strong> <strong>for</strong> <strong>Computing</strong>Questions <strong>for</strong> Section C(Q∧R)P∧Q P∧ R (P∧Q)↔(P∧R) (P→ (Q∧R)) →((P∧Q)↔(P∧R))(16%)8. Is the converse of the proposition (P→ (Q∧R)) → ((P∧Q) ↔(P∧R)) a tautology, or acontradiction, or neither?(4%)9. Prove by mathematical induction that:(b) <strong>for</strong> all n>6, n! > 3 n , where n! = 1×2×3×...×n is the factorial function(20%)


<strong>City</strong> <strong>University</strong>NOTATION, DEFINITIONS and LAWS of Discrete <strong>Mathematics</strong><strong>for</strong> use in undergraduate and postgraduate tests and <strong>exam</strong>inationsSETSLOGICSet comprehension {x:A⏐P(x)} ∀ (<strong>for</strong> all …) Universal quantifier(all elements of A that satisfy P) ∃ (there exists …) Existential quantifierNull set ∅ or {} is like F constant false‘Universal’ set U is like T constant falseIntersection ∩ is like ∧ AND (conjunction)Union ∪ is like ∨ OR (disjunction)Subset ⊆ is like → IF THEN (implication)Equality = is like ↔ IFF (equivalence)Complement of A A’ is like ¬ NOT (negation)x is/is not a member of A x∈A / x∉Apowerset (set of all subsets of A) ℘A set difference / or –cardinalilty (no. of elements in A) #A Proper subset ⊂RELATIONS and FUNCTIONSCartesian product of A and B A×B Inverse of R R -1ordered pair (∈A×B) (a,b) Domain (set of 1st elements) dom RR is a relation between A and B R : A↔BCodomain of R cod R or ran Ror R ⊆ A×B(set of 2nd elements)f is a (total) function from A to B f : A → B Composition of R with S S °Rf is any function from A to B f : A +→ B Transitive closure of R R +Image of X through R R[X] Corresponding function of cf(R):X→℘YDomain Restriction of R to X R ↑ X R: X↔YProperties of Relations Properties of Functionsif ∀a,b,c:X; R: X↔X• thenR is if ∀f: X+→Y• then f isa ∈ domR → (a,a) ∈ R reflexive f -1 ∈ Y+→X injective(a,b) ∈ R → (b,a) ∈ R symmetric ran f = Y surjective(a,b) ∈ R ∧ (b,a) ∈ R → a=b anti-symmetric f -1 ∈ Y →X bijective(a,b) ∈ R ∧ (b,c) ∈ R → (a,c) ∈R transitiveLAWS OF BOOLEAN ALGEBRAidempotence p∨p = p p∧p = passociativity (p∨q)∨r = p∨(q∨r) (p∧q)∧r = p∧(q∧r)commutativity p∨q = q∨p p∧q = q∧pdistributivity p∨(q∧r) = (p∨q) ∧ (p∨r) p∧ (q∨r) = (p∧q) ∨ (p∧r)identity p∨F = p p∨T = T p∧T = p p∧F = Fnegation p∨¬p = T ¬¬p = p p∧¬p = F ¬T = FDe Morgan’s ¬( p∨q) = ¬p ∧¬q ¬( p∧q) = ¬p ∨¬qimplication and biconditional p→q = ¬p∨q p↔q = p→q ∧ q→pNATURAL DEDUCTION PROOF RULESconjunction disjunction implication negation biconditional doubleIntroductionRulesEliminationRulesP; Q------∧IP∧QP∧Q------∧EPorP∧Q------∧EQP------∨IP∨QorQ------∨IP∨Q⎡P ⎡Q⎢: ⎢:P∨Q; ⎣R; ⎣R-----------------∨ER⎡P⎢:⎣Q-------→IP→QP→Q; P----------→EQ⎡P⎢:⎣Q∧¬Q----------¬I¬PP→Q; Q→P---------------↔IP↔QP↔Q------------------ ↔E(P→Q) ∧ (Q→P)negationP------¬¬I¬¬P¬¬P------¬¬EP

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!