Course 161/2S3, Tutorial, Trinity Term, April 2006 1. Write a C program to generate 6 lottery numbers, using the rand() function. Your program should write numbers between 1 and 42 to an array and should ensure that no numbers are repeated. 2. Consider the matrices 3 6 9 A = 2 5 −2 and B = 1 3 −1 4 1 1 5 ! (1) . Find the condition numbers κ(A) and κ(B) for the ∞ norm. Recall that κ(A)∞ = ||A||∞ ||A−1 ||∞ and ||A||∞ = max1≤i≤n ie. the maximum row sum. Pn j=1 |aij |, Also recall that for 2 × 2 and 3 × 3 matrices the inverse matrix can be determined by the following A= a b c d ! ⇒ A −1 1 = detA d −b −c a ! , a13 a12 a33 a32 a12 a11 a32 a31 (3) (2) and a11 a12 a13 1 A = a21 a22 a23 ⇒ A−1 = detA a31 a32 a33 1 a22 a23 a32 a33 a23 a21 a33 a31 a21 a22 a31 a32 a11 a13 a31 a33 a12 a13 a22 a23 a11 a12 a21 a22 a13 a11 a23 a21 .