Intro to Mathematics for Computer Science ANSWERS etc (MAY/JUNE) revised 1 June 2013 (06-20415 2012/13) Learning Outcome Involvement LO 1: apply a number of fundamental mathematical skills and techniques to the solution of problems relevant to computer science. LO 2: demonstrate a solid foundation in mathematics relevant to computer science sufficient to allow independent learning of further mathematical techniques in other computer science modules. All Questions are potentially relevant to CS, so both LOs are covered by all of them. Some topics not covered by the Examination were covered in (six) Class Tests. Creativity One or two questions have slightly creative aspects, e.g., the use of the Factor Theorem in Q13 to discover a factor. (NB: The module is a “remedial” one for students who have not previously done A-Level maths (or an equivalent) or who did it but did not get at least a B.) Answers and Marking Guide NOTES: No electronic calculation allowed. The students were asked to do TWELVE out of the 18 Questions. The questions are all equally weighted. For marking I’ll take the marks per Question to be 8, and then scale the student’s total mark to be out of 100. 1 QUESTION 1) (a) need to consider prime factors up to , which is more than 12 and less than 13 because We only . So the highest prime factor we need to try is 11. No primes up to 11 work, so 167 is prime. [4 marks] (b) 169 and 171 are co-prime. To establish this, you need to show they have no prime factors in common, or equivalently that their HCF is 1: The easiest method: You may know already or from working on (a) that check whether 13 divides 171, which it doesn’t. . So you only need to Next easiest method is to find the HCF by the iterated-remainder method: 171 rem 169 = 2, then 169 rem 2 = 1, so the HCF is 1. About as easy: The smallest prime number, 2, doesn’t divide 169. And any prime factor bigger than 2 that divides 169 must give a remainder of 2 when divided into 171, so it does not divide 171. So no prime number divides both 169 and 171. Alternatively: find the prime factorizations of 169 and 171 as primes in common. and respectively. They have no But this method involves unnecessary work. Once you’ve found ONE of the factorizations, you can just check whether any of the primes in it divide the other number—there’s no need to find the other factorization. That’s the essence of the first method above. The other way round: neither 3 nor 19 divides 169. [4 marks] if this is less than 0, and there is QUESTION 2) Need to multiply up by , so will reverse the inequality no result if it is zero. So we get greater than or less than if !" or !#" respectively. [4 marks for each inequality] QUESTION 3) $ % and $ & % , so their LCM is & % [2 marks for each factorization, 4 marks for deducing the LCM] QUESTION 4) )( +*, ( ' ( ' - .0/213&4 5 31 & . [no particular division of the 8 marks] QUESTION 5) (a) 6879 /;: $ $'=<?> $0 6879 /;: $$@ 6879 /;: <?> $ % /;: [3 marks] 6879 6879 6879 6879 GF - . 2 $,/21A/;: %B$DC E C . % $$' . [2 marks] (b) 6H79I 6879I 68790I KJ . Here 68790I 6879 6879 * 6879 6879,I . Similarly for . [3 marks] QUESTION 6) ML [2 marks:] Equation: NJPO . [2 marks:] Graph should show Q intercept at O and the slope or gradient should be stated to be with a delta- step shown along the line. RL L , preferably ML SJUO . At the intersection, we should get the same SJTO and [4 marks:] Let the two lines be ML L L / / L )J@O . This leads to for the value VO O D L L relevant value. So we examine / GJ%O / / / (if and aren’t equal). Then can be found from either equation. / Instead of showing this working, it is acceptable to state the two equations clearly and exactly and to say that any method for solving them as a pair of simultaneous equations will provide the and values of the intersection. QUESTION 7) Graph of Graph of J WX doesn’t cross x-axis and crosses y-axis at 3. F crosses x-axis at 3 and y-axis at -9. & [4 marks for each graph] QUESTION 8) (a) Y[Z for integer YB#"$ is the product of the integers from Y down to 1 (and NOT zero!!), and 0! = 1. Alternatively: The recursive definition: 0! = 1, and for any integer YB#\$ we define Y[Z Y WY] AZ . [2 marks] (b) Answer is WYTJ\^WY!J . [2 marks] (c) [2 marks:] Y[Z_D L L Z?WY` [2 marks:] Replacing L AZ_ by Y] L leads to an equivalent expression. QUESTION 9) (a) AB/BC if the angle a is at A, AB is the non-hypotenuse side from A, and BC is the opposite side. [3 marks] 3 (b) Student should show , and show where the cd j k a half-equilateral triangle, with side lengths ,b b . For full marks, should show how the is. Hence egfHhicd arises from Pythagoras. angle [5 marks] QUESTION 10) We can work out the A 5 angle, as c mlnPo . Letting p be the length of BC because it is t qerfHhil OuqegfHho . We can look up egfHhis and egfHhil so now we opposite A, etc., t we know that pqerfHhis can calculate . Similarly O . [4 marks for the Qqerf?hwv identity, 4 marks for the other steps] QUESTION 11) $xb + J b 4xb ]erf?hwdb 7 yerf?hiz e{ [1.5 marks each, except 2 for last one] QUESTION 12) (a) Application of the formula to give or . [4 marks] P M Q ^ | . (b) From those roots, we know that W~J ^W| .+~J W`J ^W|R , hence B} [4 marks] QUESTION 13) JDu@ W=J & jB 0 K WjJ0^W=B, NJ F WT*0^WX| , so X is a factor by the Factor Theorem. &SJ m : experiment shows that this is 0 when We then divide the expression by to get J\+UJ\ as the other factor. (This cannot be further factorized.) [2 marks each] QUESTION 14) b (a) The answer is . The student should show the working, and will probably use the subsitution method or the equating-coefficients method. [5 marks] 4 (b) The solution is the Wdb point at which the straight lines defined by the two equations cross. (The CuCuC form.) equations need not be put into [3 marks] QUESTION 15) The answer is . The student should show the working, and will probably proceed by first eliminating a variable from one pair of equations and the same variable from a different pair, thus leaving two simultaneous queations in the remaining variables. Those eliminations can be done by the substittuion method or the equating-coefficients method. [5 marks for getting the overall process right; 3 marks for details] QUESTION 16) The mean is 65. The student should preferably proceed by finding the deviations from a base, say 60 or 65, finding the mean of the deviations, and then adding the result to the base. [4 marks. Only 2 marks max if coding method not used.] The numbers in increasing order are 52, 58, 58, 64, 65, 73, 75, 75. There are 8 numbers, so the median is the mean of 4th and 5th, i.e. of 64 and 65. So answer is 64.5. [4 marks] QUESTION 17) (a) The powerset of a set S is the set of all subsets of S. $ bu $Db $$Db $$b 'b^ b $b $$, . The powerset of b $Db $$, is 4,b^ b^ $,b^ $$Dbu b [4 marks] (b) One Take s o type of counterexample: s%+a s whereas Vs+l~o so a . to be any non-empty set, and let l a . Then s%DVl~oj [4 marks] for any valid counterexample including enough working. NB: 2 of those marks are for understanding what the difference of two sets is. Students who thought the question was about the symmetric difference and tried it on that basis got 1 of these marks and credit for the attempt at a counterexample. However, symmetric difference is associative, so no counterexample can be found! QUESTION 18) (a) It is a subset of s t t l . (Alternatively: it is a set of ordered pairs Vp{b where p!]sb ]l .) [4 marks] 5 (b) Yes, it is: It does map every element of Z to something, and so it’s total. Notice here that negative numbers do have cube roots, even though they don’t have square roots. E.g., The cube root of -8 is -2. (A negative real number has a real-number kth root if and only if is odd.) The relation maps each element to only one value, so it’s functional. Notice here that a number has only one (real-valued) cube root (even though a positive real number has two square roots). The only cube root of 64 is 4 and the only cube root of -64 is -4. To finish: any total functional relation from a set s to a set l [4 marks] 6 is a function from s to l .