Computer Science at Oxford Stephen Drape Access/Schools Liaison Officer.

Slides:



Advertisements
Similar presentations
Computer Science at Oxford
Advertisements

Recursion. Recursion is a powerful technique for thinking about a process It can be used to simulate a loop, or for many other kinds of applications In.
Introductory Lecture. What is Discrete Mathematics? Discrete mathematics is the part of mathematics devoted to the study of discrete (as opposed to continuous)
Mathematical Sciences at Oxford Stephen Drape. 2 Who am I? Dr Stephen Drape Access and Schools Liaison Officer for Computer Science (Also a Departmental.
Mathematical Sciences at Oxford Stephen Drape. 2 Who am I? Dr Stephen Drape Access and Schools Liaison Officer for Computer Science (Also a Departmental.
Kavita Math231 Recursion and Iteration. Kavita Math231 We use Recursion when we have to perform a complex task that can be broken into the several subtasks.
June 13, Introduction to CS II Data Structures Hongwei Xi Comp. Sci. Dept. Boston University.
Unit 181 Recursion Definition Recursive Methods Example 1 How does Recursion work? Example 2 Problems with Recursion Infinite Recursion Exercises.
Mathematical Sciences at Oxford Stephen Drape. 2 Who am I? Dr Stephen Drape Access and Schools Liaison Officer for Computer Science (Also a Departmental.
Choosing Oxford. 2 Who am I? Dr Stephen Drape Access and Schools Liaison Officer for Computer Science (Also a Departmental Lecturer) 8 years at Oxford.
Recursive Algorithms Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Mathematical Sciences at Oxford Stephen Drape Access/Schools Liaison Officer Computer Science.
Mathematical Sciences at Oxford Stephen Drape. 2 Who am I? Dr Stephen Drape Access and Schools Liaison Officer for Computer Science (Also a Departmental.
Recursion Chapter 7. Chapter 7: Recursion2 Chapter Objectives To understand how to think recursively To learn how to trace a recursive method To learn.
Dynamic Programming Introduction to Algorithms Dynamic Programming CSE 680 Prof. Roger Crawfis.
Test Preparation Strategies
Algebra Problems… Solutions
Your Name Oxford Explained. Do we offer a course you would enjoy? Would you find our teaching style engaging? Are you predicted the right grades? Could.
FANTASTIC FACTORING!!! Greatest Common Factor Difference of Squares Perfect Square Trinomial Leading Coefficient of One Leading Coefficient Not One All.
Key Stone Problem… Key Stone Problem… next Set 23 © 2007 Herbert I. Gross.
BIT Presentation 4.  An algorithm is a method for solving a class of problems.  While computer scientists think a lot about algorithms, the term.
MA/CSSE 473 Day 03 Asymptotics A Closer Look at Arithmetic With another student, try to write a precise, formal definition of “t(n) is in O(g(n))”
Number Sequences Lecture 7: Sep 29 ? overhang. This Lecture We will study some simple number sequences and their properties. The topics include: Representation.
Mathematical Sciences at Oxford Stephen Drape. 2 Who am I? Dr Stephen Drape Access and Schools Liaison Officer for Computer Science (Also a Departmental.
A Review of Recursion Dr. Jicheng Fu Department of Computer Science University of Central Oklahoma.
Recursion. Basic problem solving technique is to divide a problem into smaller subproblems These subproblems may also be divided into smaller subproblems.
Mathematics Review Exponents Logarithms Series Modular arithmetic Proofs.
CS212: DATA STRUCTURES Lecture 10:Hashing 1. Outline 2  Map Abstract Data type  Map Abstract Data type methods  What is hash  Hash tables  Bucket.
Choosing A University UCAS & Personal Statements.
The power of logarithmic computations Jordi Cortadella Department of Computer Science.
CS-2852 Data Structures LECTURE 12B Andrew J. Wozniewicz Image copyright © 2010 andyjphoto.com.
Comp 245 Data Structures Recursion. What is Recursion? A problem solving concept which can be used with languages that support the dynamic allocation.
ADA: 7. Dynamic Prog.1 Objective o introduce DP, its two hallmarks, and two major programming techniques o look at two examples: the fibonacci.
Nonvisual Arrays and Recursion by Chris Brown under Prof. Susan Rodger Duke University June 2012.
Module #14: Recursion Rosen 5 th ed., §§ In this class, we will study recursion, one of the most important topics in computer science. In the last.
Introduction Algorithms and Conventions The design and analysis of algorithms is the core subject matter of Computer Science. Given a problem, we want.
Basic Structure 3 Year BSc Single Honours  Single Honours: 3 year degree 120 credits of modules in each year; Modules are 20, 15 or 10 credits; 60 credits.
Multiplying Whole Numbers © Math As A Second Language All Rights Reserved next #5 Taking the Fear out of Math 9 × 9 81 Single Digit Multiplication.
University Admissions (to a Physics degree) (Based on what we do in Liverpool) Description of the cycle that will lead to admission in Sept 2010 The majority.
Discrete Structures for Computing
Fundamentals CSE 373 Data Structures Lecture 5. 12/26/03Fundamentals - Lecture 52 Mathematical Background Today, we will review: ›Logs and exponents ›Series.
Science Fair How To Get Started… (
Recursion. What is recursion? Rules of recursion Mathematical induction The Fibonacci sequence Summary Outline.
Recursion, pt. 1 The Foundations. What is Recursion? Recursion is the idea of solving a problem in terms of itself. – For some problems, it may not possible.
Week 6 - Monday.  What did we talk about last time?  Exam 1!  Before that:  Recursion.
CS 206 Introduction to Computer Science II 02 / 23 / 2009 Instructor: Michael Eckmann.
CSC 221: Recursion. Recursion: Definition Function that solves a problem by relying on itself to compute the correct solution for a smaller version of.
Data Structures R e c u r s i o n. Recursive Thinking Recursion is a problem-solving approach that can be used to generate simple solutions to certain.
240-Current Research Easily Extensible Systems, Octave, Input Formats, SOA.
Activity 1-19: The Propositional Calculus
{ What is a Number? Philosophy of Mathematics.  In philosophy and maths we like our definitions to give necessary and sufficient conditions.  This means.
Lecture 151 Programming & Data Structures Dynamic Programming GRIFFITH COLLEGE DUBLIN.
1 CS 381 Introduction to Discrete Structures Lecture #1 Syllabus Week 1.
Money, Money, Money. ➢ Time has advanced. It is now ten years later! Based on the choices you made in high school and college, you are going to work in.
Artificial Intelligence in Game Design Lecture 20: Hill Climbing and N-Grams.
CIE Centre A-level Further Pure Maths
Putting an Oxbridge application into context Some early considerations.
The Law of Averages. What does the law of average say? We know that, from the definition of probability, in the long run the frequency of some event will.
Oxford Understanding Sue Morris, Schools Liaison Officer, Jesus College, Oxford.
Number Sequences Lecture 7: Sep 27 (chapter 4.1 of the book and chapter of the notes) ? overhang.
Middle School Math at Endeavor Charter School By Carolyn Southard learn do The only way to learn mathematics is to do mathematics. -Paul Halmos.
Calculating percentages mentally
Incoming 9th Grade Registration Presentation
Primary Lesson Designer(s):
PSAT MATH Spring Scholars.
Recursion "To understand recursion, one must first understand recursion." -Stephen Hawking.
CS201: Data Structures and Discrete Mathematics I
CSE 373 Data Structures Lecture 5
Recursion Taken from notes by Dr. Neil Moore
Student Recruitment Officer
Presentation transcript:

Computer Science at Oxford Stephen Drape Access/Schools Liaison Officer

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

3 Myth 1: Little chance of getting in  False!  Statistically: you have around 20% chance Admissions data for 2009 entry: ApplicationsAcceptances% Comp Sci % Maths & CS % Maths % Maths & Stats % Physics % Chemistry %

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

5 Myth 3: College Choice Matters  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, computer- allocated college.  Application loads are intelligently redistributed in this way.  Lectures are given centrally by the department as are many classes for courses in later years.

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

7 Myth 4: You have to be bright  True!  We find it takes special qualities to benefit from the kind of teaching we provide.  So we are looking for the very best in ability and motivation.

8 Our courses  Computer Science  Computer Science firmly based on Mathematics  Mathematics and Computer Science  Closer to a half/half split between CS and Maths  Courses can be for three or four years

9 Entrance Requirements  Essential: A-Level Mathematics  Recommended: Further Maths or a Science  Note it is not a requirement to have Further Maths for entry to Oxford  For Computer Science, Further Maths is perhaps more suitable than Computing or IT  Usual offer is AAA  No offers based on A* as yet

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

11 Computer Science Year 1 Year 2 Year 3 MathematicsComputing Project work Year 4

12 Mathematics & Computer Science Year 1 Year 2 Year 3 MathematicsComputing Year 4 Project work

13 Some of the different courses  Functional Programming  Design and Analysis of Algorithms  Imperative Programming  Digital Hardware  Calculus  Linear Algebra  Logic and Proof

14 Useful Sources of Information  Admissions:   Computing Laboratory:   Mike Spivey’s info pages:  web2.comlab.ox.ac.uk/oucl/prospective/ugrad/csatox/  College admissions tutors

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

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

17 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”

18 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 = = 144

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

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

21 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

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

23 Our program would do this…

24 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.

25 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.

26 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

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

28 An example of the new function

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

30 Comments and Questions  If there’s any comments or questions then please ask.  There should be staff and students available to talk to Thank You

31

32 Finding the Highest Common Factor Example: Find the HCF of 308 and ) 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

33 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.

34 Creating a program  We are going to use a programming language called Haskell.  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.

35 Step 1  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.

36 Function for Step 1

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

38 Function for Step 2

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

40 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.

41 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.

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

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

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

45 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

46 Writing this algorithm in Haskell

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

48 Computer Science Core CS 1 (75%) Core CS 2 (50%) CS Options (50%) CS Options (25%) Advanced Options (50%) Project (25%) Advanced Options (66%) Project (33%) Core Maths (25%) Year 1 Year 2 Year 3 Year 4 (optional)

49 Mathematics & Computer Science Core 1 (100%) Core 2 (58%) CS Options (25%) CS Options (25-75%) Optional Project (33%) Maths Options (17%) Year 1 Year 2 Year 3 Year 4 (optional) Maths Options (25-75%) CS Options (25-75%)