Mathematical Sciences at Oxford Stephen Drape Who am

  • Slides: 52
Download presentation
Mathematical Sciences at Oxford Stephen Drape

Mathematical Sciences at Oxford Stephen Drape

Who am I? Dr Stephen Drape Access and Schools Liaison Officer for Computer Science

Who am I? Dr Stephen Drape Access and Schools Liaison Officer for Computer Science (Also a Departmental Lecturer) 8 years at Oxford (3 years Maths degree, 4 years Computer Science graduate, 1 year lecturer) 5 years as Secondary School Teacher Email: stephen. drape@comlab. ox. ac. uk 2

Four myths about Oxford There’s little chance of getting in n It’s very expensive

Four myths about Oxford There’s little chance of getting in n It’s very expensive in Oxford n College choice is very important n You have to be very bright n 3

Myth 1: Little chance of getting in n False! n Statistically: you have a

Myth 1: Little chance of getting in n False! n Statistically: you have a 20– 40% chance Admissions data for 2007 entry: Applications Acceptances % Maths 828 173 20. 9% Maths & Stats 143 29 20. 3% Maths & CS 52 16 30. 8% Comp Sci 82 24 29. 3% Physics 695 170 24. 5% Chemistry 507 190 37. 5% 4

Myth 2: It’s very expensive n False! Most colleges provide cheap accommodation for three

Myth 2: It’s very expensive n False! Most colleges provide cheap accommodation for three years. n College libraries and dining halls also help you save money. n Increasingly, bursaries help students from poorer backgrounds. n Most colleges and departments are very close to the city centre – low transport costs! n 5

Myth 3: College Choice Matters n False! If the college you choose is unable

Myth 3: College Choice Matters n False! If the college you choose is unable to offer you a place because of space constraints, they will pass your application on to a second, computerallocated college. n Application loads are intelligently redistributed in this way. n Lectures are given centrally by the department as are many classes for courses in later years. n 6

Myth 3: College Choice Matters n However… Choose a college that you like as

Myth 3: College Choice Matters n However… Choose a college that you like as you have to live and work there for 3 or 4 years n Look at accommodation & facilities offered. n Choose a college that has a tutor in your subject. n 7

Myth 4: You have to be bright n True! We find it takes special

Myth 4: You have to be bright n True! We find it takes special qualities to benefit from the kind of teaching we provide. n So we are looking for the very best in ability and motivation. n A typical offer is 3 A grades at A-Level n 8

Mathematical Science Subjects Mathematics n Mathematics and Statistics n Computer Science n Mathematics and

Mathematical Science Subjects Mathematics n Mathematics and Statistics n Computer Science n Mathematics and Computer Science n All courses can be 3 or 4 years 9

Maths in other subjects For admissions, A-Level Maths is mentioned as a preparation for

Maths in other subjects For admissions, A-Level Maths is mentioned as a preparation for a number of courses: n Essential : Computer Science, Engineering, Economics & Management (EEM), Materials, Economics & Management (MEM), Materials, Maths, Medicine, Physics n Desirable/Helpful : Biochemistry, Biology, Chemistry, Economics & Management, Experimental Psychology, History and Economics, Law, Philosophy , Politics & Economics (PPE), Physiological Sciences, Psychology, Philosophy & Physiology (PPP) 10

Admissions Process n Fill in UCAS and Oxford form n n Choose a college

Admissions Process n Fill in UCAS and Oxford form n n Choose a college or submit an “Open” Application Interview Test Based on common core A-Level n Taken before the interview n n Interviews Take place over a few days n Often have many interviews n 11

Entrance Requirements Essential: A-Level Mathematics n Recommended: Further Maths or a Science n Note

Entrance Requirements Essential: A-Level Mathematics n Recommended: Further Maths or a Science n Note it is not a requirement to have Further Maths for entry to Oxford n For Computer Science, Further Maths is perhaps more suitable than Computing or IT n Usual offer is AAA n 12

First Year Maths Course Algebra (Group Theory) n Linear Algebra (Vectors, Matrices) n Calculus

First Year Maths Course Algebra (Group Theory) n Linear Algebra (Vectors, Matrices) n Calculus n Analysis (Behaviour of functions) n Applied Maths (Dynamics, Probability) n Geometry n 13

Subsequent Years The first year consists of compulsory courses which act as a foundation

Subsequent Years The first year consists of compulsory courses which act as a foundation to build on n The second year starts off with more compulsory courses n The reminder of the course consists of a variety of options which become more specialised n In the fourth year, students have to study 6 courses from a choice of 40 n 14

Mathematics and Statistics The first year is the same as for the Mathematics course

Mathematics and Statistics The first year is the same as for the Mathematics course n In the second year, there are some compulsory units on probability and statistics n Options can be chosen from a wide range of Mathematics courses as well as specialised Statistics options n Requirement that around half the courses must be from Statistics options n 15

Computer Science n n Mathematics and Computer Science n n Computer Science firmly based

Computer Science n n Mathematics and Computer Science n n Computer Science firmly based on Mathematics Closer to a half/half split between CS and Maths Computer Science is part of the Mathematical Science faculty because it has a strong emphasis on theory

Some of the first year CS courses Functional Programming n Design and Analysis of

Some of the first year CS courses Functional Programming n Design and Analysis of Algorithms n Imperative Programming n Digital Hardware n Calculus n Linear Algebra n Logic and Proof n Discrete Maths n

Subsequent Years The second year is a combination of compulsory courses and options n

Subsequent Years The second year is a combination of compulsory courses and options n Many courses have a practical component n Later years have a greater choice of courses n Third and Fourth year students have to complete a project n 18

Some Computer Science Options n n n n Compilers Programming Languages Computer Graphics Computer

Some Computer Science Options n n n n Compilers Programming Languages Computer Graphics Computer Architecture Intelligent Systems Machine Learning Lambda Calculus Computer Security n n n n Category Theory Computer Animation Linguistics Domain Theory Program Analysis Information Retrieval Bioinformatics Formal Verification 19

Useful Sources of Information n Admissions: n n Mathematical Institute n n http: //www.

Useful Sources of Information n Admissions: n n Mathematical Institute n n http: //www. maths. ox. ac. uk/ Computing Laboratory: n n http: //www. admissions. ox. ac. uk/ http: //www. comlab. ox. ac. uk/ Colleges

What is Computer Science? It’s not just about learning new programming languages. n It

What is Computer Science? It’s not just about learning new programming languages. n It is about understanding why programs work, and how to design them. n If you know how programs work then you can use a variety of languages. n It is the study of the Mathematics behind lots of different computing concepts. n

Simple Design Methodology Try a simple version first n Produce some test cases n

Simple Design Methodology Try a simple version first n Produce some test cases n Prove it correct n Consider efficiency (time taken and space needed) n Make improvements (called refinements) n 22

Fibonacci Numbers The first 10 Fibonacci numbers (from 1) are: 1, 1, 2, 3,

Fibonacci Numbers The first 10 Fibonacci numbers (from 1) are: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55 The Fibonacci numbers occurs in nature, for example: plant structures, population numbers. Named after Leonardo of Pisa who was nicked named “Fibonacci” 23

The rule for Fibonacci The next number in the sequence is worked out by

The rule for Fibonacci The next number in the sequence is worked out by adding the previous two terms. 1, 1, 2, 3, 5, 8, 13, 21, 34, 55 The next numbers are therefore 34 + 55 = 89 55 + 89 = 144 24

Using algebra To work out the nth Fibonacci number, which we’ll call fib(n), we

Using algebra To work out the nth Fibonacci number, which we’ll call fib(n), we have the rule: fib(n) = fib(n – 1) + fib(n – 2) We also need base cases: fib(0) = 0 fib(1) = 1 This sequence is defined using previous terms of the sequence – it is an example of a recursive definition. 25

Properties The sequence has a relationship with the Golden Ratio Fibonacci numbers have a

Properties The sequence has a relationship with the Golden Ratio Fibonacci numbers have a variety of properties such as n fib(5 n) is always a multiple of 5 n in fact, fib(a£ b) is always a multiple of fib(a) and fib(b) 26

Writing a computer program Using a language called Haskell, we can write the following

Writing a computer program Using a language called Haskell, we can write the following function: > fib(0) = 0 > fib(1) = 1 > fib(n) = fib(n-1) + fib(n-2) which looks very similar to our algebraic definition 27

Working out an example Suppose we want to find fib(5) 28

Working out an example Suppose we want to find fib(5) 28

Our program would do this… 29

Our program would do this… 29

What’s happening? The program blindly follows the definition of fib, not remembering any of

What’s happening? The program blindly follows the definition of fib, not remembering any of the other values. So, for (fib(3) + fib(2)) + fib(3) the calculation for fib(3) is worked out twice. The number of steps needed to work out fib(n) is proportional to n – it takes exponential time. 30

Refinements Why this program is so inefficient is because at each step we have

Refinements Why this program is so inefficient is because at each step we have two occurrences of fib (termed recursive calls). When working out the Fibonacci sequence, we should keep track of previous values of fib and make sure that we only have one occurrence of the function at each stage. 31

Writing the new definition We define > fibtwo(0) = (0, 1) > fibtwo(n) =

Writing the new definition We define > fibtwo(0) = (0, 1) > fibtwo(n) = (b, a+b) > where (a, b) = fibtwo(n-1) > newfib(n) = fst(fibtwo(n)) The function fst means take the first number 32

Explanation The function fibtwo actually works out: fibtwo(n) = (fib(n), fib(n +1)) We have

Explanation The function fibtwo actually works out: fibtwo(n) = (fib(n), fib(n +1)) We have used a technique called tupling – which allows us to keep extra results at each stage of a calculation. This version is much more efficient that the previous one (it is linear time). 33

An example of the new function 34

An example of the new function 34

Algorithm Design When designing algorithms, we have to consider a number of things: n

Algorithm Design When designing algorithms, we have to consider a number of things: n Our algorithm should be efficient – that is, where possible, it should not take too long or use too much memory. n We should look at ways of improving existing algorithms. n We may have to try a number of different approaches and techniques. n We should make sure that our algorithms are correct. 35

36

36

Finding the Highest Common Factor Example: Find the HCF of 308 and 1001. 1)

Finding the Highest Common Factor Example: Find the HCF of 308 and 1001. 1) Find the factors of both numbers: 308 – [1, 2, 4, 7, 11, 14, 22, 28, 44, 77, 154, 308] 1001 – [1, 7, 11, 13, 77, 91, 143, 1001] 2) Find those in common [1, 7, 11, 77] 3) Find the highest Answer = 77 37

Creating an algorithm For our example, we had three steps: 1) Find the factors

Creating an algorithm For our example, we had three steps: 1) Find the factors 2) Find those factors in common 3) Find the highest factor in common These steps allow us to construct an algorithm. 38

Creating a program n n We are going to use a programming language called

Creating a program n n We are going to use a programming language called Haskell is used throughout the course at Oxford. It is very powerful as it allows you write programs that look very similar to mathematical equations. You can easily prove properties about Haskell programs. 39

Step 1 n n n We need produce a list of factors for a

Step 1 n n n We need produce a list of factors for a number n – call this list factor(n). A simple way is to check whether each number d between 1 and n is a factor of n. We do this by checking what the remainder is when we divide n by d. If the remainder is 0 then d is a factor of n. We are done when d=n. We create factor lists for both numbers. 40

Function for Step 1 41

Function for Step 1 41

Step 2 Now that we have our factor lists, which we will call f

Step 2 Now that we have our factor lists, which we will call f 1 and f 2, we create a list of common factors. n We do this by looking at all the numbers in f 1 to see if they are in f 2. n We there are no more numbers in f 1 then we are done. n Call this function: common(f 1, f 2). n 42

Function for Step 2 43

Function for Step 2 43

Step 3 Now that we have a list of common factors we now check

Step 3 Now that we have a list of common factors we now check which number in our list is the biggest. n We do this by going through the list remembering which is the biggest number that we have seen so far. n Call this function: highest(list). n 44

Function for Step 3 If list is empty then return 0, otherwise we check

Function for Step 3 If list is empty then return 0, otherwise we check whether the first member of list is higher than the rest of list. 45

Putting the three steps together To calculate the hcf for two numbers a and

Putting the three steps together To calculate the hcf for two numbers a and b, we just follow the three steps in order. So, in Haskell, we can define Remember that when composing functions, we do the innermost operation first. 46

Problems with this method Although this method is fairly easy to explain, it is

Problems with this method Although this method is fairly easy to explain, it is quite slow for large numbers. n It also wastes quite a lot of space calculating the factors of both numbers when we only need one of them. n Can we think of any ways to improve this method? n 47

Possible improvements Remember factors occur in pairs so that we actually find two factors

Possible improvements Remember factors occur in pairs so that we actually find two factors at the same time. n If we find the factors in pairs then we only need to check up to n. n We could combine common and highest to find the hcf more quickly (this kind of technique is called fusion). n Could use prime numbers. n 48

A Faster Algorithm This algorithm was apparently first given by the famous mathematician Euclid

A Faster Algorithm This algorithm was apparently first given by the famous mathematician Euclid around 300 BC. 49

An example of this algorithm hcf(308, 1001) = hcf(308, 693) = hcf(308, 385) =

An example of this algorithm hcf(308, 1001) = hcf(308, 693) = hcf(308, 385) = hcf(308, 77) = hcf(231, 77) = hcf(154, 77) = hcf(77, 77) = 77 The algorithm works because any factor of a and b is also a factor of a – b 50

Writing this algorithm in Haskell 51

Writing this algorithm in Haskell 51

An even faster algorithm hcf(1001, 308) 1001 = 3 × 308 + 77 =

An even faster algorithm hcf(1001, 308) 1001 = 3 × 308 + 77 = hcf(308, 77) 308 = 4 × 77 = hcf(77, 0) = 77 52