Simple Financial Calculator.

In this post we will consider a simple financial calculator to see the effect of compounding interest, and also to estimate the number of years a particular sum of funds is able to last through retirement. The code will prompt the user to consider two scenarios, each with a starting amount, and the annual increment. […]

Assigning Exam Score.

Going one step back from the previous two posts (here and here), a Python code could be used to mark the answers submitted by students, returning the exam score for each student. With the data on hand, the distribution of the students’ choices for each question could be analysed, allowing the examiner to assess what […]

Travelling Salesman Problem. A Brute Force Approach.

The travelling salesman problem asks the following question: “Given a list of cities and the distances between each pair of cities, what is the shortest possible route that visits each city and returns to the origin city?” In the following post, the cities are represented by coordinates on a Cartesian plane. The distance (Euclidean distance) […]

Machine Learning. Classification with kNN.

This post will be looking at using the k-Nearest Neighbour (kNN) algorithm for a classification problem. Suppose there is a new data point that is required to be classified into one of the known categories that comprises the data. This algorithm will look at the k closest points (where k is an integer specified by […]

HPLC Calibration Curve and Data Analysis.

One common analysis a chemist does in a laboratory is the use of high performance liquid chromatography (HPLC) to determine the concentration of a particular analyte. After the method development is complete, a typical workflow for sample analysis is as follows:i) Measurement of the peak areas of various known concentration of the calibration standard.ii) Plot […]

A Little Bit of Reaction Engineering.

This post will be a little (just a little…) intensive on the physical chemistry side of things as I explore the other functions of the Python Programming Language, using an example on reaction kinetics.Let’s consider the following reaction scheme showing the elementary reactions, where the starting material A gets converted to B with a rate […]

Guessing game. Part II – Monte Carlo Simulation

We’ve created a simple game in the previous post (see Guessing Game) where the positions of ‘O’ and ‘X’ are shuffled randomly, and the player gets a point for making a correct guess. Let’s consider the scenario where someone wanted to monetise this game. Some of the considerations might be as follows:– how much should […]