31
Mathematics for computing Volume 1 C.A. Whitehead CO1102 2004 Undergraduate study in Computing and related programmes This is an extract from a subject guide for an undergraduate course offered as part of the University of London International Programmes in Computing. It contains sample material from Volume 1 of the subject guide plus the table of contents for Volume 2. Materials for these programmes are developed by academics at Goldsmiths. For more information, see: www.londoninternational.ac.uk

Mathematics for computing Volume 1 - University of London · Mathematics for computing Volume 1 C.A. Whitehead CO1102 2004 Undergraduate study in Computing and related programmes

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Mathematics for computing Volume 1 - University of London · Mathematics for computing Volume 1 C.A. Whitehead CO1102 2004 Undergraduate study in Computing and related programmes

Mathematics for computing

Volume 1

C.A. Whitehead

CO1102

2004

Undergraduate study in Computing and related programmes

This is an extract from a subject guide for an undergraduate course offered as part of the

University of London International Programmes in Computing. It contains sample material

from Volume 1 of the subject guide plus the table of contents for Volume 2. Materials for these

programmes are developed by academics at Goldsmiths.

For more information, see: www.londoninternational.ac.uk

Page 2: Mathematics for computing Volume 1 - University of London · Mathematics for computing Volume 1 C.A. Whitehead CO1102 2004 Undergraduate study in Computing and related programmes

This guide was prepared for the University of London International Programmes by:

C.A. Whitehead

This is one of a series of subject guides published by the University. We regret that due to pressure of work the author is

unable to enter into any correspondence relating to, or arising from, the guide. If you have any comments on this subject

guide, favourable or unfavourable, please use the form at the back of this guide.

University of London International Programmes

Publications Office

32 Russell Square

London WC1B 5DN

United Kingdom

www.londoninternational.ac.uk

Published by: University of London

© University of London 2004

The University of London asserts copyright over all material in this subject guide except where otherwise indicated. All rights

reserved. No part of this work may be reproduced in any form, or by any means, without permission in writing from the

publisher. We make every effort to respect copyright. If you think we have inadvertently used your copyright material, please

let us know.

Page 3: Mathematics for computing Volume 1 - University of London · Mathematics for computing Volume 1 C.A. Whitehead CO1102 2004 Undergraduate study in Computing and related programmes
Page 4: Mathematics for computing Volume 1 - University of London · Mathematics for computing Volume 1 C.A. Whitehead CO1102 2004 Undergraduate study in Computing and related programmes
Page 5: Mathematics for computing Volume 1 - University of London · Mathematics for computing Volume 1 C.A. Whitehead CO1102 2004 Undergraduate study in Computing and related programmes
Page 6: Mathematics for computing Volume 1 - University of London · Mathematics for computing Volume 1 C.A. Whitehead CO1102 2004 Undergraduate study in Computing and related programmes
Page 7: Mathematics for computing Volume 1 - University of London · Mathematics for computing Volume 1 C.A. Whitehead CO1102 2004 Undergraduate study in Computing and related programmes
Page 8: Mathematics for computing Volume 1 - University of London · Mathematics for computing Volume 1 C.A. Whitehead CO1102 2004 Undergraduate study in Computing and related programmes
Page 9: Mathematics for computing Volume 1 - University of London · Mathematics for computing Volume 1 C.A. Whitehead CO1102 2004 Undergraduate study in Computing and related programmes
Page 10: Mathematics for computing Volume 1 - University of London · Mathematics for computing Volume 1 C.A. Whitehead CO1102 2004 Undergraduate study in Computing and related programmes
Page 11: Mathematics for computing Volume 1 - University of London · Mathematics for computing Volume 1 C.A. Whitehead CO1102 2004 Undergraduate study in Computing and related programmes
Page 12: Mathematics for computing Volume 1 - University of London · Mathematics for computing Volume 1 C.A. Whitehead CO1102 2004 Undergraduate study in Computing and related programmes
Page 13: Mathematics for computing Volume 1 - University of London · Mathematics for computing Volume 1 C.A. Whitehead CO1102 2004 Undergraduate study in Computing and related programmes
Page 14: Mathematics for computing Volume 1 - University of London · Mathematics for computing Volume 1 C.A. Whitehead CO1102 2004 Undergraduate study in Computing and related programmes
Page 15: Mathematics for computing Volume 1 - University of London · Mathematics for computing Volume 1 C.A. Whitehead CO1102 2004 Undergraduate study in Computing and related programmes
Page 16: Mathematics for computing Volume 1 - University of London · Mathematics for computing Volume 1 C.A. Whitehead CO1102 2004 Undergraduate study in Computing and related programmes
Page 17: Mathematics for computing Volume 1 - University of London · Mathematics for computing Volume 1 C.A. Whitehead CO1102 2004 Undergraduate study in Computing and related programmes
Page 18: Mathematics for computing Volume 1 - University of London · Mathematics for computing Volume 1 C.A. Whitehead CO1102 2004 Undergraduate study in Computing and related programmes
Page 19: Mathematics for computing Volume 1 - University of London · Mathematics for computing Volume 1 C.A. Whitehead CO1102 2004 Undergraduate study in Computing and related programmes
Page 20: Mathematics for computing Volume 1 - University of London · Mathematics for computing Volume 1 C.A. Whitehead CO1102 2004 Undergraduate study in Computing and related programmes
Page 21: Mathematics for computing Volume 1 - University of London · Mathematics for computing Volume 1 C.A. Whitehead CO1102 2004 Undergraduate study in Computing and related programmes
Page 22: Mathematics for computing Volume 1 - University of London · Mathematics for computing Volume 1 C.A. Whitehead CO1102 2004 Undergraduate study in Computing and related programmes
Page 23: Mathematics for computing Volume 1 - University of London · Mathematics for computing Volume 1 C.A. Whitehead CO1102 2004 Undergraduate study in Computing and related programmes
Page 24: Mathematics for computing Volume 1 - University of London · Mathematics for computing Volume 1 C.A. Whitehead CO1102 2004 Undergraduate study in Computing and related programmes
Page 25: Mathematics for computing Volume 1 - University of London · Mathematics for computing Volume 1 C.A. Whitehead CO1102 2004 Undergraduate study in Computing and related programmes
Page 26: Mathematics for computing Volume 1 - University of London · Mathematics for computing Volume 1 C.A. Whitehead CO1102 2004 Undergraduate study in Computing and related programmes
Page 27: Mathematics for computing Volume 1 - University of London · Mathematics for computing Volume 1 C.A. Whitehead CO1102 2004 Undergraduate study in Computing and related programmes
Page 28: Mathematics for computing Volume 1 - University of London · Mathematics for computing Volume 1 C.A. Whitehead CO1102 2004 Undergraduate study in Computing and related programmes

Mathematics for computing

Volume 2

P. Heidtmann and B. Jackson

CO1102

2005

Undergraduate study in Computing and related programmes

Page 29: Mathematics for computing Volume 1 - University of London · Mathematics for computing Volume 1 C.A. Whitehead CO1102 2004 Undergraduate study in Computing and related programmes

This guide was prepared for the University of London International Programmes by:

P. Heidtmann

B. Jackson

This is one of a series of subject guides published by the University. We regret that due to pressure of work the authors are

unable to enter into any correspondence relating to, or arising from, the guide. If you have any comments on this subject

guide, favourable or unfavourable, please use the form at the back of this guide.

University of London International Programmes

Publications Office

32 Russell Square

London WC1B 5DN

United Kingdom

www.londoninternational.ac.uk

Published by: University of London

© University of London 2005

The University of London asserts copyright over all material in this subject guide except where otherwise indicated. All rights

reserved. No part of this work may be reproduced in any form, or by any means, without permission in writing from the

publisher. We make every effort to respect copyright. If you think we have inadvertently used your copyright material, please

let us know.

Page 30: Mathematics for computing Volume 1 - University of London · Mathematics for computing Volume 1 C.A. Whitehead CO1102 2004 Undergraduate study in Computing and related programmes

Contents

Preface iii

1 Digraphs and relations 11.1 Digraphs . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Relations . . . . . . . . . . . . . . . . . . . . . . . . . 4

1.2.1 Using digraphs to illustrate relations . . . . . . 51.2.2 Equivalence relations . . . . . . . . . . . . . . . 51.2.3 Partial orders . . . . . . . . . . . . . . . . . . . 8

1.3 Relations and Cartesian products . . . . . . . . . . . . 91.4 Exercises on Chapter 1 . . . . . . . . . . . . . . . . . . 11

1.4.1 True/False questions . . . . . . . . . . . . . . . 111.4.2 Longer exercises . . . . . . . . . . . . . . . . . 11

2 Sequences, series and induction 132.1 Sequences . . . . . . . . . . . . . . . . . . . . . . . . . 13

2.1.1 Recurrence relations . . . . . . . . . . . . . . . 152.1.2 The Fibonacci sequence . . . . . . . . . . . . . 16

2.2 Induction . . . . . . . . . . . . . . . . . . . . . . . . . 172.2.1 The Principle of Induction . . . . . . . . . . . . 172.2.2 Proof by induction . . . . . . . . . . . . . . . . 18

2.3 Series and the Sigma notation . . . . . . . . . . . . . . 212.3.1 Expressing sums in Sigma notation . . . . . . . 222.3.2 Some standard series and their sums . . . . . . 242.3.3 Rules of arithmetic for sums . . . . . . . . . . . 26

2.4 Exercises on Chapter 2 . . . . . . . . . . . . . . . . . . 282.4.1 True/False questions . . . . . . . . . . . . . . . 282.4.2 Longer exercises . . . . . . . . . . . . . . . . . 29

3 Trees 313.1 Properties of trees . . . . . . . . . . . . . . . . . . . . 31

3.1.1 Recursive construction of all trees . . . . . . . . 343.1.2 The number of edges in a tree . . . . . . . . . . 353.1.3 Spanning trees . . . . . . . . . . . . . . . . . . 36

3.2 Rooted trees . . . . . . . . . . . . . . . . . . . . . . . . 363.2.1 Binary trees . . . . . . . . . . . . . . . . . . . . 38

3.3 Binary search trees . . . . . . . . . . . . . . . . . . . . 393.3.1 Subtrees of a binary tree . . . . . . . . . . . . . 403.3.2 Storing data in a binary search tree . . . . . . . 413.3.3 The height of a binary search tree . . . . . . . . 423.3.4 Finding a record in a binary search tree . . . . 44

3.4 Exercises on Chapter 3 . . . . . . . . . . . . . . . . . . 453.4.1 True/False questions . . . . . . . . . . . . . . . 453.4.2 Longer exercises . . . . . . . . . . . . . . . . . 46

4 Counting methods and probability 494.1 The basic counting methods . . . . . . . . . . . . . . . 49

4.1.1 Counting in which order is important . . . . . . 494.1.2 Counting in which order is not important . . . 544.1.3 Summary of strategies for counting problems . 56

4.2 Counting using sets . . . . . . . . . . . . . . . . . . . . 574.3 Probability . . . . . . . . . . . . . . . . . . . . . . . . . 64

4.3.1 Independent events . . . . . . . . . . . . . . . 67

i

Page 31: Mathematics for computing Volume 1 - University of London · Mathematics for computing Volume 1 C.A. Whitehead CO1102 2004 Undergraduate study in Computing and related programmes

CIS102 Mathematics for computing volume 2

4.4 Exercises on Chapter 4 . . . . . . . . . . . . . . . . . . 674.4.1 Multiple choice questions . . . . . . . . . . . . 674.4.2 Longer exercises . . . . . . . . . . . . . . . . . 704.4.3 Further exercises and worked examples . . . . 71

5 Systems of linear equations and matrices 735.1 Systems of linear equations . . . . . . . . . . . . . . . 73

5.1.1 Gaussian elimination . . . . . . . . . . . . . . . 785.2 Matrix algebra . . . . . . . . . . . . . . . . . . . . . . 80

5.2.1 Addition and subtraction of matrices . . . . . . 805.2.2 Multiplication of a matrix by a constant . . . . 815.2.3 Multiplication of two matrices . . . . . . . . . . 815.2.4 Powers of square matrices . . . . . . . . . . . . 825.2.5 Rules of arithmetic for matrices . . . . . . . . . 865.2.6 Identity matrices . . . . . . . . . . . . . . . . . 87

5.3 Exercises on Chapter 5 . . . . . . . . . . . . . . . . . . 885.3.1 True/False questions . . . . . . . . . . . . . . . 885.3.2 Longer exercises . . . . . . . . . . . . . . . . . 88

A Additional references 91

B Solutions to Exercises 93B.1 Exercises on Chapter 1 . . . . . . . . . . . . . . . . . . 93

B.1.1 Solutions to True/False questions . . . . . . . . 93B.1.2 Solutions to Longer exercises . . . . . . . . . . 93

B.2 Exercises on Chapter 2 . . . . . . . . . . . . . . . . . . 96B.2.1 Solutions to True/False questions . . . . . . . . 96B.2.2 Solutions to Longer exercises . . . . . . . . . . 96

B.3 Exercises on Chapter 3 . . . . . . . . . . . . . . . . . . 99B.3.1 Solutions to True/False questions . . . . . . . . 99B.3.2 Solutions to Longer exercises . . . . . . . . . . 99

B.4 Exercises on Chapter 4 . . . . . . . . . . . . . . . . . . 101B.4.1 Solutions to Multiple Choice questions . . . . . 101B.4.2 Solutions to Longer exercises . . . . . . . . . . 103

B.5 Exercises on Chapter 5 . . . . . . . . . . . . . . . . . . 105B.5.1 Solutions to True/False questions . . . . . . . . 105B.5.2 Solutions to Longer exercises . . . . . . . . . . 106

C Specimen examination questions 109

D Solutions to Specimen examination questions 113

E List of Symbols 119

ii