Tag: iteration

Estimating Pi using the Monte Carlo Method


One method to estimate the value of π (3.141592…) is by using a Monte Carlo method. This methods consists of drawing on a canvas a square with an inner circle. We then generate a large number of random points within

Insertion Sort Algorithm


The Insertion sort algorithm is one of the key sorting algorithms used in Computer Science. To start with, the algorithm considers the first value of a list as a sorted sub-list (of one value to start with). This iterative algorithm

Bubble Sort Algorithm


The Bubble sort algorithm is one of the key sorting algorithms used in Computer Science. It is a fairly simple algorithm to implement and is particularly useful when you need to find the top x values of a list. The

Min, Max, Mean, Median and Mod


In this Python challenge we will manipulate a list of numbers to calculate the Min, Max, Mean, Median and Mod of all these numbers. First you may want to refresh your maths skills and check the meaning of these terms:

How old will you be in…


In this challenge we will write a Python program to help us find out hold we will be in the coming years! We have designed the algorithm of our program using both a Flowchart and Pseudocode. Algorithm Reviewing the Algorithm

Moroccan Mosaic


Moroccan mosaic, aka Zellige (الزليج‎‎), is a form of Islamic art and one of the main characteristics of Moroccan architecture. It consists of geometrically patterned mosaics, used to ornament walls, ceilings, fountains, floors, pools and tables. Each mosaic is a

How many sweets in the jar?


“Guess how many sweets are in the jar” is a fundraising game. A large see-through jar is filled with a carefully counted number of sweets. People then try to guess how many sweets are in the jar. Each contestant has

Pascal Triangle


In mathematics, one of the most interesting number patterns is Pascal’s Triangle. It is named after Blaise Pascal (1623 – 1662), a famous French Mathematician and Philosopher. To build a Pascal Triangle we start with a “1” at the top.

Infinite Quarter Series


The infinite quarter series is a series where each term is a quarter of the previous one: We can visually represent this series by dividing a canvas (or price of paper) into 4 quadrants and colouring in one quadrant (bottom

Euler’s Number


The number e is a famous irrational number called Euler’s number after Leonhard Euler a Swiss Mathematician (1707 – 1783). Number e is considered to be one of the most important numbers in mathematics. The first few digits are: 2.7182818284590452353602874713527…