Introduction
The title of this course is ‘Computational Methods’, and the module description states: On completion of this module a student should be able to:
- Demonstrate an understanding and ability to use Python,
- Understand the logical constructs used in computer programming to adopt a problem-solving frame of mind.
By working through the activities and tutorials, and by completing the coursework assessment, students should learn more than just Python syntax. Students will gain:
- an appreciation of the use of computational methods, algorithms and procedures,
- an understanding of the underlying concepts of programming, which are applicable to most programming languages,
- experience in implementing algorithms and procedures using code,
- experience in using code to solve problems.
Traditional approaches
Many courses in programming languages follow the following structure, where language syntax (the grammar and vocabulary of a programming language) is studied first; then algorithms are written by assembling bits of learned syntax together; and finally these written algorithms and procedures are used to solve problems:
This is a traditional method of learning programming, and can be successful. It does however have some barriers or bottlenecks: full syntax needs to be mastered, or the assembled algorithms may not be complete or efficient; and if the algorithms are incomplete they they won’t be useful to solve problems. Therefore number of key learning experiences (such as appreciation for the use of code, and algorithmic thinking) may be lost due to difficulties mastering the full syntax of the language.
Our approach
In this course a different approach will be taken.
This reverses the traditional approach: First we will use some pre-written code to solve some problems, developing an appreciation of why and how we use code and computer programs. Then we’ll begin thinking about algorithms and procedures, attempting to develop some algorithmic thinking and communicating instructions in a clear, precise and logical fashion. Finally we will translate these algorithms to code by learning any Python syntax required.
I hope this will help students gain a deeper appreciation of coding and computational methods than simply learning syntax, and developing an appreciation that specific programming languages separate from the computation itself, and are tools to implement the algorithms developed. This may better reflect how programming is used in a real world problem solving situation.
Assessment
Assessment will be 100% coursework. There is no exam. Further details can be found here.
Course Structure
This is a short module, lasting 5 weeks of contact time, but it is however worth 10 credits. For a 10 credit module you are expected to undertake at least 100 hours of study. Twenty of these hours will be scheduled contact time in class. The remaining 80 hours of study are for you to use how you wish, however I recommend splitting your time like so:
- 20 hours scheduled contact time
- 30 hours working on the coursework
- 50 hours reviewing, practising and understanding the work covered in lessons (that is 10 hours each week).
Contact time includes lessons in a lecture theatre, and time in the computer labs.
The schedule for the contact hours are as follows:
The first two weeks will focus on programming concepts such as variables, if statements, loops, and functions. Within this fortnight lessons will follow the reversed approach discussed earlier: using code, thinking algorithmically, writing code, and then understanding and practising using programming concepts in Python. The second fortnight will follow the same structure as the first, and will focus on object orientated programming. Finally the fifth week will introduce some useful Python libraries, that is using pre-written code, coming full circle.
In The Classroom…
Classes will take place in both a lecture theatre and in computer labs:
- In the lecture theatre…
- Use whichever technology you find useful! If you want to follow along using a laptop or tablet, please do. All notes are available online.
- You may find it useful to have Jupyter and Python in front of you to follow along and/or try out concepts as they are discussed, and I welcome this. This is not required.
- Please do not let this technology become a distraction to those around you.
- Discussions are good! But the room does not tend to allow for small group discussions without becoming a distraction to others. Instead, please engage with the whole class and myself and we can have class discussions that will be useful to everyone in the class.
- In the computer labs…
- I encourage you to work in your own machine if possible, however university computers will be available to all.
- Discussions are good! Please discuss work and ideas with peers if you will find this useful.
- Please engage with myself and the tutors, we are here for your benefit!
Software Installation
If possible I encourage you to use your own machine. You will need to install Python on your computer. There are various distributions of Python, we will use Anaconda which comes packaged with a variety of other useful tools including Jupyter notebooks which will be our main method of using Python in this course.
To install it on your personal machine follow these steps:
- Go to this webpage: https://www.anaconda.com/download/.
- Identify and download the version of Python 3 for your operating system (Windows, Mac OSX, Linux). Run the installer.
We will use a Jupyter notebook which runs in your browser. To open a local server find the Continuum navigator and click on Jupyter. You do not need to be connected to the internet to use this.
This video is a demo of using a notebook (taken from a different undergraduate course at Cardiff).